IntelliSense does not work for files not in folder with a CMake configured project
See original GitHub issueType: LanguageService
Describe the bug
- OS and Version: Windows 10
- VS Code Version: 1.48.2
- C/C++ Extension Version: .29
- Other extensions you installed (and if the issue persists after disabling them): Lots
- Does this issue involve using SSH remote to run the extension on a remote machine?: No
- A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
Steps to reproduce
- Clone https://github.com/azure-rtos/getting-started with --recursive
- Open the subfolder MXChip/AZ3166/
- Configure settings for CMake { “cmake.configureArgs”: [ “-DCMAKE_TOOLCHAIN_FILE=…/…/cmake/arm-gcc-cortex-m4.cmake” ], “C_Cpp.default.configurationProvider”: “ms-vscode.cmake-tools”, “cortex-debug.openocdPath”: “C:/tools/OpenOCD/bin/openocd.exe” }
- Open main.c
Expected behavior
Correct IntelliSense, especially as project can build. The files that are flagged as not found are not in the project folder but are configured for the CMake build.
Logs
-------- Diagnostics - 9/3/2020, 3:31:15 PM
Version: 0.29.0
Current Configuration:
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.28.29231/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64",
"compilerArgs": [],
"configurationProvider": "ms-vscode.cmake-tools",
"browse": {
"path": [
"${workspaceFolder}/**"
],
"limitSymbolsToIncludedHeaders": true
}
}
Custom browse configuration:
{
"browsePath": []
}
Translation Unit Mappings:
[ C:\source\scratch\getting-started\MXChip\AZ3166\app\main.c ]:
C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\APP\MAIN.C
Translation Unit Configurations:
[ C:\source\scratch\getting-started\MXChip\AZ3166\app\main.c ]:
Process ID: 14476
Memory Usage: 12 MB
Compiler Path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.28.29231/bin/Hostx64/x64/cl.exe
Includes:
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PREVIEW\VC\TOOLS\MSVC\14.28.29231\INCLUDE
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PREVIEW\VC\TOOLS\MSVC\14.28.29231\ATLMFC\INCLUDE
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\STM32F4XX_HAL_DRIVER\INC
C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\CONFIG
C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\STM32F4XX_HAL_DRIVER\INC\LEGACY
C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\CMSIS\DEVICE\ST\STM32F4XX\INCLUDE
C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\CMSIS\INCLUDE
Defines:
_DEBUG
UNICODE
_UNICODE
Standard Version: c11
IntelliSense Mode: msvc-x64
Total Memory Usage: 12 MB
Screenshots
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (9 by maintainers)
Top Results From Across the Web
intellisense doesn't work with linux cmake open folder project
Open your CMake folder via File->Open->Folder. Change the configuration from x64-Debug(Default) to Linux-Debug/Release after cache generated done. Connect your ...
Read more >VSCode C/C++ Intellisense not working with CMake project
I got it set up so that it compiles with the example from the LLVM Documentation. However C/C++ Intellisense seems to not work...
Read more >Configure IntelliSense with CMake Toolchain Files in Visual ...
Visual Studio can now configure IntelliSense in CMake projects based on the value of CMake variables set by CMake toolchain files.
Read more >IntelliSense (the project indexer) | The xPack Build Framework
IntelliSense is a general term for various code editing features including: code ... which store the project settings in custom text files not...
Read more >vscode-cmake-tools/support - Gitter
Hi, I am trying to get intellisense to work using the cmake tools provider. it is adding in includes folders for some linked...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@thepineda It isn’t currently on our schedule to fix, but the CMake Tools extension is open source so you could contribute a fix.
Is this a regression? Currently I have the same problem, header files outside of the project root are not found automatically even when the cmake build works correctly and I did not touch the code for a few months (and it worked before). It did not work with the code folder as it was untouched and reconfiguring in different ways does not resolve the problem either.