Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] cmake support how to integrate the compile_commands.json parser into CDT

Hi all,

I added some experimental integration in gerrit mainly for testing so far.

As it turns out there are use cases behind just index support for the parser.
So please comment on how to design the methods for the parser to integrate it with CDT. I am appreciating any suggestions.

For now I found the following use cases:
1) Syntax highlighting/C-DOM-parser: For a given IFile, return the set of defines, include path to the DOM.
2) LSP. For a given IFile, return the path to the compiler executable and the set of command-line args that affect LSP (e.g. -m32, --sysroot). (This use-case is just a rough guess of mine).
3) End users often ask: Is compiler-option '-std=c17' (or similar) recognized and used for built-in detection? To aid users, these should be a way to provide a report on the options and detected include path and macros. (Otherwise we might get lots of questions).

Concerning the end-user question, this is currently implemented by printing the command-line and output of built-in detection to a console. This was inspired by managed built but turns out to be wayy too complicated for users. They will have to enable the 'allocate console' option, force a new build ro be run and finally have to find the console. It could be much simpler if users can just click a 'show report' button and have a dialog/view opened.


Back to the top