requirements language server
Project description
requirements-language-server
Language server for requirements.txt.
- document hover: requires pip.
- completion: requires pip-cache.
Must
pip-cache update
before. - diagnostic: requires pip-compile.
Screenshots
Document Hover
Completion
Diagnostic
Usage
Vim/Neovim
coc.nvim
{
"languageserver": {
"requirements": {
"command": "requirements-language-server",
"filetypes": [
"requirements"
]
}
}
}
vim-lsp
if executable('requirements-language-server')
augroup lsp
autocmd!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'requirements',
\ 'cmd': {server_info->['requirements-language-server']},
\ 'whitelist': ['requirements'],
\ })
augroup END
endif
Neovim
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "requirements*.txt*" },
callback = function()
vim.lsp.start({
name = "requirements",
cmd = { "requirements-language-server" }
})
end,
})
Emacs
(make-lsp-client :new-connection
(lsp-stdio-connection
`(,(executable-find "requirements-language-server")))
:activation-fn (lsp-activate-on "requirements*.txt*")
:server-id "requirements")))
Sublime
{
"clients": {
"requirements": {
"command": [
"requirements-language-server"
],
"enabled": true,
"selector": "source.requirements"
}
}
}
Customization
You can customize the document hover template. A default template is here. The syntax rule is jinja. The template path is decided by your OS:
$ requirements-language-server --print-config template
/home/wzy/.config/pip/template.md.j2
You can generate cache by requirements-language-server --generate-cache
to
fasten document hover and completion. Every time you change template, the cache
must be regenerated.
$ requirements-language-server --print-config cache
/home/wzy/.cache/pip/pip.json
Related Projects
- requirements.txt.vim: syntax highlight for vim
- vim-polyglot: contains above
- bat: syntax highlight for less
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
File details
Details for the file requirements-language-server-0.0.2.tar.gz
.
File metadata
- Download URL: requirements-language-server-0.0.2.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d843f61887fe0cc5089148bb6ee597fd587b0befeb1b387f61e74f28627d101 |
|
MD5 | e9e72f3e83762e1a770647c79d7d4d8d |
|
BLAKE2b-256 | 34b29b7b8b9b6a237d7f053bc2d119d388cadf256ba926615bcd8e21b5574301 |
File details
Details for the file requirements_language_server-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: requirements_language_server-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a142ff77fc1d2c2b2552e42caedb8f51a8fddfa9cf538386e85a873cef7b735 |
|
MD5 | c0d16b87926633521d57f4ecd98939ee |
|
BLAKE2b-256 | dfde5a4ced91780f63db1be4025be55f4654283eaca5fec3fd3c884e1c6adc58 |