Skip to content

feat: Add Config Option to Exclude Locals from Document Symbol Search #20420

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

Merged
merged 2 commits into from
Aug 11, 2025

Conversation

iorizu
Copy link
Contributor

@iorizu iorizu commented Aug 10, 2025

This PR adds a new workspace configuration option to exclude local variables from Document Symbol Search.

Addresses #20403.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2025
@iorizu iorizu force-pushed the doc-symbols-filter branch 2 times, most recently from 417d42d to bf4a38a Compare August 10, 2025 17:11
@iorizu iorizu requested a review from ChayimFriedman2 August 10, 2025 17:12
@iorizu iorizu force-pushed the doc-symbols-filter branch from bf4a38a to 51a89d6 Compare August 10, 2025 22:05
@iorizu
Copy link
Contributor Author

iorizu commented Aug 10, 2025

Hey, @ChayimFriedman2, on my latest push, the CI check CI/ Rust (macos-latest) failed with a clippy check:

error: this expression creates a reference which is immediately dereferenced by the compiler
Error:    --> crates/ide/src/file_structure.rs:277:47
    |
277 |         let structure = file_structure(&file, &config);
    |                                               ^^^^^^^ help: change this to: `config`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

error: could not compile `ide` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

But this check is not run by cargo clippy, cargo xtask tidy, or cargo check. You have to run cargo clippy --all-targets . Additionally, neither the Windows nor the Ubuntu checks run it either. I think we should make sure that it is run locally.

Edit: This code that failed was located under a mod test, so that may explain why it wasn't caught by any other checks.

Edit: When I added a needless borrow in a non test module, cargo clippy caught it. Good to know.

@iorizu iorizu force-pushed the doc-symbols-filter branch from 51a89d6 to 0a4d7dc Compare August 10, 2025 22:48
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Aug 11, 2025
Merged via the queue into rust-lang:master with commit 7b65a45 Aug 11, 2025
16 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2025
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.

3 participants