-
Notifications
You must be signed in to change notification settings - Fork 835
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
Proposal: Allow servers to customize the matching behavior of workspace symbols #2091
Comments
Apologies if this is slightly tangential, but could you say more about how you fixed this in VSCode? |
@HighCommander4 VSCode currently only allows skipped characters in the matched words, although the basic algorithm (Needleman–Wunsch) allows them in the pattern too. I changed it to allow skipped characters in the pattern as well. |
Did you fix this in upstream vscode (contribute a patch)? |
@HighCommander4, no, only locally - because I realized that something wider is needed, i.e. this proposal. |
A server may want to have a its own grammar for a workspace symbols request. For example, rust-analyzer supports
*
and#
modifiers (meaning search in dependencies and search non-types, respectively), and I want to extend it to support fully-qualified searches, aka.foo::bar::Baz
that will searchBaz
inbar
module infoo
.Such search does not currently work in VSCode (but does in other clients), because VSCode self-filters the responses if they don't fully contain the query. That is solvable; I implemented a fix for that in VSCode. The problem is that even with this fix, VSCode (and probably other clients too) score and highlight results based on the query, which leads to non-ideal result, like searching for
string::string
brings the obvious full-matchstd::string::String
(displayed to VSCode asString
) be shown way afterStringTooLongError
, because the latter also match, in addition to the fullString
, "tng" from the secondstring
, so it has a higher score. Plus the tng are highlighted, which looks very strange.I propose we allow servers to redefine the query, that is, send the client the part they should match against. In particular, extend the protocol with the following properties:
And define the type of a response to a Workspace Symbols Request to be
WorkspaceSymbols | SymbolInformation[] | WorkspaceSymbol[] | null
.The text was updated successfully, but these errors were encountered: