Skip to main content

Language server for Hydra YAML config files

Project description

LSP for Hydra config files

Installation

  1. Using pypi: pip install hydra-lsp

  2. Using poetry: poetry install

How to use

To try it out, use the following code snippet in neovim.

Note: If you are VS Code user - check out the extension.

local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

local on_attach = function(client, bufnr)
    local nmap = function(keys, func, desc)
        desc = "LSP: " .. desc
        vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc, noremap = true })
    end

    nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
    nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
    nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
    nmap("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation")
    nmap("K", vim.lsp.buf.hover, "Hover Documentation")
    nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")

    nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
    nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
end

if not configs.hydralsp then
    configs.hydralsp = {
        default_config = {
            cmd = { "hydra-lsp" },
            root_dir = lspconfig.util.root_pattern(".git"),
            filetypes = { "yaml" },
        },
    }
end

lspconfig.hydralsp.setup({
    on_attach = lsp.on_attach,
})

Note: make sure to install hydra-lsp so that nvim can find an executable (poetry install)

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

hydra_lsp-0.1.3.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hydra_lsp-0.1.3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file hydra_lsp-0.1.3.tar.gz.

File metadata

  • Download URL: hydra_lsp-0.1.3.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.6-76060506-generic

File hashes

Hashes for hydra_lsp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5ad3b2d636cb25c1e63289814d5c707b287a5229155f59bad2b953065314b440
MD5 315a31bc17b08ae758c8164b816f5785
BLAKE2b-256 b0af4b88bbe11d14c6c06a4603945638ccca68291ad57207b6e14da3a067470f

See more details on using hashes here.

File details

Details for the file hydra_lsp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: hydra_lsp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.6-76060506-generic

File hashes

Hashes for hydra_lsp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e212170606c99c07df876b03fb875f2be35bd6b8d0cb60277ece5212228e723
MD5 3e326cf3a2a94fcc0caae105f080eb8e
BLAKE2b-256 643d568277f6264668f552a0ec16639f54bb02325e1a6d6f01e2c5aa82ee5536

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page