aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorHoang Nguyen <folliekazetani@protonmail.com>2024-03-16 07:02:47 +0000
committerGitHub <noreply@github.com>2024-03-16 15:02:47 +0800
commitf3a106bee2d00ebe0e81477f4c7d8d9a1cae7502 (patch)
treea3572daa2b054380261576e4d3327f5cec736548 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.tar
nvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.tar.gz
nvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.tar.bz2
nvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.tar.lz
nvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.tar.xz
nvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.tar.zst
nvim-lspconfig-f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502.zip
feat: add regal (#3071)
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/regal.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/regal.lua b/lua/lspconfig/server_configurations/regal.lua
new file mode 100644
index 00000000..24ec0928
--- /dev/null
+++ b/lua/lspconfig/server_configurations/regal.lua
@@ -0,0 +1,28 @@
+local util = require 'lspconfig.util'
+
+return {
+ default_config = {
+ cmd = { 'regal', 'language-server' },
+ filetypes = { 'rego' },
+ root_dir = function(fname)
+ return util.root_pattern '*.rego'(fname) or util.find_git_ancestor(fname)
+ end,
+ single_file_support = true,
+ },
+ docs = {
+ description = [[
+https://github.com/StyraInc/regal
+
+A linter for Rego, with support for running as an LSP server.
+
+`regal` can be installed by running:
+```sh
+go install github.com/StyraInc/regal@latest
+```
+ ]],
+ default_config = {
+ root_dir = [[root_pattern("*.rego", ".git")]],
+ single_file_support = true,
+ },
+ },
+}