rust-lang / rust-lang/rust-analyzer

Items with `#[cfg(doc)]` are ignored by intra-doc links

Open
#12,462 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Items adorned with #[cfg(doc)] are not included in intra-doc links name resolution, which is demonstrated on the following GIF

Expected Behavior

Adding #[cfg(doc)] on an item should not remove it from the set of items visible by intra-doc links. The intra-doc link to that item should still be highlighted.

Meta

rust-analyzer version: f94fa62d6 2022-05-30 stable
rustc version: rustc 1.60.0 (7737e0b5c 2022-04-04)

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 intra-doc link behavior using the example demonstrated in the linked GIF, then inspect rust-analyzer's name resolution for items marked with #[cfg(doc)]. The work is done when such items remain visible to intra-doc links and the link is highlighted as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.