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

Commands

  • cmake-language-server: LSP server
  • cmake-format: CLI frontend for formatting

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

Uploaded Source

Built Distribution

cmake_language_server-0.1.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file cmake-language-server-0.1.3.tar.gz.

File metadata

  • Download URL: cmake-language-server-0.1.3.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.7.12 Linux/5.4.0-1059-azure

File hashes

Hashes for cmake-language-server-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f8719065a57e028cee773759a7e9e5966455ca928fd8d51a441bfcb2574959d8
MD5 78813f5d790d148b8d2e2f22f11c68aa
BLAKE2b-256 59bfb0b66fd182e85af48031b828704f4dadf255cbf8adc9eff1780c235ecbee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cmake_language_server-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc64cb2c19615aadda6bf92904d86591250b8b9bc1baa304e4d2dee0a659bce
MD5 e8f4d1944fae9ae493e4389588fb63ec
BLAKE2b-256 fb227b1869a1c1b331b44dc7df80a3e69ee0f1dac30323f531f66aa4dc8d879a

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