Skip to content

k0tran/zed_neocmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeoCMake

This is CMake extension for Zed editor. It combines uyha/tree-sitter-cmake and Decodetalkers/neocmakelsp (hence why it's "neo"). The tree-sitter grammar is taken from helix repo.

C++ LSP support (compile_commands.json)

For making clangd and cmake work together do the following:

  1. Add set(CMAKE_EXPORT_COMPILE_COMMANDS ON) at the top of the CMakeLists.txt (somewhere below project);
  2. Reconfigure cmake project. If everything is correct there should be compile_commands.json file under build directory. I also advise using CXX=clang for better compatibility with clangd;
  3. Go to Zed's settings.json: Ctrl+Shift+P open local settings/open default settings;
  4. Find lsp section. Inside it paste the following (replace build with your build directory name):
"clangd": {
    "arguments": ["-background-index", "-compile-commands-dir=build"]
}

CMake tasks

The extension now provides 5 tasks to start with:

  • CMake configure Debug
  • CMake configure Release
  • CMake build Debug/Release - builds what is configured beforehand
  • CMake configure and build Debug
  • CMake configure and build Release

All tasks use build directory for building

About

CMake grammar and neocmakelsp for Zed editor

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •