NeoCMake
CMake grammar and lsp with neocmakelsp
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for NeoCMake. The extension's id is neocmake.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
NeoCMake
This is CMake extension for Zed editor. It combines uyha/tree-sitter-cmake and neocmakelsp/neocmakelsp (hence why it's "neo").
C++ LSP support (compile_commands.json)
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"],
},
},
Tasks
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.
Bugs, suggestions, features
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!