-
Notifications
You must be signed in to change notification settings - Fork 89
Workspace Symbol Provider lists all struct method definitions instead of just the struct definition #150
Comments
If you do a workspace/symbols request, would you expect those results to show? |
I don't understand the issue. The actual screenshot looks 100% correct to me |
@felixfbecker yes, I would expect a search query to match all possible fields we return in symbol information. The ordering that vscode does is also useful in this case. But maybe matching these values is actually not that useful for end users. Keen to hear the rational. |
Nope
Workspace Symbol Search is more like Go To Definition and not Find All References. |
@ramya-rao-a I understand, but as a user, I see it as a feature if a workspace/symbol query for a class also returns methods of that class, meaning my query is applied not only to |
@felixfbecker Interesting.. I wonder if we can have a setting in VS Code to control that. This could be a whole new feature. Created a feature request in the language server repo for this. microsoft/language-server-protocol#183 Coming back to how the protocol is defined at the moment, @keegancsmith can we only match the query with |
It isn't defined anywhere afaik: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#workspace_symbol Would like to know this because the PHP LS also matches more than just |
Oh the woes of documentation... You are right, the protocol doesnt explicitly call out that the query should match the I was making my statement based on the below from https://code.visualstudio.com/docs/extensions/language-support#_show-all-all-symbol-definitions-in-folder Updated microsoft/language-server-protocol#183 description asking for clarification |
@ramya-rao-a I understand and agree it should only return symbol definitions, but the question is whether it should for example also return method definitions if you queried for a class name (because the containerName matches the query). I find it useful as a user if it does |
I did a Workspace Symbols Search for "Win" in with https://github.com/rogpeppe/godef as a workspace in Visual Studio Code.
Actual:
In the background you can see that
Addr
is a method onWin
. Same goes for everything appearing afterAddr
in the list.Expected:
The text was updated successfully, but these errors were encountered: