vscode-cpptools
vscode-cpptools copied to clipboard
C/C++ not scan my code folder (workspace)
Environment
- OS and Version: Windows 10 Enterprise 22H2
- VS Code Version: 1.93.1
- C/C++ Extension Version: v1.22.6 (pre-release)
- If using SSH remote, specify OS of remote machine
Bug Summary and Steps to Reproduce
When I use "Go To Definition" in *.c, it always jump to .h, not the function code in *.c. After debug, I found the root cause is C/C++ not scan my code folder, only scan the current opened *.c file and all its including *.h files, here is the log for cpptools/resetDatabase
LSP: (received) cpptools/resetDatabase
LSP: (invoked) cpptools/resetDatabase
Creating/updating compiler cache data tables (previously: 0)
Code browsing service initialized
Discovering files...
Populating file name cache...
Done populating filename cache. Elapsed time: 0 ms
Processing folder (recursive): C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\SHARED
Processing folder (recursive): C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UM
Processing folder (recursive): C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\CPPWINRT
Processing folder (recursive): C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UCRT
Processing folder (recursive): C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\WINRT
Processing folder (non-recursive): C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\VC\TOOLS\MSVC\14.29.30133\ATLMFC\INCLUDE
Processing folder (non-recursive): C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\VC\TOOLS\MSVC\14.29.30133\INCLUDE
Discovering files: 4871 file(s) processed
0 file(s) removed from database
Done discovering files.
Populating include completion cache.
Parsing remaining files...
Parsing: 0 files(s) processed
Done parsing remaining files.
Database safe to open.
Actually I have a code workspace like this:
- It has nothing to do with the .vscode/c_cpp_properties.json because I tried to delete it.
- It has nothing to do with the Remote SSH because I tried locally, still error.
- A newly installed Windows 10 OS in virtual machine and newly installed VS Code, only install C/C++, without login any account.
So it only related to my Windows 10 OS. I have used VS Code for years, both local dev. and ssh dev., so it's so wired to see this issue...
Configuration and Logs
-------- Diagnostics - 9/30/2024, 2:39:01 PM
Version: 1.22.6
Current Configuration:
{
"name": "Win32",
"includePath": [
"d:/BHS-BIOS/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"MAX_SOCKET"
],
"forcedInclude": [
"MdePkg/Include/X64/ProcessorBind.h",
"MdePkg/Include/Base.h",
"MdePkg/Include/Uefi.h"
],
"compilerPathIsExplicit": false,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": false,
"intelliSenseModeIsExplicit": false,
"macFrameworkPath": [],
"windowsSdkVersion": "10.0.19041.0",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64",
"mergeConfigurations": false,
"compilerPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\Hostx64\\x64\\cl.exe",
"browse": {
"path": [
"d:/BHS-BIOS/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
Modified Settings:
{
"C_Cpp.loggingLevel": "Debug"
}
Additional Tracked Settings:
{
}
cpptools version (native): 1.22.6.0
Current database path: C:\USERS\ADMINISTRATOR\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\245AD5896190AFBE2AD35ECEDAFB20F9\.BROWSE.VC.DB
No active translation units.
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 4871
Other Extensions
nothing