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
buildDirectoryThis language server uses CMake's file API to get cached variables. The API communicates using<buildDirectory>/.cmake/api/.buildDirectoryis 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmake_language_server-0.1.11.tar.gz.
File metadata
- Download URL: cmake_language_server-0.1.11.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005f48367ec569457a7229a58f6762044fddacac647858b39d725ae2b3cd695b
|
|
| MD5 |
b5718ad374096f9123dc2e059093448a
|
|
| BLAKE2b-256 |
cfad54c337fd2093a7c7c13528ac1393aeda009cdc16be954041834328845237
|
File details
Details for the file cmake_language_server-0.1.11-py3-none-any.whl.
File metadata
- Download URL: cmake_language_server-0.1.11-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74ce1fa93a3db258776d881935172a87124ed621298404ac42f960eab6be8c04
|
|
| MD5 |
f98306910fc3d8f9cb3b244049c8c551
|
|
| BLAKE2b-256 |
60b80ea1c0b86b8c6ca6c2dd5292762f282e779d6631c0641d043123bf8be164
|