microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

Constants defined c++ highlight not working #12401

Closed paulotovo closed 1 month ago

paulotovo commented 2 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: In a .h file with code snippet surrounded by a constant definition, it is not displayed (highlight) correctly whether the constant is defined or not.

Steps to reproduce:

`#undef TEST_CONST

ifdef TEST_CONST

define XXXXXXXX 10

endif

define TEST_CONST

ifdef TEST_CONST

define XXXXXXXX 10

endif`

Expected behavior:

The isolated code by the constant definition should appear highlighted if the constant is defined, otherwise it should appear disabled.

image

Configuration and Logs

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
            ],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

browntarik commented 2 months ago

Could you provide the output of the C/C++: Log Diagnostics function when you open this file?

Do you have your C_Cpp.dimInactiveRegion setting set? If so, what is the current value?

Is IntelliSense working correctly otherwise?

github-actions[bot] commented 1 month ago

This issue has been closed because it needs more information and has not had recent activity.