Skip to content

Incorrect semantic tokens for proc macros used directly from a proc macro crate. #21615

@Quelfth

Description

@Quelfth

If I create a crate which depends on another proc-macro crate, and then use the proc macro it defines, the name of the proc macro in the use statement will recieve the semantic token type function rather than procMacro. If I pub use it and then import that export from yet another crate then it will show up correctly as procMacro. I suspect this is an example of a larger class of bugs where the semantic token type of a particular used item matches some real item that exists at that path, but which isn't actually visible/usable from here. For instance if there also exists a private module in the proc macro crate with the same name as the proc macro itself, the the used name will have the semantic token namespace. It doesn't make sense for these semantic tokens to show up like this because the semantic token implies using an item that isn't visible from here.

Metadata

Metadata

Labels

C-bugCategory: bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions