-
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
Definitions passed via compile_commands.json (using CMake), gets parsed wrong. #2305
Comments
If you could share the compile commands entry that uses this define, that would be the fastest way for us to diagnose the problem. Otherwise, we'll take a look at generating one next week when we get back in the office. |
Sure.
|
You're telling the compiler to define __weak to be |
This
Escaping parentheses Also I think parenthesising whole |
@sean-mcmanus, this looks like it could be a bug. Note that |
I noticed earlier, that on windows i got different |
I just looked at the tests and we don't have any for this case. That's probably why we missed it. |
The parsing issues with compile_commands.json definitions should be fixed with 0.19.0 -- I think part of the fix made it into 0.18.0, but there were additional fixes afterwards. |
Type: LanguageService
Definitions from
compile_commands.json
gets parsed wrong. If I want to pass definition via CMake I add following statement inCMakeLists.txt
:Now
__weak
should be replaced with__attribute__((weak))
in code, andABC
should be replaced with"asd"
string literal. At least that how compiler behaves. Instead if I hover over__weak
i get#define __weak "__attribute__((weak))"
which is incorrect. Also if i hover overABC
i get proper information#define ABC "asd"
. This happens only when definition contains one or more characters that have to be escaped, so if I set__weak
definition to__attribute__
it gets passed correctly. It happens because without need to escape characters, part after=
in definition does not get wrapped in"
by CMake. So instead-D__weak="__attribute__((weak))"
on command line appears-D__weak=__attribute__
.This also causes problem to be reported (but it is due to invalid
__weak
value):Linux 4.17.6-1-ARCH
1.25.1
0.17.7
6.0.1
To Reproduce
Example:
c_cpp_properties.json
lib.cxx
CMakeLists.txt
Steps to reproduce the behavior:
rm -rf build && cmake . -Bbuild && VERBOSE=1 cmake --build build
insidevscode-intelisense
folder.vscode-intelisense
directory in vscode.__weak
andABC
inlib.cxx
.Expected behavior
__weak
definition to be recognized correctly as__attribute__((weak))
instead"__attribute__((weak))"
.No problems reported.
The text was updated successfully, but these errors were encountered: