Skip to main content

CMake LSP Implementation

Project description

cmake-language-server

PyPI AUR version GitHub Actions (Tests) codecov GitHub

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

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 as cmake .. -DFOO=bar.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmake_language_server-0.1.10.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

cmake_language_server-0.1.10-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file cmake_language_server-0.1.10.tar.gz.

File metadata

File hashes

Hashes for cmake_language_server-0.1.10.tar.gz
Algorithm Hash digest
SHA256 dbc627dc1e549fc7414f459bdb340812acd84a0c8727b92e73c4bd348e6311bf
MD5 0a5eb31983187b1d8519ef29fe33b39b
BLAKE2b-256 ccce4b14dcaac4359fc9bdcb823763c7984b72e16ff2bf1c709bbc963cc0e0bc

See more details on using hashes here.

File details

Details for the file cmake_language_server-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for cmake_language_server-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 aee91723443df51b226d26b5607f9430121f6aea6cccbea1ad31be3cd96934bb
MD5 af96bedc5a1b9141827b1348656b3105
BLAKE2b-256 499ff7f664128af0ca0e3aee22e3c9f9e0ecf43b22b6b368f1ef3420f8e667ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page