coc-debian
v0.1.7
Published
Debian language server support for coc.nvim (control, copyright, watch, changelog, tests/control, source/format, source/options, upstream/metadata, rules)
Maintainers
Readme
coc-debian
A coc.nvim extension that provides Language Server Protocol support for Debian control files.
Features
- Auto-completion for Debian control file field names
- Package name suggestions
- Automatic activation for
debian/controlfiles
Installation
Prerequisites
- coc.nvim installed in Vim/Neovim
- Node.js and npm
- The debian-lsp server built and available
Local Installation
Build the debian-lsp server first:
cd /path/to/debian-lsp cargo build --releaseInstall and build the coc extension:
cd coc-debian npm install npm run buildInstall the extension in coc.nvim:
:CocInstall file:///absolute/path/to/debian-lsp/coc-debianOr alternatively, create a symlink in your coc extensions directory:
ln -s /absolute/path/to/debian-lsp/coc-debian ~/.config/coc/extensions/node_modules/coc-debianConfigure the LSP server path:
Add the following to your coc-settings.json (
:CocConfigin Vim):{ "debian.enable": true, "debian.serverPath": "/absolute/path/to/debian-lsp/target/release/debian-lsp" }
Verify Installation
- Open a Debian control file (
debian/controlor any file namedcontrol) - Try typing field names and you should see completions
- Check
:CocList extensionsto see ifcoc-debianis listed and active
Configuration
Available settings in coc-settings.json:
debian.enable(boolean, default: true) - Enable/disable the extensiondebian.serverPath(string, default: "debian-lsp") - Path to the debian-lsp executable
On-Type Formatting
The server supports on-type formatting for deb822-based files (auto-inserting a
space after : in field names, continuation-line indentation on Enter). To
enable this, add the following to your coc-settings.json (:CocConfig):
{
"coc.preferences.formatOnType": true
}Code Lenses
The server provides code lenses for debian/control files, showing information
like the latest Standards-Version, current debhelper compat levels, and the
packaged version from vcswatch. To enable code lenses, add the following to your
coc-settings.json (:CocConfig):
{
"codeLens.enable": true
}By default, code lenses are shown above the relevant line. To show them at the end of the line instead, set:
{
"codeLens.position": "eol"
}Development
To work on the extension:
# Watch for changes and rebuild
npm run watch
# After making changes, restart coc
:CocRestartTroubleshooting
- LSP not starting: Check that the
debian.serverPathpoints to the correct executable - No completions: Verify the file is named
controlor is in adebian/directory - Extension not loading: Check
:CocList extensionsand look for any error messages
