It is a CMake lsp based on tower-lsp and treesitter
cargo install neocmakelsp
The config of neocmakelsp is in nvim-lsp-config
, so just follow nvim-lsp-config
to setup it
neocmakelsp has two start ways: stdio
and Tcp
. Tcp
is for debug. If you want to help me and debug is , you should start it with Tcp
way.
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 -- on_attach is the on_attach function you defined
}
}
nvim_lsp.neocmake.setup({})
end
if not configs.neocmake then
configs.neocmake = {
default_config = {
cmd = vim.lsp.rpc.connect('127.0.0.1','9257'),
filetypes = { "cmake" },
root_dir = function(fname)
return nvim_lsp.util.find_git_ancestor(fname)
end,
single_file_support = true,-- suggested
on_attach = on_attach -- on_attach is the on_attach function you defined
}
}
nvim_lsp.neocmake.setup({})
end
new version will not work on mac and windows, so I need your help
- complete
- symbol_provider
- On hover
- Format
- GO TO Definitation
- find_package
- include
- Search cli
- Get the project struct
- Undefined function check
- add_subdirectory