Metadata-Version: 2.1
Name: hydra-lsp
Version: 0.1.3a1
Summary: Language server for Hydra YAML config files
Home-page: https://github.com/Retsediv/hydra-lsp
Keywords: ls,language-server,yaml,hydra
Author: Andrii Zhuravchak
Author-email: retsediv1@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: intervaltree (>=3.1.0,<4.0.0)
Requires-Dist: lsprotocol (>=2023.0.0b1,<2024.0.0)
Requires-Dist: pygls (>=1.1.1,<2.0.0)
Requires-Dist: pygtrie (>=2.5.0,<3.0.0)
Requires-Dist: pytest (>=7.4.2,<8.0.0)
Requires-Dist: ruamel-yaml (>=0.17.40,<0.18.0)
Description-Content-Type: text/markdown

# LSP for Hydra config files

## 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](https://github.com/retsediv/hydra-lsp-vscode).

```lua

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`)

