-
Notifications
You must be signed in to change notification settings - Fork 570
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
Fix compile_commands.json #3538
Conversation
4d9323d
to
2088a0b
Compare
Can you give a little context as to what is being fixed here? From the patch I don't really understand the issue. |
If I run
Both are I think invalid in JSON, and at least the VS Code C++ extension complains that it could not parse the With the fixes in this PR it looks like the following, and gets parsed by the VS Code C++ extension without a problem:
|
configure.py
Outdated
@@ -1813,7 +1813,13 @@ def insert_join(match): | |||
output += lines[idx] + "\n" | |||
idx += 1 | |||
|
|||
return self.join_pattern.sub(insert_join, self.value_pattern.sub(insert_value, output)) + '\n' | |||
subsituded_template = self.join_pattern.sub(insert_join, self.value_pattern.sub(insert_value, output)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
substituted_
But I think just output
is simpler and sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changet to output
configure.py
Outdated
if len(lines) == 1 and not template.endswith('\n'): | ||
return subsituded_template.rstrip('\n') | ||
|
||
return subsituded_template + '\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be adding another, additional newline, which doesn't seem necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree this is not needed. Removed it.
Removes newlines in JSON strings and normalize path to avoid backslash in JSON strings. Also remove the additional added newline at the end.
2088a0b
to
59958ae
Compare
Removes newlines in JSON strings and normalize path to avoid backslash in JSON strings.
Also remove the additional added newline at the end.
Note if testing with
ccache
orsccache
in VS Code:Make sure your use the most recent version 1.15.4 of the C++ extension as this fixed a compatibility issue with them microsoft/vscode-cpptools#7616.