marksman
marksman copied to clipboard
Feature request: improve reference candidate suggestion
Problem
The reference candidate list is often incomplete when the project contains a large amount of markdown files.
Root cause
The incomplete candidate list is due to the following implementation choices:
- "let maxCandidate = 50" In https://github.com/artempyanykh/marksman/blob/7f3b47162cdcb42ca98415cf41e68b39387912d2/Marksman/Server.fs#L789, the number of candidates is capped by a hardcoded value (i.e., 50). If the project contains more than 50 markdown files, the extra files won't be considered as candidates.
- The filter is only applied on the incomplete candidate The keywords that client type in are not used as filters when building the candidate list. They are only applied after the candidate is built, which is incomplete already, so the client cannot the desired reference sometimes. (This is my guess and I haven't confirmed in the code)
Fix
I believe fixing any one of them would greatly improve the suggestion experience.
- Make
maxCandidate
configurable to the user. - Apply the keyword filter when building the candidate list. Only the candidate that matches the keyword (e.g., filename) will be added to the list, instead of building the incomplete candidate list first and then find matches among them.