rust-lang / rust-lang/rust-analyzer

Code complete does not work with `cfg_attr` attribute

Open
#14,600 1 comment 2 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

Code complete does not work with the cfg_attr attribute, but it works fine with the cfg attribute.

  1. Code complete for predicate
#[cfg_attr(target_arch = "x86_64", inline(always))]
//         ^^^^^^^^^^^^^^^^^^^^^^ // code complete for predicate
fn test() {}
  1. Code complete for attr in cfg_attr
#[cfg_attr(target_arch = "x86_64", inline(always))]
//                                 ^^^^^^^^^^^^^^   // code complete for attr in cfg_attr
fn test() {}

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

Reproduce the two code-completion cases in the issue: the predicate and attribute positions in a Rust cfg_attr expression, comparing them with cfg. Trace the code-completion entry point for attributes and verify that both positions provide completion results for cfg_attr.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.