CMake LSP Implementation
Project description
cmake-language-server
CMake LSP Implementation.
Alpha Stage, work in progress.
Features
- Builtin command completion
- Documentation for commands and variables on hover
- Formatting (by
cmake-format
)
Commands
cmake-language-server
: LSP server
Installation
$ pip install cmake-language-server
Tested Clients
- Neovim (neoclide/coc.nvim, prabirshrestha/vim-lsp)
Neovim
coc.nvim
"languageserver": {
"cmake": {
"command": "cmake-language-server",
"filetypes": ["cmake"],
"rootPatterns": [
"build/"
],
"initializationOptions": {
"buildDirectory": "build"
}
}
}
vim-lsp
if executable('cmake-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'cmake',
\ 'cmd': {server_info->['cmake-language-server']},
\ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'build/'))},
\ 'whitelist': ['cmake'],
\ 'initialization_options': {
\ 'buildDirectory': 'build',
\ }
\})
endif
Configuration
buildDirectory
This language server uses CMake's file API to get cached variables. The API communicates using<buildDirectory>/.cmake/api/
.buildDirectory
is relative path to the root uri of the workspace. To configure the build tree, you need to run the cmake command such ascmake .. -DFOO=bar
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cmake-language-server-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1573f921518d2e243175526dc19e6df463f8a04f04afbc78a2dde961a23f7ed |
|
MD5 | 3a4b27f3410156384edffd013a0ebd1c |
|
BLAKE2b-256 | 9e1c52b4f0590f2e9414de8c179e0cd9af3018a374b8b79a558c187531880cce |
Close
Hashes for cmake_language_server-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aad539e30805f924952617b8eabe30fbb3a303461f0333628b4d026ad13e74b1 |
|
MD5 | b49a365bef18d311d2193dca3b795a12 |
|
BLAKE2b-256 | 43db7b91c2c0853db17e86b7ec9b322572bb9e30c595e2677be58567f109b7da |