rust-lang / rust-lang/rust-analyzer

SCIP index symbols for struct/enum/const/static/impl nested in functions do not include function name

Open
#18,771 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This is demonstrated in tests included in #18758

The reason I did not fix this in that PR is that hir representation only appears to know what module these definitions are in, and not whether they are contained in a function. I am not familiar enough with rust-analyzer internals to provide such information. The fix would involve a change to the enclosing_definition method or the methods it calls.

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 with the tests referenced in #18758 and inspect the enclosing_definition method and the methods it calls. Trace how SCIP symbols for definitions nested in functions are assembled, then verify that struct, enum, const, static, and impl symbols include their enclosing function name.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.