Skip to content

Intellisense Breaks When Using "import" as a part of variable name and enabling C++20 #5272

Closed

Description

Type: LanguageService

Describe the bug

  • OS and Version: Linux x64 5.5.9-1-default - OpenSuse Tumbleweed
  • VS Code Version: 1.44.0
  • C/C++ Extension Version: 0.27
  • Other extensions you installed (and if the issue persists after disabling them):
  • Does this issue involve using SSH remote to run the extension on a remote machine?: No
  • Description: When enabling C++20 via cppStandard settings, the IntellisenseBreaks when encountering import substring despite not being a valid keyword token

Steps to reproduce

  1. Enable c++20 in cppStandard settings
  2. Name a variable "import_xxxx"
  3. Intellisense breaks, syntax highlight for variables in the source file is missing, and displays an error on the variable "import_xxxx". The error is: could not find module file for module "_xxxx"

Expected behavior

The Intellisense does not fail when encountering variable name beginning with "import" in a source file.

Logs
-------- Diagnostics - 4/9/2020, 2:30:03 PM
Version: 0.27.0
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c11",
    "compilerArgs": [],
    "cppStandard": "c++20",
    "intelliSenseMode": "clang-x64",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ]
    }
}
Translation Unit Mappings:
[ /home/gilang/source/v8/src/wasm/module-instantiate.cc ]:
    /home/gilang/source/v8/src/wasm/module-instantiate.cc
    /home/gilang/source/v8/src/execution/isolate.h
[ /home/gilang/source/v8/test/fuzzer/wasm-compile.cc ]:
    /home/gilang/source/v8/test/fuzzer/wasm-compile.cc
    /home/gilang/source/v8/src/execution/isolate.h
Translation Unit Configurations:
[ /home/gilang/source/v8/src/wasm/module-instantiate.cc ]:
    Process ID: 13364
    Memory Usage: 551 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /usr/include/c++/9
        /usr/include/c++/9/x86_64-suse-linux
        /usr/include/c++/9/backward
        /usr/local/include
        /usr/lib64/clang/9.0.1/include
        /usr/include
        /home/gilang/source/v8
        /home/gilang/source/v8/build/gen
    Standard Version: c++20
    IntelliSense Mode: clang-x64
    Other Flags:
        --clang
        --clang_version=90001
[ /home/gilang/source/v8/test/fuzzer/wasm-compile.cc ]:
    Process ID: 13531
    Memory Usage: 535 MB
    Compiler Path: /usr/bin/clang
    Includes:
        /usr/include/c++/9
        /usr/include/c++/9/x86_64-suse-linux
        /usr/include/c++/9/backward
        /usr/local/include
        /usr/lib64/clang/9.0.1/include
        /usr/include
        /home/gilang/source/v8
        /home/gilang/source/v8/build/
        /home/gilang/source/v8/include
    Standard Version: c++20
    IntelliSense Mode: clang-x64
    Other Flags:
        --clang
        --clang_version=90001
Total Memory Usage: 1086 MB

cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 62)
cpptools/getDocumentSymbols: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 63)
cpptools/getDocumentSymbols
cpptools/activeDocumentChange: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/textEditorSelectionChange
cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 64)
idle loop: reparsing the active document
Checking for syntax errors: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
Queueing IntelliSense update for files in translation unit of: /home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/textEditorSelectionChange
cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 65)
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 1
Error squiggle count: 1
Update IntelliSense time (sec): 5.417
cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 66)
cpptools/activeDocumentChange: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/textEditorSelectionChange
cpptools/textEditorSelectionChange
cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 67)
idle loop: reparsing the active document
Checking for syntax errors: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
Queueing IntelliSense update for files in translation unit of: /home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 1
Error squiggle count: 1
Update IntelliSense time (sec): 5.327
cpptools/getDiagnostics (id: 68)
terminating child process: 13912
terminating child process: 13913
terminating child process: 13914
terminating child process: 13915
cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 69)
cpptools/activeDocumentChange: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/textEditorSelectionChange
idle loop: reparsing the active document
Checking for syntax errors: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
Queueing IntelliSense update for files in translation unit of: /home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 1
Error squiggle count: 1
Update IntelliSense time (sec): 5.56
cpptools/getCodeActions: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc (id: 70)
cpptools/activeDocumentChange: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/textEditorSelectionChange
idle loop: reparsing the active document
Checking for syntax errors: file:///home/gilang/source/v8/src/wasm/module-instantiate.cc
Queueing IntelliSense update for files in translation unit of: /home/gilang/source/v8/src/wasm/module-instantiate.cc
cpptools/cpptools_finishUpdateSquiggles
Error squiggle count: 1
Error squiggle count: 1
Update IntelliSense time (sec): 5.592

Screenshots

VS-Code Bug

Additional context

The issue can be seen when browsing Chromium's V8 source code, and is gone when reverting to use C++17

Activity

  1. sean-mcmanus commented on Apr 9, 2020

    @sean-mcmanus
    Contributor

    Thanks for reporting this. It's a bug inherited from VS 2019, so I've filed a bug at https://developercommunity.visualstudio.com/content/problem/985100/c-intellisense-with-modules-enabled-incorrectly-gi.html .

  2. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Jun 5, 2020
  3. sean-mcmanus commented on Jul 16, 2020

    @sean-mcmanus
    Contributor

    Fixed with 0.29.0.

  4. locked and limited conversation to collaborators on Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServiceVisual StudioInherited from Visual StudiobugfixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions