rust-lang / rust-lang/rust-analyzer

Rust-analyzer vscode extension : missing codes under macro in Outline

Open
#12,665 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Example of code from tokio below, the codes wrapped in macro cfg_rt is not visible in vscode Outline. I have set rust-analyzer.cargo.features: "all"

cfg_rt! {
    pub fn spawn_local<F>(future: F) -> JoinHandle<F::Output>
    where
        F: Future + 'static,
        F::Output: 'static,
    {
        spawn_local_inner(future, None)
    }
}

macro_rules! cfg_rt {
    ($($item:item)*) => {
        $(
            #[cfg(feature = "rt")]
            #[cfg_attr(docsrs, doc(cfg(feature = "rt")))]
            $item
        )*
    }
}

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 issue in the VS Code Outline using the tokio example, the cfg_rt! macro, and rust-analyzer.cargo.features set to "all". Compare which items appear inside and outside the macro; done means the Rust items wrapped by cfg_rt! are visible in the Outline.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.