Language Server for RPM spec files
Project description
RPM Spec File Language Server
This is a proof of concept implementation of a server implementing the Language Server Protocol for RPM Spec files.
Please share your feature requests with us by opening an issue, creating a discussion or chat with us on matrix in #rpm-spec-language-server:matrix.org.
Supported LSP endpoints
autocompletion of macro names, spec sections and preamble keywords
jump to macro definition
expand macros on hover
breadcrumbs/document sections
Requirements
Python >= 3.11
Running the server
Install the dependencies via poetry install
Launch the server in tcp mode (binds to `127.0.0.1:2087 by default) via poetry run rpm_lsp_server
Alternatively, you can build the python package, install the wheel and run the module directly:
poetry build
pip install --user dist/rpm_spec_language_server-*.whl
python -m rpm_spec_language_server
The server requires the spec.md file. It can either use the locally installed copy from the rpm package or (if the documentation has not been installed) from a locally cached version in ~/.cache/rpm/spec.md.
Clients
VSCode
A very simple VSCode client is available in clients/vscode/. Building requires nodejs and the npm package manager:
$ npm install
$ npm run package
Install the created rpm-spec-language-server-$VERSION.vsix and launch the language server in tcp mode.
vis with vis-lspci
Add to your ~/.config/vis/visrc.lua this code:
lsp = require('plugins/vis-lspc')
lsp.ls_map['rpmspec'] = {
name = 'RPMSpec',
cmd = 'python3 -mrpm_spec_language_server --stdio'
}
Neovim with built-in LSP client
local lspconfig = require("lspconfig")
local util = require("lspconfig.util")
local configs = require("lspconfig.configs")
configs.rpmspec = {
default_config = {
cmd = { 'python3', '-mrpm_spec_language_server', '--stdio' },
filetypes = { 'spec' },
single_file_support = true,
root_dir = util.find_git_ancestor,
settings = {},
},
docs = {
description = [[
https://github.com/dcermak/rpm-spec-language-server
Language server protocol (LSP) support for RPM Spec files.
]],
},
}
lspconfig["rpmspec"].setup({})
Neovim with coc.nvim plugin
Open nvim, run :CocConfig, and merge the following JSON into your configuration
{
"languageserver": {
"spec": {
"command": "rpm_lsp_server",
"args": ["--stdio"],
"filetypes": ["spec"]
}
}
}
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
Hashes for rpm_spec_language_server-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f548fc3fa0afd66d251471f617fade22c2ef5e4f0be1956a5449f2986a61ce8 |
|
MD5 | e7272adce9f3ff054b43d0189ad1707a |
|
BLAKE2b-256 | 593f30e0e1eea6b5d1d75e7ea701bd9ee2f582f1bcdc22477812678076a07ec1 |
Hashes for rpm_spec_language_server-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36dd92a3dbca38d5e3402d7bbff21e8875bbcc8ea996b7787b42df59311e81ec |
|
MD5 | c279cbbd076a52b45fe64e0c25c8a4a3 |
|
BLAKE2b-256 | 2103c1b5f763204d978e60eadeedd3c1c236bfad7ccb086eb27dc2cc9b0ad151 |