Sublime Forum

Lsp mode clangd debug output?

#1

I have installed lsp mode and installed clangd. after generating compile_commands.json for my project, clangd can’t seem to find certain headers even though the include path has been specified for that file in the compile_commands.json database. I have added debug logging flags in the lsp project’s settings, but I have no idea where this output goes so I can view it.
Thanks!

0 Likes

#2

If you’re using CMake and you’re building out-of-source, then compile_commands.json is put into the root of the build folder. It should instead be present at the root of your source tree (the folder that you have open in Sublime Text, most likely). One way to do this is to create a symlink on unix-like OSes: ln -s path/to/compile_commands.json .

If the compile_commands.json file is already at the root of your project, we’re going to need more background info on how you build your project exactly.

You can run LSP: Toggle Log Panel

0 Likes

#3

I build my project with catkin, with an older version of cmake that doesn’t consolidate all compile_commands.json into the workspace. I manually combine the json files created in the build directory. Many things with lsp mode work after this point, but some things don’t make any sense, certain headers like ros/ros.h can’t be found, even though the compile_commands.json for the file in question lists the path to that header. I have tried opening the lsp toggle log panel but it seems to show info about lsp mode logging, not clangd’s standard output and standard error. I’m trying to figure out why clangd can’t find the file and if there is pertinent error output to debug that as a first step

0 Likes