-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
compile_commands.json not working correctly for *.C files since 1.1.0 #6497
Comments
Hi @JeanMiK . Thanks for reporting this. There appears to be an issue with how the extension is handling ".C" files, which are (internally) mapped to C++ using the |
I now got 1.2.0-insiders installed, and this is still not working, neither for my real workspaces, nor for a small dummy test workspace with just 3 files: I have the following compile_commands.json:
And as with the 1.1 releases, I still get configuration errors when opening any of the *.C files
while |
Hi @JeanMiK . Thanks for letting us know. It looks like this was fixed on Windows, but there was an issue blocking that fix on Linux/Mac. I have another fix in progress that should make it into 1.2.0-insiders2. |
I'm now on 1.2.0 and am experiencing this problem still, on WSL 2. OS: Windows 10 - WSL mode (Ubuntu 18.04)
|
As I read the original issue description a bit more attentively, I think the OP's problem was the opposite of mine: I want .c files to be treated as C++, as described in the compile_commands.json, and they're not. I tried setting the user files.associations setting as so:
And the files still get treated as C. Let me know if I should open a separate issue for this. |
Hi @fcharron . I believe those should be filename patterns. I'm not able to repro an issue when using |
Oh, that's interesting... I always thought that file associations could be set on a per-file basis too. Indeed, using
works fine. I think what threw me off was that when editing that specific file, I must have set the language mode directly to C++, from the bottom-right indicator, and I still was seeing squiggles on Thanks for the clarification @Colengms ! |
Type: LanguageService
Since version 1.1.0, it seems like none of my *.C files are recognized anymore in the compile_commands.json, even though they are present.
This is to say, in the 'C/C++ Configuration' output, I get errors of the style
even though the files are present in the compile_commands.json !
So far, it looks like this is happening only for *.C files, not *.cc files: I have two different workspaces, one in which almost all source files are *.cc, and another one in which almost all the files are *.C, and in both of them, so far, I have seen the error only for the *.C files (meaning that in one of the workspaces, IntelliSense is working quite badly right now).
This is not the same issue than #6311, as it concerns files that exist all the time as real git objects, not only derived / generated items.
Describe the bug
Steps to reproduce
Create a small workspace containing both *.C and *.cc files and a CMakeLists.txt using all of them for different binaries.
Let cmake generate a compile_commands.json
Configure cpptools to use the compile_commands.json generated by cmake
Expected behavior
Opening the different *.C and *.cc files should not yield configuration errors
-->
C/C++: Log Diagnostics
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: