mirror of
https://github.com/neovim/nvim-lspconfig.git
synced 2025-12-25 15:31:05 +01:00
23 lines
537 B
Lua
23 lines
537 B
Lua
---@brief
|
|
---
|
|
--- https://github.com/kitagry/regols
|
|
---
|
|
--- OPA Rego language server.
|
|
---
|
|
--- `regols` can be installed by running:
|
|
--- ```sh
|
|
--- go install github.com/kitagry/regols@latest
|
|
--- ```
|
|
|
|
local util = require 'lspconfig.util'
|
|
|
|
---@type vim.lsp.Config
|
|
return {
|
|
cmd = { 'regols' },
|
|
filetypes = { 'rego' },
|
|
root_dir = function(bufnr, on_dir)
|
|
local fname = vim.api.nvim_buf_get_name(bufnr)
|
|
on_dir(util.root_pattern '*.rego'(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]))
|
|
end,
|
|
}
|