Skip to content

Special cases where variables are highlighted in the color of the macro definition #12321

Open

Description

Environment

  • OS and Version: Win10 x64
  • VS Code Version: 1.89.1
  • C/C++ Extension Version: v1.20.5
  • If using SSH remote, specify OS of remote machine: No

Bug Summary and Steps to Reproduce

Bug Summary:
Special cases where variables are highlighted in the color of the macro definition

Steps to reproduce:

  1. Define two macro definitions, with macro definition 1 pointing to macro definition 2, and macro definition 2 pointing to an assignment statement, with macro definition 2 being longer than macro definition 1
  2. Use macro definition 1 and macro definition 2 respectively
  3. Macro Definition 1 has incorrect syntax highlighting in parentheses, but Macro Definition 2 is correct
  4. Local variables within the brackets of macro definition 1 are partially highlighted in the color of the macro definition and depend on the length of macro definition 2

Expected behavior:
Variables are correctly highlighted

Snipaste_2024-05-22_10-56-29

Configuration and Logs

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "__TASKING__",
                "BRS_COMP_TASKING"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions