microsoft / microsoft/vscode-cpptools
ID with same name as funtion macro highlighted incorrectly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Type: Bug
typedef int A;
#define A()
#define b(a) b(a)
void b(A a);
Here, A in void b(A a); should be green like a typename, but it is purple like a macro.
#define a()
#define b(a) b(a)
void b(int a);
Here, a should be grey like a parameter in void b(int a); and white like a constant in #define b(a) b(a), but it is purple like a macro in both places.
This only occurs when the typename is inside a function macro's arguments or in a macro's expansion definition.
Extension version: 1.31.0
VS Code version: Code 1.109.5 (072586267e68ece9a47aa43f8c108e0dcbf44622, 2026-02-19T19:43:32.382Z)
OS version: Linux x64 6.8.0-100-generic
Modes:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source files or tests. Start by reproducing the two C snippets in the C/C++ extension's highlighting context, then trace how identifiers are classified in macro arguments and macro expansions. Done means the typename, parameter, and macro-parameter examples receive the colors described in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100