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

Work around bug in rust-analyzer to make auto-imports work nicely #376

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

JelteF
Copy link
Owner

@JelteF JelteF commented Jul 1, 2024

Resolves #351

Synopsis

Rust-analyzer doesn't ignore #[doc(hidden)] exports when they use a glob
pattern, only when they explicitely re-export.

Solution

This adds more level of indirection and one more glob pattern so that we put
#[doc(hidden)] on explicit re-exports. This definitely starts to feel like
we're doing hack upon hack here. But ah well, this seems to work. And working
well with the most popular LSP for Rust seems worth a bit of a hack.

@JelteF JelteF self-assigned this Jul 1, 2024
@JelteF JelteF requested a review from tyranron July 1, 2024 14:59
It starts to feel like we're doing hack upon hack here, but ah well,
this seems to work.
@JelteF JelteF force-pushed the fix-rust-analyzer-auto-imports branch from 8584a61 to 6d4f192 Compare July 1, 2024 14:59
@JelteF JelteF enabled auto-merge (squash) July 1, 2024 15:00
@JelteF
Copy link
Owner Author

JelteF commented Jul 1, 2024

To clarify I spent quite some time to try address this problem in rust-analyzer first, but that turned out not to be an easy task. So I gave up and implemented this workaround instead.

@JelteF JelteF added this to the 1.0.0 milestone Jul 1, 2024
@JelteF JelteF merged commit c165945 into master Jul 4, 2024
17 checks passed
@JelteF JelteF deleted the fix-rust-analyzer-auto-imports branch July 4, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-exporting std traits confuses Rust Analyzer
2 participants