aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/lspconfig/jsonnet_ls.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/lua/lspconfig/jsonnet_ls.lua b/lua/lspconfig/jsonnet_ls.lua
new file mode 100644
index 00000000..d467429b
--- /dev/null
+++ b/lua/lspconfig/jsonnet_ls.lua
@@ -0,0 +1,22 @@
+local configs = require 'lspconfig/configs'
+local util = require 'lspconfig/util'
+
+configs.jsonnet_ls = {
+ default_config = {
+ cmd = { 'jsonnet-language-server' },
+ filetypes = { 'jsonnet', 'libsonnet' },
+ root_dir = function(fname)
+ return util.root_pattern 'jsonnetfile.json'(fname) or util.find_git_ancestor(fname)
+ end,
+ },
+ docs = {
+ description = [[
+https://github.com/jdbaldry/jsonnet-language-server
+
+A Language Server Protocol (LSP) server for Jsonnet.
+]],
+ default_config = {
+ root_dir = [[root_pattern("jsonnetfile.json")]],
+ },
+ },
+}