-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add better documentation for excluding imports from symbol search #20050
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
Add better documentation for excluding imports from symbol search #20050
Conversation
ea63116
to
7492b63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -762,7 +762,11 @@ config_data! { | |||
/// though Cargo might be the eventual consumer. | |||
vfs_extraIncludes: Vec<String> = vec![], | |||
|
|||
/// Exclude imports from symbol search. | |||
/// Exclude all imports from workspace symbol search. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth defining what symbol search is (eg specifically where this ends up in the ui)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like the right location to explain symbol search to me. In my opinion that should be the job of the editor that exposes the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm saying is that VSCode doesn't have a feature named "symbol search". This is the internal LSP name that's not shared with anything that appears in the VSCode UI.
VSCode has "Go To Symbol" action, and it has various completion behavior that triggers searches of symbols. It also has "Find all references" (to a symbol), and "Find all Implementations". I wouldn't be surprised if there were other UIs that had some form of searching capability over symbols. So it's unclear which of these these settings control.
Digging into the source code to work it out suggests that this is probably only the "Go To Symbol" action and that it's documented (sort of) in https://rust-analyzer.github.io/book/features.html#workspace-symbol (which I found by looking for all instances of "workspace.symbol" in the source). Is that the only place that this behavior surfaces, or does it affect other places?
As an aside, I'd intuitively thought that this actually applied to the symbol search that appears when completing symbols, so my complaint about confusion is grounded in actual confusion, not a hypothetical one (I've used VSCode every day for many years - I'm not unfamiliar with it).
I suspect that the symbol search action was possibly renamed at some point, or maybe we're just used to referring to it by the internal name rather than the UI name, but the settings are configured with respect to the UI names, so they should reference those names. I'm guessing a setting rename probably wasn't anticipated here, but it might be appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This should make the option less confusing.
@joshka do you think this documentation is good?