-
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
-D__FILENAME__=\\\"filename.c\\\" in compile_commands.json is not parsed properly #1795
Comments
I have the same problem with my ros project.
|
Thanks for reporting this. |
I hit this myself last week (from the repro project in #1777 ), but I didn't realize it was a bug. |
I'm testing a fix for this right now. |
Awesome, thank you! |
A preview of this is available in the insiders build if you would like to try it out and provide feedback. |
Just tried the preview. It worked great, thank you! |
This is fixed in 0.17.0. |
We use cmake to generate a __FILENAME__ definition for each file that is passed into the command line. __FILENAME__ is the same as __FILE__ without the full path. In compile_commands.json this will show up in the command as -D__FILENAME__=\\\"filename.c\\\". The first backslash escapes the second backslash and the third backslash escapes the ". This is so that on the command line it will show up as -D__FILENAME__=\"filename.c\" so that the quotes are escaped for the command.
In vscode, the intellisense thinks __FILENAME__ is \"filename.c\" instead of "filename.c". This causes a red squiggle under the __FILENAME__ macro.
A quick repro of this issue is to add the following to a CMakeLists.txt
The text was updated successfully, but these errors were encountered: