rust-lang / rust-lang/rust-analyzer

No autocomplete for Tool Prelude attributes in VsCode.

Open
#19,276 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-completion C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Thank you all for putting in the work and effort to make Rust the best language ever!

I am having a problem with the rust_analyzer tool in VsCode. There is no autocomplete for the Tool Prelude attributes. I was incapable of finding answers on google.

The Tool Prelude is imported. I already tested #[rustfmt::skip] for example and it's working just fine

The only problem is the autocomplete. Here is my rust analyzer configurations in VsCode:

  "rust-analyzer.inlayHints.lifetimeElisionHints.enable": "always",
  "rust-analyzer.inlayHints.reborrowHints.enable": "always",
  "rust-analyzer.cargo.features": "all",

I am pretty confident this is not a VsCode problem because the intellisense seems to be working perfectly well for everything else. I suspect it is a rust_analyzer configuration issue, since rust_analyzer is also working perfectly fine for everything else as well.

I don't really know if this is a VsCode problem or a rust_analyzer problem. I don't even know if it is a problem thanks to the only clue i got from The Rust Prelude:

"When a tool is not in use, the tool’s attributes are accepted without a warning. When the tool is in use, the tool is responsible for processing and interpretation of its attributes."

Is this even a problem? I am completely lost and any help would be deeply appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the missing autocomplete in VSCode with rust_analyzer, using the Tool Prelude attribute example #[rustfmt::skip] from the report. Check whether completion is expected for imported tool attributes and compare it with the existing autocomplete behavior for other Rust attributes. Done means the behavior is explained and, if confirmed as a bug, covered by an appropriate rust_analyzer test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.