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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b4768d89788c582b61d4503f6a3b0e594318af9d67be6d5453cded6dec0d7a8 |
|
MD5 | 3f57e375fa32851686c9b92ba0eec947 |
|
BLAKE2b-256 | 65d0caf71019da3fe2eba801c620cd2ee9a122ede9e048101bf3ee024a5065fc |
Close
Hashes for cmake_language_server-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f71e3ba7f379cbfc7d766e508f0ea6bb1f7736e967910439aca699b06fee82de |
|
MD5 | 30573358a747f469484d59ccbdfa4921 |
|
BLAKE2b-256 | 564d91640e6a7da36cca68e6b82c95c58d5ba5e5b6327e8e6cffc883f49dc06e |