vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

IntelliSense gets stuck on Parsing workspace files, usually between 20% to 40%.

Open alanpawlak opened this issue 1 year ago • 6 comments

Environment

  • OS and Version: Windows 11 [10.0.22631.4317]
  • VS Code Version: 1.94.0, 1.94.2 (tested both)
  • C/C++ Extension Version: 1.21.6

Bug Summary and Steps to Reproduce

Bug Summary:

I created a simple project to try the Tracy profiler (https://github.com/wolfpld/tracy).

  • Tracy added as a submodule
  • Created a Makefile with one target and two source files: main.cpp and TracyProfiler.cpp
  • The compiler is MSVC, and VSCode is launched through the Developer Command Prompt for VS 2022
  • The Makefile Tools extension is used as the configuration provider, but disabling it makes no noticeable difference

Steps to Reproduce:

  1. Start VSCode and open my workspace
  2. IntelliSense begins parsing, and I can see it becoming active as I follow the paths
  3. It gets stuck halfway through (or earlier; it's random) and becomes unresponsive

Image

My project files (without tracy repo) tracy-test.zip

Full logs logs.zip

Expected Behavior:

IntelliSense should successfully finish parsing and continue working as expected.

Configuration and Logs

-------- Diagnostics - 10/10/2024, 9:54:32 PM Version: 1.21.6 Current Configuration: { "name": "Win32", "includePath": [ "c:/Developement/tracy-test/", "c:/Developement/tracy-test/tracy/public/tracy/" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.19041.0", "compilerPath": "cl.exe", "cStandard": "c17", "cppStandard": "c++17", "compilerPathInCppPropertiesJson": "cl.exe", "intelliSenseMode": "msvc-x64", "intelliSenseModeIsExplicit": true, "cStandardIsExplicit": false, "cppStandardIsExplicit": false, "mergeConfigurations": true, "compilerPathIsExplicit": false, "configurationProvider": "ms-vscode.makefile-tools", "browse": { "path": [ "c:/Developement/tracy-test/", "c:/Developement/tracy-test/tracy/public/tracy/", "${workspaceFolder}" ], "limitSymbolsToIncludedHeaders": true } } cpptools version (native): 1.21.6.0 Translation Unit Mappings: [ C:\Developement\tracy-test\main.cpp - source TU]: Translation Unit Configurations: [ C:\Developement\tracy-test\main.cpp ]: Process ID: 10752 Memory Usage: 167 MB Compiler Path: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\Hostx64\x64\cl.exe Includes: C:\Developement\tracy-test C:\Developement\tracy-test\tracy\public\tracy System Includes: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\atlmfc\include C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt Defines: TRACY_ENABLE _DEBUG UNICODE _UNICODE Standard Version: ms_c++17 IntelliSense Mode: windows-msvc-x64 Total Memory Usage: 167 MB

------- Workspace parsing diagnostics ------- Number of files discovered (not excluded): 5293

alanpawlak avatar Oct 10 '24 21:10 alanpawlak

@alanpawlak The C:\Developement\tracy-test\tracy\profiler\src\profiler\TracyMicroArchitecture.cpp file is too large. Can you add "${workspaceFolder}/profiler/src/profiler to your C_Cpp.files.exclude setting? You could also exclude just that particular file, if you set C_Cpp.exclusionPolicy to checkFilesAndFolders.

sean-mcmanus avatar Oct 11 '24 00:10 sean-mcmanus

Thank you!

		"C_Cpp.exclusionPolicy": "checkFilesAndFolders",
		"C_Cpp.files.exclude": {
			"tracy/profiler/src/profiler/TracyMicroArchitecture.cpp": true,
			"**/.vscode": true,
			"**/.vs": true
		},

Worked and it seems to work fine now! Is this a known issue? What is the file limit for IntelliSense to process?

alanpawlak avatar Oct 11 '24 06:10 alanpawlak

@sean-mcmanus, sqlite.c is bigger than this one and we are able to process it. Are you just saying that this file will slow down the parsing because it's big? I opened it by itself and the extension appeared to work. Could you clarify why it should be excluded?

bobbrow avatar Oct 14 '24 19:10 bobbrow

@bobbrow My reference to "too large" was a simplification -- it's an issue with too much of a particular type of modification to the database. Oleg said he was going to look at fixing it so that it would cancel/time out as it supposed to be doing. What do you mean by "extension appeared to work"? Are you saying you saw the database update? I was seeing it "stuck" on the database update.

sean-mcmanus avatar Oct 14 '24 20:10 sean-mcmanus

@sean-mcmanus I may have been mistaken. I thought the database icon was gone, but I tried again and saw it get stuck. However, adding the following to cpp.hint and reloading the window got me a successful parse:

#define V static constexpr AsmVar
#define A static constexpr AsmVar const*
#define O static constexpr AsmOp

bobbrow avatar Oct 14 '24 23:10 bobbrow

Oh, cool, yeah, that's a better workaround than using the excludes.

sean-mcmanus avatar Oct 14 '24 23:10 sean-mcmanus