| Crates.io | debian-lsp |
| lib.rs | debian-lsp |
| version | 0.1.1 |
| created_at | 2025-08-04 00:47:37.447097+00 |
| updated_at | 2025-08-16 09:50:17.014592+00 |
| description | Language Server Protocol implementation for Debian control files with field completion, diagnostics, and quickfixes |
| homepage | |
| repository | https://github.com/jelmer/debian-lsp |
| max_upload_size | |
| id | 1780199 |
| size | 224,441 |
Language Server Protocol implementation for Debian control files.
At the moment this is fairly basic, but the goal is to provide a useful LSP server for editing Debian control files (debian/control) with features like:
The LSP provides the following diagnostic capabilities:
source instead of Source)The LSP offers automatic fixes for detected issues:
source → Source, maintainer → Maintainercargo build --release
The binary will be available at target/release/debian-lsp.
Add the following configuration to your VS Code settings.json:
{
"languageServerProtocols.debian-lsp.command": [
"/path/to/debian-lsp/target/release/debian-lsp"
],
"languageServerProtocols.debian-lsp.filetypes": [
"debcontrol"
],
"files.associations": {
"control": "debcontrol",
"**/debian/control": "debcontrol"
}
}
Alternatively, you can use the generic LSP client extension:
settings.json:{
"genericLanguageServer.configurations": {
"debian-lsp": {
"command": ["/path/to/debian-lsp/target/release/debian-lsp"],
"filePatterns": ["**/debian/control", "control"],
"languageId": "debcontrol"
}
}
}
Build the coc plugin:
cd coc-debian
npm install
npm run build
Install the plugin in Vim with coc.nvim:
:CocInstall /path/to/debian-lsp/coc-debian
Configure the LSP path in your coc-settings.json:
{
"debian.serverPath": "/path/to/debian-lsp/target/release/debian-lsp"
}
Add the following configuration to your .vimrc or init.vim:
" Register debian-lsp with ALE
let g:ale_linters = get(g:, 'ale_linters', {})
let g:ale_linters.debcontrol = ['debian-lsp']
" Configure the debian-lsp executable
call ale#linter#Define('debcontrol', {
\ 'name': 'debian-lsp',
\ 'lsp': 'stdio',
\ 'executable': expand('~/src/debian-lsp/target/release/debian-lsp'),
\ 'command': '%e',
\ 'project_root': function('ale#handlers#lsp#GetProjectRoot'),
\})
Note: Adjust the executable path to match your installation location. You can trigger code actions in ALE with :ALECodeAction when your cursor is on a diagnostic.
Add the following configuration to your Neovim config (init.lua):
-- Configure debian-lsp
vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, {
pattern = {'*/debian/control', 'control'},
callback = function()
vim.lsp.start({
name = 'debian-lsp',
cmd = {vim.fn.expand('~/src/debian-lsp/target/release/debian-lsp')},
root_dir = vim.fn.getcwd(),
})
end,
})
Or if you prefer using lspconfig:
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
-- Define the debian-lsp configuration
if not configs.debian_lsp then
configs.debian_lsp = {
default_config = {
cmd = {vim.fn.expand('~/src/debian-lsp/target/release/debian-lsp')},
filetypes = {'debcontrol'},
root_dir = lspconfig.util.root_pattern('debian/control', '.git'),
settings = {},
},
}
end
-- Enable debian-lsp
lspconfig.debian_lsp.setup{}
Note: Adjust the cmd path to match your installation location.
Open any debian/control or control file in your configured editor. The LSP will automatically provide completions for:
To run the LSP in development mode:
cargo run
To watch and rebuild the coc plugin:
cd coc-debian
npm run watch