27 releases (4 breaking)
new 0.5.10 | Mar 28, 2023 |
---|---|
0.5.4 | Feb 28, 2023 |
0.4.9 | Dec 18, 2022 |
0.4.7 | Nov 14, 2022 |
0.2.4 | Jul 17, 2022 |
#3 in Text editors
734 downloads per month
3.5MB
3K
SLoC
CMake lsp based on Tower and treesitter
It is a CMake lsp based on tower-lsp and treesitter
Install
cargo install neocmakelsp
Setup
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.
Stdio
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
Tcp
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
Help needed
new version will not work on mac and windows, so I need your help
Features
- watchfile
- complete
- symbol_provider
- On hover
- Format
- GO TO Definitation
- find_package
- include
- Search cli
- Get the project struct
If you want to use watchfile in neovim, use the nightly one, and set
capabilities = {
workspace = {
didChangeWatchedFiles = {
dynamicRegistration = true,
},
},
}
It will check CMakeCache.txt, and get weather the package is exist
TODO
- Undefined function check
Show
Search
symbol
Complete and symbol support
OnHover
GoToDefinition
Tree
Dependencies
~12–19MB
~371K SLoC