Closed GenieTim closed 3 days ago
@GenieTim You need to correctly set your include path ordering, particularly the system includes, more in particular you need to set the system includes with -isystem or have them set by your compiler and use -isysroot instead, etc.
i.e. these include paths:
include: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
include: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
include: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include
include: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
and "/usr/local/include",
Ideally, your include path ordering should exactly match what you're using to build (particularly for system includes which are order dependent). Usage of **
at the end of include path will order them in a non-deterministic order.
Our IntelliSense compiler is "sensitive" to incorrect system include path ordering since it causes the parser into enter invalid state that it doesn't expect.
Thank you for your respone, @sean-mcmanus , indeed, this seems to change some things for certain files. I guess I can get this to work.
It's not clear to me though why this would only have affected certain projects. Does the compiler only get confused depending on the header files actually loaded?
And what's the thing with -isysroot
, where would I add this to the C/C++ configuration? Also in the include paths?
@sean-mcmanus I thought we were more resilient about this. I see that the compilerPath is set. I thought that we removed the duplicates and preferred the compiler provided ones to preserve the order. Unless maybe the compiler isn't actually reporting those ones and they should just be removed...
@bobbrow The compiler path is only providing
system include: /opt/homebrew/Cellar/llvm/19.1.3/include/c++/v1
system include: /opt/homebrew/Cellar/llvm/19.1.3/lib/clang/19/include
system include: /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include
because the compiler provided ones are marked as "system includes".
Environment
Bug Summary and Steps to Reproduce
Bug Summary: The IntelliSense and Language server crashes.
Steps to reproduce:
Expected behavior: Language Server does not crash.
Configuration and Logs
Other Extensions
E.g. the
CMake Tools
extension; issue persists after disabling other extensions.Additional context
Attempt to debug failed, see screen recording below, would be thankful for some pointers what's going wrong.
https://github.com/user-attachments/assets/59a3be8f-cc54-42db-a504-f3e1b81593e0
Nonetheless, I have the crash stack here from the corresponding output tab: