Skip to content

Intellisense (and most features of this extension) Not Working #4614

Closed

Description

Fact: My code is able to build correctly using non vscode command line and goma build tools. I have copied my c_cpp_properties.json against someone who's C/C++ extension works correctly on this code base and they are identical.
Expect: Features of this extension expected to work correctly.
Actual:

  • "Go to definition" frequently sits and spins without producing result. Inconsistently able to work sometimes.
  • Inconsistent red underline over everything.
  • No autocomplete
  • Includes not able to find every file (sometimes it will say it can't find an include, but then "go to definition" will work???).

Reality: It's clear almost no part of this extension works correctly on my machine decreasing my productivity.

Red underline, error: "not a class or struct name"
image

Try to go to definition, vscode can tell it's a class or struct name. 🤷‍♀️
image

Red underlines disappear, completely only to come back and underline everything after. Not working correctly at all.
image

Activity

  1. sean-mcmanus commented on Nov 15, 2019

    @sean-mcmanus
    Contributor

    Can you use the C/C++: Log Diagnostics command to see what includes and defines we're using and if they're incorrect? By default we use recursive includes, which doesn't give 100% correct result in all workspaces (e.g. if the non-deterministic includePath ordering causes the wrong file to get used).

    I tried a version of chromium and wasn't able to repro the bug.

    Go to Def on #include lines doesn't use the IntelliSense includePath for lookups (there's another issue tracking that).

    Can you provide more detailed repro steps?

  2. xgdgsc commented on Nov 16, 2019

    @xgdgsc

    I also began to see this intellisense not working properly since maybe a day or two. Might after vscode update?

    here' s my C/C++: Log Diagnostics command output. I tried reinstalling C++ extension. This is stable version, not insider version.

    -------- Diagnostics - 11/16/2019, 3:52:53 PM
    Version: 0.26.1
    Current Configuration:
    {
        "name": "Linux",
        "includePath": [
            "${workspaceFolder}/**",
            "${workspaceFolder}/include/**",
            "/n1/env/include/**"
        ],
        "defines": [],
        "compilerPath": "/usr/bin/gcc-9",
        "cStandard": "c11",
        "cppStandard": "c++17",
        "intelliSenseMode": "clang-x64",
        "configurationProvider": "vector-of-bool.cmake-tools",
        "compileCommands": "${workspaceFolder}/build-Debug/compile_commands.json",
        "compilerArgs": [],
        "browse": {
            "path": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/include/**",
                "/n1/env/include/**"
            ],
            "limitSymbolsToIncludedHeaders": true
        }
    }
    No active translation units.
    
  3. xgdgsc commented on Nov 16, 2019

    @xgdgsc

    Just tried insider build and also not showing auto complete correctly.

  4. xgdgsc commented on Nov 17, 2019

    @xgdgsc

    It started working well for me after reinstalling stable release after trying insider.

  5. xgdgsc commented on Nov 18, 2019

    @xgdgsc

    I was wrong, completion of type works but not class methods

  6. xgdgsc commented on Nov 19, 2019

    @xgdgsc

    Deleting the extension folder ~/.vscode/extensions/ms-vscode.cpptools-0.26.1/ and reinstalling seems to fix it for me

  7. xgdgsc commented on Nov 19, 2019

    @xgdgsc

    It stopped working again for me 😓

  8. sean-mcmanus commented on Nov 19, 2019

    @sean-mcmanus
    Contributor

    xgdgsc Your diagnostic log file shows no IntelliSense process is active. Are you able to enable debug logging (https://code.visualstudio.com/docs/cpp/enable-logging-cpp) and see what error message is shown when it tries to create the IntelliSense process? Also, if you could only specify only a configurationProvider or compileCommands, that would help narrow down the problem.

  9. xgdgsc commented on Nov 20, 2019

    @xgdgsc

    Thanks. It shows log like:

    Custom configuration provider 'CMake Tools' registered
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    Quick info operation failed: FE: 'Compiler exited with error - No IL available'
    cpptools/fileCreated
    cpptools/fileCreated
    cpptools/getCodeActions: 186
    cpptools/activeDocumentChange
    cpptools/textEditorSelectionChange
    cpptools/getDocumentSymbols: 187
    cpptools/getDocumentSymbols
    cpptools/textEditorSelectionChange
    idle loop: reparsing the active document
    Checking for syntax errors: file:///home/sgao/Documents/sim/src/bar_exec.cpp
    Queueing IntelliSense update for files in translation unit of: /home/sgao/Documents/sim/src/bar_exec.cpp
    cpptools/getCodeActions: 188
    cpptools/textEditorSelectionChange
    cpptools/getCodeActions: 189
    Error squiggle count: 1
    Update IntelliSense time (sec): 0.65
    cpptools/getCodeActions: 190
    Database safe to open
    cpptools/fileDeleted
    cpptools/fileDeleted
    Database safe to open
    cpptools/activeDocumentChange
    cpptools/textEditorSelectionChange
    idle loop: reparsing the active document
    Checking for syntax errors: file:///home/sgao/Documents/sim/src/bar_exec.cpp
    Queueing IntelliSense update for files in translation unit of: /home/sgao/Documents/sim/src/bar_exec.cpp
    Error squiggle count: 1
    Update IntelliSense time (sec): 0.68
    cpptools/getCodeActions: 191
    
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/getDocumentSymbols: 212
    cpptools/getDocumentSymbols
    cpptools/fileCreated
    cpptools/fileDeleted
    Database safe to open
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/fileCreated
    cpptools/fileDeleted
    cpptools/activeDocumentChange
    cpptools/textEditorSelectionChange
    idle loop: reparsing the active document
    Checking for syntax errors: file:///home/sgao/Documents/sim/src/bar_exec.cpp
    Queueing IntelliSense update for files in translation unit of: /home/sgao/Documents/sim/src/bar_exec.cpp
    Error squiggle count: 1
    Update IntelliSense time (sec): 0.6
    
  10. sean-mcmanus commented on Nov 20, 2019

    @sean-mcmanus
    Contributor

    Is there stuff before that log? I don't see the output when it tries to create the TU initially.

  11. xgdgsc commented on Nov 20, 2019

    @xgdgsc

    I found it works after opening the folder of "MyProject" directly. I was using a workspace file on the parent directory MyProject.code-workspace.

  12. xgdgsc commented on Nov 20, 2019

    @xgdgsc
  13. sean-mcmanus commented on Nov 20, 2019

    @sean-mcmanus
    Contributor

    I'm OOF till Friday.

    Colen Garoutte-Carson (@Colengms) Can you investigate this -- I'm seeing the forced include file sim_core_CXX_prefix.hxx causing the compiler to generate a fatal error, causing defines to be missing when it queries /usr/bin/g++-9. I think maybe we should not pass forced includes arguments to the compiler when we query it for compiler defaults.

    xgdgsc Are you able to somehow get that "fatal error" showing the log to be fixed. Or maybe remove the "-include", "....hxx" and pass it via the forcedInclude setting....although that appears to be coming from the CMake Tools extension (so it could be a bug with that extension).

  14. xgdgsc commented on Nov 20, 2019

    @xgdgsc

    Thanks for the tip. The file reported as fatal error exists. I disabled cotire in CMakeLists and it works.

  15. bobbrow commented on Feb 20, 2020

    @bobbrow
    Contributor

    We're tracking #4655 as the fix for this.

  16. sean-mcmanus commented on May 6, 2020

    @sean-mcmanus
    Contributor

    xgdgsc With https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0-insiders2 the failure caused by "-include" being used should be fixed. Let us know if you hit any other issues.

  17. grigorig commented on Jul 29, 2020

    @grigorig

    This started to appear recently for me. There is nothing obvious in the diagnostics log at all. I'm using version 0.29 of the extension. Is this a regression?

  18. sean-mcmanus commented on Jul 30, 2020

    @sean-mcmanus
    Contributor

    This started to appear recently for me. There is nothing obvious in the diagnostics log at all. I'm using version 0.29 of the extension. Is this a regression?

    Grigori Goronzy (@grigorig) Could you file a new issue with more repro details? We're not aware of a regression like this.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions