Add support to generate compilation database#51
Add support to generate compilation database#51neilweidinger wants to merge 4 commits intodevelopfrom
Conversation
|
f, travis is failing because |
7987a26 to
2d54e6c
Compare
…ile_commands.json if using clang as compiler
|
I do not have any major issues with this. Thanks for keeping the change set small. A small suggestion: You could instead have a separate target (e.g. |
mkristien
left a comment
There was a problem hiding this comment.
Are you not interested in extending this functionality to test files as well?
| # Only works with gnu sed, couldn't get newlines to work with bsd sed | ||
| # On mac use homebrew to install gnu sed | ||
| # Double $ signs are so Make interprets it as a single regex $, on command line use a single $ sign | ||
| $(Verb) find bin -name '*.json' -exec sed -e '1s/^/[\n/' -e '$$s/,$$/\n]/' {} + > compile_commands.json |
There was a problem hiding this comment.
Could you clean the temporary .json files once you do not need them?
There was a problem hiding this comment.
Sure, this should be possible, but I'm not quite sure why this would be beneficial? The .json files are in bin anyways, would there be a difference?
|
Thanks for taking a look Martin! That's definitely a good point that language server indexing is unrelated to the compilation cycle. My original rationale for putting it together during compilation was because it was just easy to pass the Having the database as a separate target seems like a much better idea, I'll give it a shot at implementing it this way. |
Description
Generates a
compile_commands.jsoncompilation database, used for semantic auto-complete in text editors using theclangdlanguage server. Can be used for text editors that support the language server protocol, like VSCode and Vim :))https://sarcasm.github.io/notes/dev/compilation-database.html