microsoft / microsoft/vscode-cpptools

ID with same name as funtion macro highlighted incorrectly

Open
#14,220 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Colorization Feature: Hover (Quick Info) Language Service parser Visual Studio
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);
Image

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);
Image

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.