Vscode-cpptools: Intellisense stops working minutes after creating and editing a new file.

Created on 6 Aug 2020  路  3Comments  路  Source: microsoft/vscode-cpptools

Type: LanguageService

Describe the bug

  • OS and Version: Ubuntu 20.04 LTS
  • VS Code Version: 1.47.3
  • C/C++ Extension Version: v0.30.0-insiders
  • 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
  • The workspace is a single, small project. When created a few new files, header files most notably, Intellisense will cease to work after a few minutes of writing to the new file. Oddly enough, Intellisense continues to work in other files, just not the most recently created file.

Steps to reproduce

  1. Create new .h or .cpp file in the explorer pane.
  2. Begin to edit in that new file, Intellisense will function as intended for a while.
  3. After editing for a few minutes and/or including standard headers such as <string>, and <unordered_map>, Intellisense will cease to function properly and does not autocomplete/lint the code.
  4. Edit in another file that was created before, Intellisense works as intended in that file, but not the most recently created file.

Expected behavior
Intellisense should continue to function as intended even when a new file is created.



Logs

-------- Diagnostics - 2020-08-06, 4:44:58 p.m.
Version: 0.30.0-insiders
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**",
        "/usr/include",
        "/usr/include/SDL2"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "gnu18",
    "cppStandard": "gnu++14",
    "intelliSenseMode": "gcc-x64",
    "compilerArgs": [],
    "browse": {
        "path": [
            "${workspaceFolder}/**",
            "/usr/include",
            "/usr/include/SDL2"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine.cpp ]:
    /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine.h
[ /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine-settings.h ]:
    /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine-settings.h
Translation Unit Configurations:
[ /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine.cpp ]:
    Process ID: 38176
    Memory Usage: 9 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/include/SDL2
        /usr/include/c++/9
        /usr/include/x86_64-linux-gnu/c++/9
        /usr/include/c++/9/backward
        /usr/lib/gcc/x86_64-linux-gnu/9/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
        /home/zacharyvincze/Projects/C++/explore-engine/src/engine
    Standard Version: c++14
    IntelliSense Mode: gcc-x64
    Other Flags:
        --g++
        --gnu_version=90300
[ /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine-settings.h ]: not ready
    Process ID: 38192
    Memory Usage: 0 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/include/SDL2
        /usr/include/c++/9
        /usr/include/x86_64-linux-gnu/c++/9
        /usr/include/c++/9/backward
        /usr/lib/gcc/x86_64-linux-gnu/9/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c++14
    IntelliSense Mode: gcc-x64
    Other Flags:
        --g++
        --gnu_version=90300
        --header_only_fallback
Total Memory Usage: 9 MB

Failed to read response from server: 22
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
File exclude: **/.DS_Store
File exclude: **/.vscode
Search exclude: **/node_modules
Search exclude: **/bower_components
Search exclude: **/*.code-search
Search exclude: **/.vscode
Populate include completion cache.
Discovering files...
terminating child process: 38456
terminating child process: 38458
  Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/9/include/
  Processing folder (recursive): /usr/local/include/
  Processing folder (recursive): /usr/include/
  Processing folder (recursive): /home/zacharyvincze/Projects/C++/explore-engine/
  Discovering files: 18784 file(s) processed
  3 file(s) removed from database
Done discovering files.
Parsing remaining files...
  Parsing: 663 files(s) processed
Done parsing remaining files.
terminating child process: 38459
terminating child process: 38461
idle loop: reparsing the active document
Formatting input:
Formatting document: file:///home/zacharyvincze/Projects/C%2B%2B/explore-engine/src/engine/engine-settings.h
Formatting raw output:
Formatting diffed output:
terminating child process: 38466
  tag parsing file: /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine-settings.h
idle loop: reparsing the active document
idle loop: reparsing the active document
idle loop: reparsing the active document
Offering completion
sending 1 changes to server
sending 1 changes to server
sending 1 changes to server
sending 1 changes to server
Offering completion
sending 1 changes to server
sending 1 changes to server
sending 1 changes to server
sending 1 changes to server
Offering completion
sending 1 changes to server
Offering completion
sending 1 changes to server
sending 1 changes to server
Offering completion
sending 1 changes to server
Offering completion
sending 1 changes to server
sending 1 changes to server
Formatting input:
Formatting document: file:///home/zacharyvincze/Projects/C%2B%2B/explore-engine/src/engine/engine-settings.h
Formatting raw output:
Formatting diffed output:
terminating child process: 38479
  tag parsing file: /home/zacharyvincze/Projects/C++/explore-engine/src/engine/engine-settings.h
idle loop: reparsing the active document

Screenshots

Intellisense working as intended in older file:
Screenshot from 2020-08-06 16-54-50

Intellisense losing functionality in newly created file:
Screenshot from 2020-08-06 16-55-52

Additional context

I've reinstalled Visual Studio Code, removed .vscode folder and removed .config/Code to ensure a fresh installation. I even restarted the project, but the problem seems to come right back after creating a certain amount of new files.

Language Service Visual Studio bug fixed (release pending) parser regression

All 3 comments

Thanks for reporting this. I've reproed the crash (i.e. cpptools-srv is crashing). Investigating...

Setting your C_Cpp.intelliSenseCacheSize to 0 is a workaround for this crash until we're able to fix the root issue (let us know if that workaround isn't working for you).

UPDATE: We've found the change that caused the regression.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SkyRiderMike picture SkyRiderMike  路  3Comments

jheinzel picture jheinzel  路  3Comments

wdc596933938 picture wdc596933938  路  3Comments

arl picture arl  路  3Comments

DemoCrazer picture DemoCrazer  路  3Comments