vscode-cpptools
vscode-cpptools copied to clipboard
IntelliSense is not very stable on macOS with Apple Silicon
Environment
- OS and Version: macOS 12.5.1
- VS Code Version: 1.70.2
- C/C++ Extension Version: 1.11.5
- Other extensions you installed (and if the issue persists after disabling them):
- If using SSH remote, specify OS of remote machine:
- 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).
IntelliSense and anything related to Go To Definition/Declaration is very unstable it works until it doesn't and then I need to restart VSCode. On Go To something I get quite often an infinite "spinner".
All system, "Conan", etc. external headers have these blue squiggly lines.
I'm unable to navigate to Apple frameworks. Maybe I don't know how to configure VSCode properly:
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
No response
Code sample and Logs
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++23",
"intelliSenseMode": "macos-clang-arm64",
"compileCommands": "${workspaceFolder}/build/vscode.macOS.Debug/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
Screenshots

Additional context
No response
You have "configurationProvider": "ms-vscode.cmake-tools". Have you configured CMake Tools? If you run the "C/C++: Log Diagnostics" command from the VS Code command palette it'll show what configuration is being used.
Yes we use CMake + Ninja + Conan + VSCode + cpptools + cmake tools + all MS extensions for C++ to build and debug our projects. The official custom build system, which produces the production builds is written in python.
-------- Diagnostics - 8/24/2022, 8:56:36 AM Version: 1.11.5 Current Configuration: { "name": "Mac", "includePath": [ "${workspaceFolder}/" ], "defines": [], "macFrameworkPath": [ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/clang", "cStandard": "c17", "cppStandard": "c++23", "intelliSenseMode": "macos-clang-arm64", "compileCommands": "${workspaceFolder}/build/vscode.macOS.Debug/compile_commands.json", "configurationProvider": "ms-vscode.cmake-tools", "compilerPathIsExplicit": true, "cStandardIsExplicit": true, "cppStandardIsExplicit": true, "intelliSenseModeIsExplicit": true, "mergeConfigurations": false, "browse": { "path": [ "${workspaceFolder}/" ], "limitSymbolsToIncludedHeaders": true } } Custom browse configuration: { "browsePath": [ "/users/user/projects/github/mylibm/build", "/users/user/projects/github/mylibm/src/data/include", "/users/user/projects/github/mylibm/src/data/src", "/users/user/projects/github/mylibm/src/types/include", "/users/user/projects/github/mylibm/src/utilities/include", "/users/user/.conan/data/tl-expected/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include", "/users/user/.conan/data/tl-optional/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include", "/users/user/.conan/data/boost/1.79.0/minsk/stable/package/15f32d80ec200956da143baade008abbc0745d62/include", "/users/user/.conan/data/fmt/8.0.1/minsk/stable/package/6bac8307e0f94b2c4e9c5ba4c11ce57a24bb05ea/include", "/users/user/projects/github/mylibm/src/data/src/common/macos", "/users/user/projects/github/mylibm/src/data/src/common", "/users/user/projects/github/mylibm/src/data/src/controllers", "/users/user/projects/github/mylibm/src/data/src/enumerators", "/users/user/projects/github/mylibm/src/data/src/hardware", "/users/user/projects/github/mylibm/src/data/src/hardware/macos", "/users/user/projects/github/mylibm/src/data/src/software/macos", "/users/user/projects/github/mylibm/src/data/src/stats", "/users/user/projects/github/mylibm/src/data/include/nblib/data/controllers", "/users/user/projects/github/mylibm/src/data/include/nblib/data/enumerators", "/users/user/projects/github/mylibm/src/data/include/nblib/data/hardware/macos", "/users/user/projects/github/mylibm/src/data/include/nblib/data/hardware", "/users/user/projects/github/mylibm/src/data/include/nblib/data/software/macos", "/users/user/projects/github/mylibm/src/data/include/nblib/data/stats", "/users/user/projects/github/mylibm/src/types/include/nblib/types/concepts", "/users/user/projects/github/mylibm/src/types/include/nblib/types/macos", "/users/user/projects/github/mylibm/src/types/include/nblib/types", "/users/user/projects/github/mylibm/src/utilities", "/users/user/.conan/data/openssl/1.1.1k/minsk/stable/package/c6827aec4987ab08fe3015ab425dc9676dbc5e6b/include", "/users/user/projects/github/mylibm/src/utilities/src/macos", "/users/user/projects/github/mylibm/src/utilities/src", "/users/user/projects/github/mylibm/src/utilities/include/nblib/utilities/macos", "/users/user/projects/github/mylibm/src/utilities/include/nblib/utilities", "/users/user/.conan/data/benchmark/1.6.1/minsk/stable/package/e00eb337f95fddd6d2ab21444446a6d0c69ba3dc/include", "/users/user/projects/github/mylibm/tests/benchmarks/src/benchmarks", "/users/user/projects/github/mylibm/src", "/users/user/projects/github/mylibm/tests/unit_tests/src", "/users/user/.conan/data/gtest/1.11.0/minsk/stable/package/432e6f103e1ffa0642ad0dcf821559b32208b53b/include", "/users/user/projects/github/mylibm/tests/unit_tests/src/common/helpers", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/controllers", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/enumerators", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/hardware/macos", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/hardware", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/software/macos", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/stats", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/types", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/utilities/macos", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/utilities", "/users/user/projects/github/mylibm/tests/unit_tests/src/common/mocks/data/hardware", "/users/user/projects/github/mylibm/tests/unit_tests/src/common/mocks/data/software", "/users/user/projects/github/mylibm/tests/unit_tests/src/common/mocks/data/stats", "/users/user/projects/github/mylibm/tests/unit_tests/src/common/mocks/utilities", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/enumerators/test_data", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/hardware/test_data", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/hardware/macos/test_data", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/data/software/macos/test_data", "/users/user/projects/github/mylibm/tests/unit_tests/src/tests/utilities/macos/test_data", "/users/user/projects/github/mylibm/test_tool/src" ], "compilerPath": "/usr/bin/clang++", "compilerArgs": [], "compilerFragments": [ " -stdlib=libc++ -fvisibility-inlines-hidden -fvisibility=hidden -g -arch arm64 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.12", "-W", "-Wall", "-Werror", "-Wextra", "-Wpedantic", "-std=c++20" ] } Custom configurations: [ /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/helpers/TestFileHelpers.cpp ] { "includePath": [ "/users/user/projects/github/mylibm/build", "/users/user/projects/github/mylibm/src", "/users/user/projects/github/mylibm/tests/unit_tests/src", "/users/user/projects/github/mylibm/src/data/include", "/users/user/projects/github/mylibm/src/types/include", "/users/user/projects/github/mylibm/src/utilities/include", "/users/user/.conan/data/tl-expected/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include", "/users/user/.conan/data/tl-optional/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include", "/users/user/.conan/data/boost/1.79.0/minsk/stable/package/15f32d80ec200956da143baade008abbc0745d62/include", "/users/user/.conan/data/fmt/8.0.1/minsk/stable/package/6bac8307e0f94b2c4e9c5ba4c11ce57a24bb05ea/include", "/users/user/.conan/data/gtest/1.11.0/minsk/stable/package/432e6f103e1ffa0642ad0dcf821559b32208b53b/include", "/users/user/.conan/data/openssl/1.1.1k/minsk/stable/package/c6827aec4987ab08fe3015ab425dc9676dbc5e6b/include" ], "defines": [ "NBLIB_VERSION="0.1.1"" ], "compilerPath": "/usr/bin/clang++", "compilerArgs": [], "compilerFragments": [ " -stdlib=libc++ -fvisibility-inlines-hidden -fvisibility=hidden -g -arch arm64 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.12", "-W", "-Wall", "-Werror", "-Wextra", "-Wpedantic", "-O0", "-std=c++20" ] } Translation Unit Mappings: [ /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/utilities/macOS/LaunchdPlistTest.cpp ]: /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/utilities/macOS/LaunchdPlistTest.cpp /Users/user/Projects/GitHub/mylibm/src/utilities/include/nblib/utilities/macos/ILaunchdPlist.hpp * [ /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/helpers/TestFileHelpers.cpp ]: /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/helpers/TestFileHelpers.cpp Translation Unit Configurations: [ /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/utilities/macOS/LaunchdPlistTest.cpp ]: Process ID: 73507 Memory Usage: 22 MB Includes: /Users/user/Projects/GitHub/mylibm/build /Users/user/Projects/GitHub/mylibm/src /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src /Users/user/Projects/GitHub/mylibm/src/data/include /Users/user/Projects/GitHub/mylibm/src/types/include /Users/user/Projects/GitHub/mylibm/src/utilities/include /Users/user/.conan/data/tl-expected/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include /Users/user/.conan/data/tl-optional/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include /Users/user/.conan/data/boost/1.79.0/minsk/stable/package/15f32d80ec200956da143baade008abbc0745d62/include /Users/user/.conan/data/fmt/8.0.1/minsk/stable/package/6bac8307e0f94b2c4e9c5ba4c11ce57a24bb05ea/include /Users/user/.conan/data/gtest/1.11.0/minsk/stable/package/432e6f103e1ffa0642ad0dcf821559b32208b53b/include /Users/user/.conan/data/OpenSSL/1.1.1k/minsk/stable/package/c6827aec4987ab08fe3015ab425dc9676dbc5e6b/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include Frameworks: /System/Library/Frameworks /Library/Frameworks Defines: NBLIB_VERSION="0.1.1" Standard Version: c++17 IntelliSense Mode: macos-clang-arm64 [ /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/helpers/TestFileHelpers.cpp ]: Process ID: 80847 Memory Usage: 139 MB Includes: /Users/user/Projects/GitHub/mylibm/build /Users/user/Projects/GitHub/mylibm/src /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src /Users/user/Projects/GitHub/mylibm/src/data/include /Users/user/Projects/GitHub/mylibm/src/types/include /Users/user/Projects/GitHub/mylibm/src/utilities/include /Users/user/.conan/data/tl-expected/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include /Users/user/.conan/data/tl-optional/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include /Users/user/.conan/data/boost/1.79.0/minsk/stable/package/15f32d80ec200956da143baade008abbc0745d62/include /Users/user/.conan/data/fmt/8.0.1/minsk/stable/package/6bac8307e0f94b2c4e9c5ba4c11ce57a24bb05ea/include /Users/user/.conan/data/gtest/1.11.0/minsk/stable/package/432e6f103e1ffa0642ad0dcf821559b32208b53b/include /Users/user/.conan/data/OpenSSL/1.1.1k/minsk/stable/package/c6827aec4987ab08fe3015ab425dc9676dbc5e6b/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include Frameworks: /System/Library/Frameworks /Library/Frameworks Defines: NBLIB_VERSION="0.1.1" Standard Version: c++17 IntelliSense Mode: macos-clang-arm64 Total Memory Usage: 161 MB Browse Paths from compile_commands.json, from workspace folder: /Users/user/Projects/GitHub/mylibm /Users/user/.conan/data/OpenSSL/1.1.1k/minsk/stable/package/c6827aec4987ab08fe3015ab425dc9676dbc5e6b/include /Users/user/.conan/data/benchmark/1.6.1/minsk/stable/package/e00eb337f95fddd6d2ab21444446a6d0c69ba3dc/include /Users/user/.conan/data/boost/1.79.0/minsk/stable/package/15f32d80ec200956da143baade008abbc0745d62/include /Users/user/.conan/data/fmt/8.0.1/minsk/stable/package/6bac8307e0f94b2c4e9c5ba4c11ce57a24bb05ea/include /Users/user/.conan/data/gtest/1.11.0/minsk/stable/package/432e6f103e1ffa0642ad0dcf821559b32208b53b/include /Users/user/.conan/data/tl-expected/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include /Users/user/.conan/data/tl-optional/1.0.0/minsk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include /Users/user/Projects/GitHub/mylibm/build /Users/user/Projects/GitHub/mylibm/src /Users/user/Projects/GitHub/mylibm/src/data/include /Users/user/Projects/GitHub/mylibm/src/data/include/nblib/data/controllers /Users/user/Projects/GitHub/mylibm/src/data/include/nblib/data/enumerators /Users/user/Projects/GitHub/mylibm/src/data/include/nblib/data/hardware /Users/user/Projects/GitHub/mylibm/src/data/include/nblib/data/hardware/macos /Users/user/Projects/GitHub/mylibm/src/data/include/nblib/data/software/macos /Users/user/Projects/GitHub/mylibm/src/data/include/nblib/data/stats /Users/user/Projects/GitHub/mylibm/src/data/src /Users/user/Projects/GitHub/mylibm/src/data/src/common /Users/user/Projects/GitHub/mylibm/src/data/src/common/macos /Users/user/Projects/GitHub/mylibm/src/data/src/controllers /Users/user/Projects/GitHub/mylibm/src/data/src/enumerators /Users/user/Projects/GitHub/mylibm/src/data/src/hardware /Users/user/Projects/GitHub/mylibm/src/data/src/hardware/macos /Users/user/Projects/GitHub/mylibm/src/data/src/software/macos /Users/user/Projects/GitHub/mylibm/src/data/src/stats /Users/user/Projects/GitHub/mylibm/src/types/include /Users/user/Projects/GitHub/mylibm/src/types/include/nblib/types /Users/user/Projects/GitHub/mylibm/src/types/include/nblib/types/concepts /Users/user/Projects/GitHub/mylibm/src/types/include/nblib/types/macOS /Users/user/Projects/GitHub/mylibm/src/utilities /Users/user/Projects/GitHub/mylibm/src/utilities/include /Users/user/Projects/GitHub/mylibm/src/utilities/include/nblib/utilities /Users/user/Projects/GitHub/mylibm/src/utilities/include/nblib/utilities/macos /Users/user/Projects/GitHub/mylibm/src/utilities/src /Users/user/Projects/GitHub/mylibm/src/utilities/src/macos /Users/user/Projects/GitHub/mylibm/test_tool/src /Users/user/Projects/GitHub/mylibm/tests/benchmarks/src/benchmarks /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/helpers /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/mocks/data/hardware /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/mocks/data/software /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/mocks/data/stats /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/common/mocks/utilities /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/controllers /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/enumerators /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/enumerators/test_data /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/hardware /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/hardware/macos /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/hardware/macos/test_data /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/hardware/test_data /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/software/macos /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/software/macos/test_data /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/data/stats /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/types /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/utilities /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/utilities/macOS /Users/user/Projects/GitHub/mylibm/tests/unit_tests/src/tests/utilities/macOS/test_data
------- Workspace parsing diagnostics ------- Number of files discovered (not excluded): 16078 Number of files parsed: 4402
For the above:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++23",
"intelliSenseMode": "macos-clang-arm64",
"compileCommands": "${workspaceFolder}/build/vscode.macOS.Debug/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
I don't know the log entries mean but they do look fine to me.
I have been using VSCode + MS extension on Ubuntu Linux, Intel Mac and now M1 Mac for the past few months.
Additionally to the above issues sometimes VSCode hangs when I try to navigate to a symbol, etc.
Is it possible that I'm having this issue and other issue's like Test Mate C++ not displaying the widgets or the test results at all, clang-tidy diagnostics not working because I am running multiple instances of VSCode?
I found this in the log: IntelliSense process crash detected.
It sounds like you might be hitting multiple issues that could have different causes.
For the VS Code hang when navigating to a symbol, can you attach a debugger to the cpptools process to get call stacks to see what it's stuck on? If you set C_Cpp.loggingLevel to debug, the logging before and after may also explain why it's stuck. If the hang is permanent, it could be a deadlock, and if it's temporary, our main thread could be blocked on some other task.
For the crash can you attach a debugger to the cpptools-srv process before the crash and then trigger the crash (possibly by uncommenting or pasting in the code) to get a crash call stack?
Also, you may want to try our 1.12.2 (pre-release) -- https://github.com/microsoft/vscode-cpptools/releases/tag/v1.12.2, which has numerous bug fixes, some of which fix known crashes, etc. and which we believe will be very similar to the 1.12.3 we plan to publish next week.
@sean-mcmanus As I am not quite sure how to attach the debugger to the cpptools process I haven't been successful to provide any useful information but I have made some additional observations. On the last attempt when VSCode started the spinner: I tried to run Format on the code. After my attempt at attaching and disconnecting the debugger the spinner disappeared and I was able to run the format.
Also I noticed that after I enabled the inlay hints for auto, etc. VSCode started crashing (macOS would offer to close or restart the App).
Yesterday I tried this feature on a different project on Windows and I didn't experience any of these issues.
I'm sorry that I am unable to provide any useful debugging information right now. I'll try the update.
Yeah, it looks like attaching the debugger on Mac isn't working currently (https://github.com/microsoft/vscode-cpptools/issues/9810), but I got it to work via
run the following in a terminal window to attach lldb: lldb -p <PID of process to debug> Then run the following command in lldb to output all stacks: bt all
VS Code itself crashing would indicate a bug with VS Code and not our extension. Our extension code runs our of process so it's unlikely we could be directly causing the crash.
I'm not sure what you mean by attaching/disconnecting, but you may have inadvertently killed the stuck process by disconnecting the debugger and then it restarted cpptools and ran the formatter.
I updated the extension to 1.12.4 today on my work macOS 12.5.1 and I used it for a few hours. It definitely feels more stable and I haven't experienced the crashes with enabled inlay hints (I think they were the cause because after I disabled them - the crashes stopped).
Yet there are still issue. At least once I got the "spinner" when I tried to ctrl+click on a #include <>. On one tab I got inlay hints but on another the inlay hints and the clang-tidy squiggles/checks disappeared (they reappeared after I restarted VSCode).
I also run a Python build script from VSCode's terminal which calls the same CMake script. Can this action also have an impact on IntelliSense?
A spinner when trying to do a go to def on #include is normal if there is a pending update/processing of IntelliSense on going.
You mention disabling inlay hints but then you mention you got inlay hints in a tab? Did you re-enable inlay hints in that case?
If you set C_Cpp.loggingLevel to "Debug" you can check the C/C++ logging to see if there are any changes shown when the Python build script is run -- it's possible we could be reacting to the file changes, in which case you may want to add that folder to C_Cpp.files.exclude so that it doesn't cause any undesired impact.
-
I get the spinner spinning indefinitely (I think so) in variety of contexts: clicking on a link, navigating to a variable definition/declaration.
-
Inlay hints: Yes I did reenable the inlay hints after I installed the latest version.
-
Inlay hints: It looks like they cause VSCode to stop responding in some contexts (GTest debugging with C++ Test Mate) but not in others. macOS pops up a dialog asking me to restart VSCode etc, wait. Sometimes it appears to hang but sometimes after a while VSCode starts responding again. Maybe it doesn't really hang, it just sometimes it just takes much longer to start responding.
-
Inlay hints: I had two tabs in one tab I got inlay hints but there were none. I don't remember the exact details but it looked odd. After I restart VSCode everything works for a short while then it stops: no inlay hints, no IntelliSense info, no clang-tidy and anything else like that.
-
Regarding the external build script, yes, it generates some C++ code. I maybe wrong but it looks like that IntelliSense stops working after I run it or it maybe be just a coincidence. I now remembered that it generates some CMake modules too. So it definitely should have an impact on VSCode.
A stuck spinner might be a deadlock. A similar report was made at https://github.com/microsoft/vscode-cpptools/issues/9774 in which our main thread was stuck waiting for an IntelliSense response.
If VS Code itself stops responding in the UI with inlay hints then that is most likely a bug with VS Code itself, since our extension just returns inlay hint data to VS Code out of process and isn't capable of directly causing VS Code to hang.
Yeah, if you're using the CMake Tools extension then changes to CMake could be picked up and cause IntelliSense changes.
@Colengms was seeing headers being associated with the wrong source files while/after building with CMake so that might be issue 5.
If VS Code itself stops responding in the UI with inlay hints then that is most likely a bug with VS Code itself, since our extension just returns inlay hint data to VS Code out of process and isn't capable of directly causing VS Code to hang.
I understand that. I reported that:
https://github.com/microsoft/vscode/issues/159686
I'm trying to collect as much info as I can.
I use VSCode on macOS and Linux in two separate projects:
- A pure library with GTests
- An executable with imports the library as a git submodules
I work on the library mostly and I develop it, I debug it and and I test it via gtests + C++ TestMate if that's important.
C++23 support?
I noticed this error message in the log:
using Tag Parser for quick info Error while processing /Users/hristohristov/Projects/GitHub/nblib-calm/src/utilities/src/macos/LaunchdPlist.cpp. error: invalid value '' in '-std=' [clang-diagnostic-error] note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and GNU extensions' standard note: use 'c++11' for 'ISO C++ 2011 with amendments' standard note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard note: use 'c++14' for 'ISO C++ 2014 with amendments' standard note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard note: use 'c++17' for 'ISO C++ 2017 with amendments' standard note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard note: use 'c++20' for 'ISO C++ 2020 DIS' standard note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard note: use 'c++2b' for 'Working draft for ISO C++ 2023 DIS' standard note: use 'gnu++2b' for 'Working draft for ISO C++ 2023 DIS with GNU extensions' standard
I have set this in my: c_cpp_properties.json
"cppStandard": "c++23",
We support c++23 -- do you see c++23 being used when you run C/C++: Log Diagnostics? The error is coming from clang-tidy, which should support c++2b. I haven't seen "invalid value ''" before, so I'm not sure what could cause that...perhaps an error processing the compiler args/std.
Some interesting observation:
- Start VSCode
- Open a CMake project, wait to configure
- Open a CPP file
- Wait for Inlay Hints + Clang-Tidy suggestions to appear (with enabled inlay-hints)
- Edit the code to fix the Clang-Tidy warning
- All hints and Clang-Tidy suggestions disappear and never appear again.
@H-G-Hristov I don't repro the issue. Are you able to determine what went wrong? Is IntelliSense or any other features working at all?
Let me just remind you that I am on M1 macOS 12.5.1 and I'm using the latest non-insiders version of the C++ related extensions. If I load VSCode and then I load the CMake project, IntelliSense (+ Clang-Tidy + the InlayHints) works for a short while then it stops.
Sometimes IntelliSense appears to be stuck at updating indefinitely and in the code editor all I see is "Loading...".
I'm attaching a log. The first files is after I started VS and the second file is the part after I edited a file.
01-before.log <- everything is working 02-after.log <- no more clang-tidy and inlay hints 03-later.log <- clang-tidy stuff appeared in the log after I opened a new file but nothing was displayed in the code editor, flame is stuck indefinitely, intellisense appears to be working
Ah, thanks, the 02-after.log appears to have useful into. The error "clang: error: cannot use 'c++-cpp-output' output with multiple -arch options" seems like it's causing invalid configuration to be used. Are you able to not have 2 arch, i.e. "-arch arm64 -arch x86_64" should just be used once? We're getting those passed to use by the compilerFragments received from CMake Tools -- do you believe there could be a CMake Tools bug that is sending that?
@Colengms Any thoughts on this? Should we auto-filter out duplicate -arch args?
I see the same 2 -arch in the 01-before.log, but it's only in the custom browse data and "Custom configurations" doesn't appear to have been sent yet -- @H-G-Hristov does the bug start reproing after you see "Custom configurations received" in the logging?
I see the same 2 -arch in the 01-before.log, but it's only in the custom browse data and "Custom configurations" doesn't appear to have been sent yet -- @H-G-Hristov does the bug start reproing after you see "Custom configurations received" in the logging?
I cannot be sure but maybe. "Custom configurations received" in the logging after the inlay hints disappeared. Please find the log of the session, including my CMake presets, attached:
vscode.failed.to.save.log CMakePresets.json.zip
Also another (I guess unrelated) issue happened. I wasn't able to save the above log with VSCode. On save, save all, etc. the save dialog on Mac didn't appear, even after I restarted VSCode. I used nano to save it.
Yeah, I see the "Custom configurations received" with the 2 archs and I'm able to repro the clang error with the 2 archs, but I don't know yet how to repro the "std=", so I'm not sure if that's a separate issue or not yet. The 2 archs is invalid input to clang, so you'll need to get those removed. If you're not adding 2 archs in your CMakeLists.txt you may want to file a bug on CMake Tools.
I can add a workaround to fix the "std=" even without a repro, which may fix your issue.
I'm hesitant to add a workaround for the 2 archs though, because that is not valid input, unless @Colengms thinks we should.
A fix for the "-std=" should be in our next 1.13.1 pre-release, maybe next Tuesday. That should fix the clang-tidy error about '-std=', but the 2 arch might still cause other issues due to system defines/includes not be used, not sure.
I can add a workaround to fix the "std=" even without a repro, which may fix your issue.
I'm hesitant to add a workaround for the 2 archs though, because that is not valid input, unless @Colengms thinks we should.
I need to check again (because I don't remember) how the project is setup but from what I recall we build a "universal" binary for macOS. So that's how our CMake presets is setup and the build works on Intel and Apple Silicon Macs without changes.
Since Xcode/macOS is a special case maybe this should be handled by the extension (or at least issue a warning ???). The issue is not obvious to me as a user and as a user I expect that "universal' is the right way. https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary
Yeah, I see the "Custom configurations received" with the 2 archs and I'm able to repro the clang error with the 2 archs, but I don't know yet how to repro the "std=", so I'm not sure if that's a separate issue or not yet. The 2 archs is invalid input to clang, so you'll need to get those removed. If you're not adding 2 archs in your CMakeLists.txt you may want to file a bug on CMake Tools.
I can confirm that this is exactly what we need to build an universal binary:
if (APPLE)
if(AGENT_ARCHITECTURE MATCHES "universal")
set(AGENT_ARCHITECTURE "arm64;x86_64")
...
endif (APPLE)
...
if (APPLE)
set (CMAKE_OSX_ARCHITECTURES "${AGENT_ARCHITECTURE}")
...
https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html
Okay, then it looks like the 2 arch issue is a bug with CMake Tools. Can you file an issue at https://github.com/microsoft/vscode-cmake-tools/issues on that? Or I could move this issue there or keep this issue here to track the "-std=" fix and create a new CMake Tools issue.
@sean-mcmanus I created a new issue: https://github.com/microsoft/vscode-cpptools/issues/9894