Some questions regarding LSP integration

Alexander Neundorf <[email protected]>
Newsgroups gmane.comp.kde.devel.kwrite
Message-ID <2638966.CGV0J55nlz@unknownc4d9870202f1>
Hi,

you may have noticed I'm catching up a bit...

Do I understand correctly that kate starts clangd, and then when editing some 
source file foo.cpp, it asks clangd for information about foo.cpp.

clangd then tries to "compile" foo.cpp by executing a compile command, which 
it tries to get from compile_commands.json.
For a file /home/alex/src/Project/foo.cpp, clangd searches for 
compile_commands.json in /home/alex/src/Project/, /home/alex/src/, /home/
alex/, /home/, / and /home/alex/src/Project/build/. Did I understand this 
correctly ? (so this will often fail)

IIRC, in the project plugin, we know if a file is part of a project, and the 
project knows where the build and the source directories are.
So kate could point clangd to the top level build directory of the source 
file. According to the clangd documentation it's currently not possible to 
tell clangd where the compile_commands.json file is. Correct ?

Then, in the compile_commands.json file, the calls to the actual compile are 
listed, e.g. using g++. What does clangd do with them ? Simply skip the 
compile executable and "hope" that clang understands the rest of the command 
line ?

Thanks
Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.