aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-01-29 18:03:44 +0100
committerGitHub <noreply@github.com>2022-01-29 18:03:44 +0100
commitc2bde3911892a51323219f7cfc9bb50b49afd29f (patch)
tree3ff017cde60b4ada34351171b7e3c745acc340aa /lua
parentactions: simplify run-autogen workflow (diff)
downloadmason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.gz
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.bz2
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.lz
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.xz
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.zst
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.zip
add nickel_ls (#452)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/_generated/filetype_map.lua2
-rw-r--r--lua/nvim-lsp-installer/_generated/metadata.lua3
-rw-r--r--lua/nvim-lsp-installer/_generated/schemas/nickel_ls.lua3
-rw-r--r--lua/nvim-lsp-installer/installers/cargo.lua17
-rw-r--r--lua/nvim-lsp-installer/servers/init.lua1
-rw-r--r--lua/nvim-lsp-installer/servers/nickel_ls/init.lua26
6 files changed, 52 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/_generated/filetype_map.lua b/lua/nvim-lsp-installer/_generated/filetype_map.lua
index eb8ad20d..b1b7ad22 100644
--- a/lua/nvim-lsp-installer/_generated/filetype_map.lua
+++ b/lua/nvim-lsp-installer/_generated/filetype_map.lua
@@ -74,6 +74,8 @@ return {
mdx = { "tailwindcss" },
mustache = { "tailwindcss" },
mysql = { "sqlls", "sqls" },
+ ncl = { "nickel_ls" },
+ nickel = { "nickel_ls" },
nim = { "nimls" },
nix = { "rnix" },
njk = { "tailwindcss" },
diff --git a/lua/nvim-lsp-installer/_generated/metadata.lua b/lua/nvim-lsp-installer/_generated/metadata.lua
index 4c12d7dd..89734d6a 100644
--- a/lua/nvim-lsp-installer/_generated/metadata.lua
+++ b/lua/nvim-lsp-installer/_generated/metadata.lua
@@ -157,6 +157,9 @@ return {
ltex = {
filetypes = { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex" }
},
+ nickel_ls = {
+ filetypes = { "ncl", "nickel" }
+ },
nimls = {
filetypes = { "nim" }
},
diff --git a/lua/nvim-lsp-installer/_generated/schemas/nickel_ls.lua b/lua/nvim-lsp-installer/_generated/schemas/nickel_ls.lua
new file mode 100644
index 00000000..c18af1a6
--- /dev/null
+++ b/lua/nvim-lsp-installer/_generated/schemas/nickel_ls.lua
@@ -0,0 +1,3 @@
+-- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY.
+-- stylua: ignore start
+return {properties = {["nls.server.debugLog"] = {default = false,description = "Logs the communication between VS Code and the language server.",scope = "window",type = "boolean"},["nls.server.path"] = {default = "nls",description = "Path to nickel language server",scope = "window",type = "string"},["nls.server.trace"] = {description = "Enables performance tracing to the given file",scope = "window",type = "string"}},title = "Nickel Language Server Configuration",type = "object"} \ No newline at end of file
diff --git a/lua/nvim-lsp-installer/installers/cargo.lua b/lua/nvim-lsp-installer/installers/cargo.lua
index fe48404e..c4f11854 100644
--- a/lua/nvim-lsp-installer/installers/cargo.lua
+++ b/lua/nvim-lsp-installer/installers/cargo.lua
@@ -21,8 +21,25 @@ function M.crate(crate, opts)
ctx.receipt:with_primary_source(ctx.receipt.cargo(crate))
process.spawn("cargo", {
+ args = args,
cwd = ctx.install_dir,
+ stdio_sink = ctx.stdio_sink,
+ }, callback)
+ end
+end
+
+---@param opts {path:string|nil}
+function M.install(opts)
+ ---@type ServerInstallerFunction
+ return function(_, callback, ctx)
+ opts = opts or {}
+ local args = { "install", "--root", "." }
+ if opts.path then
+ vim.list_extend(args, { "--path", opts.path })
+ end
+ process.spawn("cargo", {
args = args,
+ cwd = ctx.install_dir,
stdio_sink = ctx.stdio_sink,
}, callback)
end
diff --git a/lua/nvim-lsp-installer/servers/init.lua b/lua/nvim-lsp-installer/servers/init.lua
index fda0c03a..442e31b2 100644
--- a/lua/nvim-lsp-installer/servers/init.lua
+++ b/lua/nvim-lsp-installer/servers/init.lua
@@ -83,6 +83,7 @@ local CORE_SERVERS = Data.set_of {
"lelwel_ls",
"lemminx",
"ltex",
+ "nickel_ls",
"nimls",
"ocamlls",
"omnisharp",
diff --git a/lua/nvim-lsp-installer/servers/nickel_ls/init.lua b/lua/nvim-lsp-installer/servers/nickel_ls/init.lua
new file mode 100644
index 00000000..d87062e7
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/nickel_ls/init.lua
@@ -0,0 +1,26 @@
+local path = require "nvim-lsp-installer.path"
+local server = require "nvim-lsp-installer.server"
+local std = require "nvim-lsp-installer.installers.std"
+local context = require "nvim-lsp-installer.installers.context"
+local cargo = require "nvim-lsp-installer.installers.cargo"
+
+return function(name, root_dir)
+ return server.Server:new {
+ name = name,
+ root_dir = root_dir,
+ homepage = "https://nickel-lang.org/",
+ languages = { "nickel" },
+ installer = {
+ std.git_clone "https://github.com/tweag/nickel",
+ cargo.install {
+ path = path.concat { "lsp", "nls" },
+ },
+ context.receipt(function(receipt)
+ receipt:with_primary_source(receipt.git_remote "https://github.com/tweag/nickel")
+ end),
+ },
+ default_options = {
+ cmd_env = cargo.env(root_dir),
+ },
+ }
+end