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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c525c57b2b679db073d4af8e56df8d8f143697efaf0098ee7c9b3485fd3f643 |
|
MD5 | cedc37fc45ebf4b8bba17d9f5b01bc7c |
|
BLAKE2b-256 | 817cb36ef64d8b74959058c9b0756aee12af327b7f95d9f25274142393d917d9 |
Close
Hashes for cmake_language_server-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a8da57f1b2efd2be539f4c083598a431589db17a708a0615c4b135e0030367b |
|
MD5 | d69d74abd3c17a9707219f77d4fc8c1d |
|
BLAKE2b-256 | bba0440ea07727f3e35a4d41ed4640b1ac7617d6c3a63edf683a386e1dd2b140 |