It is a CMake lsp based on tower-lsp and treesitter
bash
cargo install neocmakelsp
lua
local configs = require("lspconfig.configs")
local nvim_lsp = require("lspconfig")
if not configs.neocmake then
configs.neocmake = {
default_config = {
cmd = { "neocmakelsp", "--stdio" },
filetypes = { "cmake" },
root_dir = function(fname)
return nvim_lsp.util.find_git_ancestor(fname)
end,
single_file_support = true,-- suggested
on_attach = on_attach
}
}
nvim_lsp.neocmake.setup({})
end
```lua if not configs.neocmake then configs.neocmake = { defaultconfig = { cmd = vim.lsp.rpc.connect('127.0.0.1','9257'), filetypes = { "cmake" }, rootdir = function(fname) return nvimlsp.util.findgitancestor(fname) end, singlefilesupport = true,-- suggested onattach = onattach } } nvimlsp.neocmake.setup({}) end
```
new version will not work on mac and windows, so I need your help