-
Couldn't load subscription status.
- Fork 384
Closed
Labels
subsystem::highlightingIssues related to code highlightingIssues related to code highlightingsubsystem::proc-macrosIssues related to procedural macrosIssues related to procedural macros
Description
Environment
- IntelliJ Rust plugin version: 0.4.162.4280-213-nightly
- Rust toolchain version: 1.57.0-nightly (8f8092cc3 2021-09-28) x86_64-pc-windows-msvc
- IDE name and version: CLion 2021.3 (CL-213.5744.254)
- Operating system: Windows 10 10.0
- Macro expansion engine: new
- Name resolution engine: new
- Additional experimental features: org.rust.cargo.features.settings.gutter, org.rust.cargo.evaluate.build.scripts, org.rust.macros.proc
All experimantal features enabled.
Problem description
Depends on inner parsing algorithms of your proc-macros, you can face some coloring problems.
- Case 1, 2: macro was colored almost correctly, but only for first 2 arguments, the
Go To Definitionfeature also works only for first arguments (i.e. it witll work forUserandexecutor, but won't work withlogin_var). - Case 3 has broken color near
const. - Cases 4, 5 and 6 demonstrates differently broken painting.
Go To Definitionwon't work at all, even with first argumentUser, which works at cases 1 and 2.
It turns out that expanding macros and painting code inside a macro brackets depends on the internal parsing rules? What should be the parsing to make the text in the macro look correct for the end user? (assuming the macro expands to valid code, i.e. at cases 1 and 2 which expands to valid code, but colored correctly only for first 2 arguments)
Steps to reproduce
- Clone repo, i've created special branch for this issue - https://github.com/chamoretto/function-like-macro-expansion-problem/tree/issue-coloring-examples
- Try to expand examples from
testfunction
webern
Metadata
Metadata
Assignees
Labels
subsystem::highlightingIssues related to code highlightingIssues related to code highlightingsubsystem::proc-macrosIssues related to procedural macrosIssues related to procedural macros

