Skip to main content

requirements language server

Project description

requirements-language-server

readthedocs pre-commit.ci status github/workflow codecov DeepSource

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

pypi/status pypi/v pypi/downloads pypi/format pypi/implementation pypi/pyversions

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

module

option

Completion

module

option

file

Diagnostic

module

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

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

requirements-language-server-0.0.2.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file requirements-language-server-0.0.2.tar.gz.

File metadata

File hashes

Hashes for requirements-language-server-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2d843f61887fe0cc5089148bb6ee597fd587b0befeb1b387f61e74f28627d101
MD5 e9e72f3e83762e1a770647c79d7d4d8d
BLAKE2b-256 34b29b7b8b9b6a237d7f053bc2d119d388cadf256ba926615bcd8e21b5574301

See more details on using hashes here.

File details

Details for the file requirements_language_server-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for requirements_language_server-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a142ff77fc1d2c2b2552e42caedb8f51a8fddfa9cf538386e85a873cef7b735
MD5 c0d16b87926633521d57f4ecd98939ee
BLAKE2b-256 dfde5a4ced91780f63db1be4025be55f4654283eaca5fec3fd3c884e1c6adc58

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