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.11.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

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

Hashes for cmake_language_server-0.1.11.tar.gz
Algorithm Hash digest
SHA256 005f48367ec569457a7229a58f6762044fddacac647858b39d725ae2b3cd695b
MD5 b5718ad374096f9123dc2e059093448a
BLAKE2b-256 cfad54c337fd2093a7c7c13528ac1393aeda009cdc16be954041834328845237

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cmake_language_server-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 74ce1fa93a3db258776d881935172a87124ed621298404ac42f960eab6be8c04
MD5 f98306910fc3d8f9cb3b244049c8c551
BLAKE2b-256 60b80ea1c0b86b8c6ca6c2dd5292762f282e779d6631c0641d043123bf8be164

See more details on using hashes here.

Supported by

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