Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inactive code regions with #include fail #13029

Open
xamix opened this issue Dec 6, 2024 · 1 comment
Open

Inactive code regions with #include fail #13029

xamix opened this issue Dec 6, 2024 · 1 comment
Labels
bug Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@xamix
Copy link

xamix commented Dec 6, 2024

Environment

  • OS and Version: W10
  • VS Code Version: 1.95.3
  • C/C++ Extension Version: 1.22.11 and also 1.23.2 (pre release)
  • CMake Tools extension v1.19.52

Bug Summary and Steps to Reproduce

Bug Summary:

The disabled code region fail on simple case.
I'm using CMake and the MSVC 2022 C compiler, with the following simple code

#define USE_FIRST
#define USE_ANTYHING

#if defined(USE_FIRST)
    #include <stdio.h>
#elif defined(USE_SECOND)
    #include <stdio.h>
#else
    #error Either USE_FIRST or USE_SECOND must be defined
#endif

int main(int argc, char *argv[]) {
    printf("Main executed\r\n");
    return 0;
}

The normal output is the following:
Image

However sometimes it's failing
For example when you press one or two times the Ctrl+S (save file) then the disabled dimed area fail:
Image

Steps to reproduce:

You can check the simple code here to reproduce, it use CMake:
Bug.zip

Configuration and Logs

Here is the generated `c_cpp_properties.json`


{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22000.0",
            "compilerPath": "cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

@sean-mcmanus
Copy link
Contributor

@xamix Thanks for reporting this. I've filed bug https://developercommunity.visualstudio.com/t/C-IntelliSense-inactive-regions-are-in/10808031 against our shared IntelliSense parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Language Service Visual Studio Inherited from Visual Studio
Projects
Status: No status
Development

No branches or pull requests

2 participants