Skip to content

Fully qualified proc-macros are classified as functions #7114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AdnoC opened this issue Dec 31, 2020 · 3 comments
Closed

Fully qualified proc-macros are classified as functions #7114

AdnoC opened this issue Dec 31, 2020 · 3 comments
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@AdnoC
Copy link
Contributor

AdnoC commented Dec 31, 2020

Related: #6881
Related: #7073

Classification obtained by wrapping https://github.com/rust-analyzer/rust-analyzer/blob/339aab37744e7bfcab1def72acb26b81da6408ce/crates/ide/src/goto_definition.rs#L115-L118 in a dbg!() and running rust-analyzer analysis-bench src/main.rs --goto-def src/main.rs:6:5 and rust-analyzer analysis-bench src/main.rs --goto-def src/main.rs:9:15.

src/main.rs:

// using the unzip-n crate

use unzip_n::unzip_n;

//  Classification: `Definition(Macro(MacroDef { id: MacroDefId { krate: CrateId(53), ast_id: None, kind: ProcMacro(ProcMacroExpander { krate: CrateId(53), proc_macro_id: None }), local_inner: false } }))`
unzip_n!(3);

// Classification `Definition(ModuleDef(Function(Function { id: FunctionId(1115) })))`
unzip_n::unzip_n!(4);

fn main() {}

Cargo.toml:

[package]
name = "ratest"
version = "0.1.0"
authors = ["AdnoC <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
unzip-n = "0.1.2"
@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Jan 18, 2021
@jonas-schievink
Copy link
Contributor

This is fixed, presumably happened when we taught name resolution to handle procedural macros better

@jonas-schievink
Copy link
Contributor

Actually it might not be, but the highlighting is now correct

@jonas-schievink
Copy link
Contributor

I tested with dbg!() again and this is now definitely fixed, possibly by #8088, so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

3 participants