Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query_symbols changed to exact match #560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dezza
Copy link

@dezza dezza commented May 21, 2022

I could not find anything about the lsp spec suggesting to use fuzzy matching for this function. Opening this PR to discuss original intent.

Currently it breaks jumping to function in vim with :tag which is mapped to workspace/symbol in solargraph-lsp since all substring matches are also considered before the exact match. This is how it works in gopls as well.

Original issue: #44

I could not find anything about the lsp spec suggesting to use fuzzy matching for this function. Currently it breaks jumping to function in vim with `:tag` which is mapped to `workspace/symbol` in solargraph-lsp since all substring matches are also considered. This is how it works in `gopls` as well.

Issues that could be related castwide#292
@castwide
Copy link
Owner

I suspect that vim's :tag feature selects the first symbol from the array in the workspace/symbol response. Solargraph doesn't sort the results, so the first symbol is not necessarily the closest match. A better solution might be to sort the results; this will allow :tag to find the correct result while still allowing for fuzzy matching.

@dezza
Copy link
Author

dezza commented Jun 13, 2022

Thanks a lot for the suggestion and commit! Excuse my suggestions while I familiarize myself with the project. I thought it was easier to visualize with a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants