[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] cmake support how to integrate the compile_commands.json parser into CDT
|
Hi Martin,
We briefly touched this topic at the last CDT call. I suggest to
extract the functionally to work with compile_command.json to a
separate bundle or bundles and then use it for use cases you
enumerated.
The base name may be "org.eclipse.cdt.jsoncdb" (JSON Compilation
Database [1]).
I can try to formulate the interface and then we can register
CompileCommandsJsonParser as default implementation.
Regards,
AF
[1]
https://clang.llvm.org/docs/JSONCompilationDatabase.html
13.06.2020 14:45, 15 knots пишет:
Hi all,
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.
Martin
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev