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.1.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for requirements-language-server-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5210ec832a25d0a0a72178916b00ff287bf6a8f22f46d16bef3af9383d009d0d
MD5 29715d287e87a01cd7a913b37dac5637
BLAKE2b-256 67392e9268f689f3c8ab1b80c822d79cb8a698de9f6eba3b842e8a0ddccf9bb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requirements_language_server-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60bc5753442d6f8b1048ebfd5b7db05f55e1d488c3d08e473fe199d92ca9aa66
MD5 bb7d32959916161f6b89667d962581c0
BLAKE2b-256 99e1864139fde5f2c6829e392d0a82a379fed14d2a73a60d7307914cb396fdd6

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