Skip to content

k0tran/zed_neocmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  1. Add set(CMAKE_EXPORT_COMPILE_COMMANDS ON) to the CMakeLists.txt, somewhere below project;
  2. Reconfigure. If everything is correct there should be compile_commands.json file under build directory. It is also advised to use CXX=clang for clangd better compatibility;
  3. Go to Zed's settings.json (Ctrl+Shift+P open local settings/open default settings);
  4. Inside lsp section paste the following (replace build with 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!

About

CMake grammar and neocmakelsp for Zed editor

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors