This is CMake extension for Zed editor. It combines uyha/tree-sitter-cmake and neocmakelsp/neocmakelsp (hence why it's "neo").
For that you need to tell cmake to export compile commands. Example:
- Add
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)to theCMakeLists.txt, somewhere belowproject; - Reconfigure. If everything is correct there should be
compile_commands.jsonfile under build directory. It is also advised to useCXX=clangfor clangd better compatibility; - Go to Zed's
settings.json(Ctrl+Shift+Popen local settings/open default settings); - Inside
lspsection paste the following (replacebuildwith your build directory name):
"clangd": {
"binary": {
"arguments": ["-compile-commands-dir=build"],
},
},This extension should atomatically create tasks from files.
If you want to use CMakePresets.json or CMakeUserPresets.json this can be done in tasks menu. Just type cmake --preset <your-preset-name> and hit enter.
Hi! If you encountered a bug or want to contribute - look up existing issues or create one. Note that I sometimes it'll take a bit for me to answer, but I'll try best to maintain this project. Thanks!