Type: LanguageService
Describe the bug
It seems cpptools intellisense engine has stopped working for Qt types (at least for me). It works fine with the same config on Linux. The problem seems concentrated around finding Qt includes...
To Reproduce
Install Qt open source library under Mac - placed in ~/Qt. Configure CMakeLists.txt to correctly include required libraries and headers (see simple GUI project here). I added the Qt include directories with include_directories (Qt5Core_INCLUDE_DIRS, Qt5Widgets_INCLUDE_DIRS, etc). Point c_cpp_properties to the correct clang compiler and compile_commands.json file (make sure generating compile_commands to specified location). Here is mine:
{ "configurations": [ { "name": "Mac", "includePath": [ "${workspaceFolder}/**" ], "defines": [], "compileCommands": "${workspaceFolder}/build/compile_commands.json", "macFrameworkPath": [ "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "clang-x64" } ], "version": 4 }
Basically any header include which has a Qt type somewhere gets a red squiggle, and all Qt types receive no autocomplete suggestions. When I first installed vscode and the extension on Mac, it was working to complete Qt types fine with the above config. Then something happened and it stopped working - unfortunately I don't know what exactly as this is a new iMac and I have been installing software and updates continually. I do know that the OS was updated to Catalina, but it seems it was working after that update and restart.
Things I have tried
Adding Qt include directories under includePath - both individually and adding all of them as a top level glob ** (I am confused on the necessity of includePath when compile_commands is included in general - is it used in this case?)
Completely reinstalling vscode (deleting all config files in global .vscode) and starting from scratch with the extension.
Installing different versions of cpptools with auto update extensions turned off.
Moving compile commands around to different locations and updating the location in c_cpp_properties.
Using clang compiler included with XCode (turns out it is same exact one as installed by homebrew anyways)
Setting intellisense include backup behavior to use tags - this causes the red squiggles to change to blue, and most Qt types then have auto-completion available however the context for the completion is not correct
Expected behavior
I would expect intellisense actions to work correctly with Qt. The project compiles with cmake_tools and clang 11 with no problems.
I will also note that as a backup I have cquery installed (brew install cquery), and if I disable the language server in settings, enable the cquery extension and reload vscode, cquery has no trouble finding any of the types, includes, or type completions based on my compile_commands.json. This tells me either I have something configured incorrectly for cpptools, or there is a bug somewhere.
Thanks
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4