-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense fails to find Qt header files #2324
Comments
Actually, QApplication is found, it is a dependency of QApplication that is not. The way that Apple Frameworks are normally included is of the form
in the
which allows framework include syntax (e.g. the If you could poke into your build folder and share the json file CMake generated for this target, I can see whether this information is present or not (if not, this would be a CMake bug). Based on the information you've shared, I'd expect the file to be here: |
CMake generated json files attached |
I also tried adding
|
I don't see the framework path being added in the compile fragments in the JSON files. But I do see a reference to
This is because cpptools does not use your values for |
|
Thanks. I did see a place where the I did see a section related to MOC which appears to be QT's pre-C++ compiler. It's possible that the framework directory is "known" and therefore not surfaced on the command line. We might have to do some special casing for QT. |
I added
|
Unfortunately that information is not in the JSON files we use to configure IntelliSense so we'll have to work around it. It looks like this was already reported to Kitware, but the issue has not been addressed. https://gitlab.kitware.com/cmake/cmake/-/issues/19897 |
I manually added the framework path to the
|
Same issue, but this method doesn't work for me. |
I've noticed that on Mac Qt uses Framework to organize its headers, which uses Clang Module to search header path instead of the real path, that maybe the reason why cmake cannot find it. |
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Headers/",
"${workspaceFolder}/packages/libuiohook/include/",
"${workspaceFolder}/packages/clip/",
"/usr/local/Cellar/qt@5/5.15.8_2/lib/QtWidgets.framework/Headers/",
"/usr/local/Cellar/qt@5/5.15.8_2/lib/QtWidgets.framework/",
"/usr/local/Cellar/qt@5/5.15.8_2/include/"
],
"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++17",
"intelliSenseMode": "macos-clang-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
This is my |
@jctaoo Yeah, you specified the I tried adding Strangely, after I The same thing happened to other packages as well. I'm not sure why or how this happened. Btw, after switching to the clangd extension in VSCode, it works well without needing any configuration. |
@bobbrow Looks like that issue was recently resolved by a change to the CMake codemodel. |
@rectalogic Thanks for pointing that out. We'll work on incorporating the File API changes from CMake 3.27 in our 1.15 extension release. |
I've tested #3247 with the repro project in the original post and everything seems to be working now. This fix will ship in version 1.15, which we expect to release around the end of the month. |
Brief Issue Summary
cmake-tools fails to find Qt header files. It appears to be sending an empty browsePath to cpp-tools
To reproduce on macOS 11.6.2 with Xcode 13.2.1:
Then open vscode-cmake in vscode and configure cmake-tools.
vscode can successfully build the project, but if you open
![header-not-found](https://user-images.githubusercontent.com/11581/149424083-fc95cf6d-05ae-42e8-9b9d-6880c02b5e9a.png)
main.cpp
it fails to find the Qt<QApplication>
header.CMake Tools Diagnostics
C/C++ Log Diagnostics
The
Custom browse configuration
has an emptybrowsePath
, this may be the issue?Debug Log
The text was updated successfully, but these errors were encountered: