rust-lang / rust-lang/rust-analyzer

Open generated file, if "Go to Definition" on `include!` macro

Open
#14,975 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Feature Request:

The extension current supports to "go to definition" of struct
that is defined in the generated files.

It would be more convenient if I can open the generated file
through the include! macro.

If "go to definition" is used on include! macro,
VSCode should open the included file, instead of where include! is defined,
(Do not think anyone interested in how a built-in macro is written)
similar to what "C/C++" extension does.
This also need to handle env!("OUT_DIR") inside include!

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

The issue identifies include! and env!("OUT_DIR") as the relevant entry points, but names no files or tests. Start by tracing Go to Definition handling for include!; done means VSCode opens the included generated file rather than the built-in macro definition, including OUT_DIR paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Feature
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.