aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorZach Leslie <zach.leslie@grafana.com>2021-11-15 02:11:52 -0700
committerGitHub <noreply@github.com>2021-11-15 01:11:52 -0800
commitc7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d (patch)
treeba3220f909be3e5f98ae351095443361f9fe4a0d /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.tar
nvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.tar.gz
nvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.tar.bz2
nvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.tar.lz
nvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.tar.xz
nvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.tar.zst
nvim-lspconfig-c7bf7d4bf9065c6f01edb325c6e8dcfa732ebb3d.zip
feat: add jsonnet-language-server (#1372)
Diffstat (limited to 'lua')
-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")]],
+ },
+ },
+}