From f3a106bee2d00ebe0e81477f4c7d8d9a1cae7502 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Sat, 16 Mar 2024 07:02:47 +0000 Subject: feat: add regal (#3071) --- lua/lspconfig/server_configurations/regal.lua | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lua/lspconfig/server_configurations/regal.lua (limited to 'lua') 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, + }, + }, +} -- cgit v1.2.3-70-g09d2