diff options
Diffstat (limited to 'lua/nvim-lsp-installer/servers')
39 files changed, 195 insertions, 85 deletions
diff --git a/lua/nvim-lsp-installer/servers/ansiblels/init.lua b/lua/nvim-lsp-installer/servers/ansiblels/init.lua index c7b55db9..6c0c6c73 100644 --- a/lua/nvim-lsp-installer/servers/ansiblels/init.lua +++ b/lua/nvim-lsp-installer/servers/ansiblels/init.lua @@ -2,6 +2,7 @@ local server = require "nvim-lsp-installer.server" local path = require "nvim-lsp-installer.path" local std = require "nvim-lsp-installer.installers.std" local npm = require "nvim-lsp-installer.installers.npm" +local context = require "nvim-lsp-installer.installers.context" return function(name, root_dir) return server.Server:new { @@ -15,6 +16,14 @@ return function(name, root_dir) npm.exec("npm", { "install" }), npm.run "compile", npm.exec("npm", { "install", "--production" }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source( + receipt.git_remote( + "https://github.com/ansible/ansible-language-server", + ctx.requested_server_version + ) + ) + end), }, default_options = { cmd = { "node", path.concat { root_dir, "out", "server", "src", "server.js" }, "--stdio" }, diff --git a/lua/nvim-lsp-installer/servers/arduino_language_server/init.lua b/lua/nvim-lsp-installer/servers/arduino_language_server/init.lua index 557b0ebe..4007803f 100644 --- a/lua/nvim-lsp-installer/servers/arduino_language_server/init.lua +++ b/lua/nvim-lsp-installer/servers/arduino_language_server/init.lua @@ -56,6 +56,9 @@ return function(name, root_dir) stdio_sink = ctx.stdio_sink, }, callback) end, + context.receipt(function(receipt, ctx) + receipt:with_secondary_source(receipt.github_release_file(ctx)) + end), } local arduino_language_server_installer = installers.branch_context { @@ -82,6 +85,9 @@ return function(name, root_dir) std.rename(("clangd_%s"):format(ctx.requested_server_version), "clangd"), } end), + context.receipt(function(receipt, ctx) + receipt:with_secondary_source(receipt.github_release_file(ctx)) + end), } return server.Server:new { diff --git a/lua/nvim-lsp-installer/servers/bicep/init.lua b/lua/nvim-lsp-installer/servers/bicep/init.lua index 1ebc6b1f..89770999 100644 --- a/lua/nvim-lsp-installer/servers/bicep/init.lua +++ b/lua/nvim-lsp-installer/servers/bicep/init.lua @@ -22,6 +22,9 @@ return function(name, root_dir) std.rename(path.concat { "vscode", "extension", "bicepLanguageServer" }, "langserver"), std.rmrf "vscode", context.set_working_dir "langserver", + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd = { "dotnet", path.concat { root_dir, "Bicep.LangServer.dll" } }, diff --git a/lua/nvim-lsp-installer/servers/ccls/init.lua b/lua/nvim-lsp-installer/servers/ccls/init.lua index 60a72a66..e77ae80b 100644 --- a/lua/nvim-lsp-installer/servers/ccls/init.lua +++ b/lua/nvim-lsp-installer/servers/ccls/init.lua @@ -98,6 +98,9 @@ return function(name, root_dir) ), } end), + context.receipt(function(receipt, ctx) + receipt:with_secondary_source(receipt.github_release_file(ctx)) + end), } end @@ -106,13 +109,13 @@ return function(name, root_dir) directory = "ccls-git", recursive = true, }), - function(server, callback, ctx) + function(srv, callback, ctx) local c = process.chain { cwd = path.concat { ctx.install_dir, "ccls-git" }, stdio_sink = ctx.stdio_sink, } - local clang_resource_dir = path.concat { server.root_dir, "clang-resource" } + local clang_resource_dir = path.concat { srv.root_dir, "clang-resource" } c.run( "cmake", @@ -131,6 +134,11 @@ return function(name, root_dir) c.spawn(callback) end, std.rmrf "ccls-git", + context.receipt(function(receipt, ctx) + receipt:with_primary_source( + receipt.git_remote("https://github.com/MaskRay/ccls", ctx.requested_server_version) + ) + end), } local linux_ccls_installer = installers.pipe { diff --git a/lua/nvim-lsp-installer/servers/clangd/init.lua b/lua/nvim-lsp-installer/servers/clangd/init.lua index 7aea65c3..e4e819b8 100644 --- a/lua/nvim-lsp-installer/servers/clangd/init.lua +++ b/lua/nvim-lsp-installer/servers/clangd/init.lua @@ -27,6 +27,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.rename(("clangd_%s"):format(ctx.requested_server_version), "clangd") end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua index c1c9cde4..5e13fa00 100644 --- a/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua +++ b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua @@ -24,6 +24,9 @@ return function(name, root_dir) return std.unzip_remote(ctx.github_release_file) end), std.chmod("+x", { "clojure-lsp" }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/codeqlls/init.lua b/lua/nvim-lsp-installer/servers/codeqlls/init.lua index 64d3a48a..9bb82d98 100644 --- a/lua/nvim-lsp-installer/servers/codeqlls/init.lua +++ b/lua/nvim-lsp-installer/servers/codeqlls/init.lua @@ -25,6 +25,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/csharp_ls/init.lua b/lua/nvim-lsp-installer/servers/csharp_ls/init.lua index b77030cf..82ad4258 100644 --- a/lua/nvim-lsp-installer/servers/csharp_ls/init.lua +++ b/lua/nvim-lsp-installer/servers/csharp_ls/init.lua @@ -1,6 +1,5 @@ local server = require "nvim-lsp-installer.server" -local process = require "nvim-lsp-installer.process" -local std = require "nvim-lsp-installer.installers.std" +local dotnet = require "nvim-lsp-installer.installers.dotnet" return function(name, root_dir) return server.Server:new { @@ -8,33 +7,9 @@ return function(name, root_dir) root_dir = root_dir, languages = { "c#" }, homepage = "https://github.com/razzmatazz/csharp-language-server", - installer = { - std.ensure_executables { - { - "dotnet", - "dotnet was not found in path. Refer to https://dotnet.microsoft.com/download for installation instructions.", - }, - }, - ---@type ServerInstallerFunction - function(_, callback, ctx) - process.spawn("dotnet", { - args = { "tool", "update", "--tool-path", ".", "csharp-ls" }, - cwd = ctx.install_dir, - stdio_sink = ctx.stdio_sink, - }, function(success) - if not success then - ctx.stdio_sink.stderr "Failed to install csharp-ls.\n" - callback(false) - else - callback(true) - end - end) - end, - }, + installer = dotnet.package "csharp-ls", default_options = { - cmd_env = { - PATH = process.extend_path { root_dir }, - }, + cmd_env = dotnet.env(root_dir), }, } end diff --git a/lua/nvim-lsp-installer/servers/dartls/init.lua b/lua/nvim-lsp-installer/servers/dartls/init.lua index 3990b9d9..433b5667 100644 --- a/lua/nvim-lsp-installer/servers/dartls/init.lua +++ b/lua/nvim-lsp-installer/servers/dartls/init.lua @@ -1,5 +1,6 @@ local server = require "nvim-lsp-installer.server" local std = require "nvim-lsp-installer.installers.std" +local context = require "nvim-lsp-installer.installers.context" return function(name, root_dir) return server.Server:new { @@ -7,11 +8,16 @@ return function(name, root_dir) root_dir = root_dir, homepage = "https://github.com/dart-lang/sdk", languages = { "dart" }, - installer = std.ensure_executables { - { - "dart", - "dart was not found in path. Refer to https://dart.dev/get-dart for installation instructions.", + installer = { + std.ensure_executables { + { + "dart", + "dart was not found in path. Refer to https://dart.dev/get-dart for installation instructions.", + }, }, + context.receipt(function(receipt) + receipt:with_primary_source(receipt.system "dart") + end), }, default_options = {}, } diff --git a/lua/nvim-lsp-installer/servers/denols/init.lua b/lua/nvim-lsp-installer/servers/denols/init.lua index ae1a856c..dfd0ab2a 100644 --- a/lua/nvim-lsp-installer/servers/denols/init.lua +++ b/lua/nvim-lsp-installer/servers/denols/init.lua @@ -31,6 +31,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/elixirls/init.lua b/lua/nvim-lsp-installer/servers/elixirls/init.lua index e0f638ea..7a8f8bea 100644 --- a/lua/nvim-lsp-installer/servers/elixirls/init.lua +++ b/lua/nvim-lsp-installer/servers/elixirls/init.lua @@ -16,6 +16,9 @@ return function(name, root_dir) return std.unzip_remote(ctx.github_release_file, "elixir-ls") end), std.chmod("+x", { "elixir-ls/language_server.sh" }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd = { diff --git a/lua/nvim-lsp-installer/servers/erlangls/init.lua b/lua/nvim-lsp-installer/servers/erlangls/init.lua index 787fee0b..749a57b0 100644 --- a/lua/nvim-lsp-installer/servers/erlangls/init.lua +++ b/lua/nvim-lsp-installer/servers/erlangls/init.lua @@ -17,7 +17,7 @@ return function(name, root_dir) std.ensure_executables { { rebar3, ("%s was not found in path. Refer to http://rebar3.org/docs/."):format(rebar3) }, }, - context.use_github_release "erlang-ls/erlang_ls", + context.use_github_latest_tag "erlang-ls/erlang_ls", std.git_clone "https://github.com/erlang-ls/erlang_ls.git", function(_, callback, ctx) local c = process.chain { @@ -28,6 +28,9 @@ return function(name, root_dir) c.run(rebar3, { "as", "dap", "escriptize" }) c.spawn(callback) end, + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_tag(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua b/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua index a14a7286..cd1284e7 100644 --- a/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua +++ b/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua @@ -1,6 +1,5 @@ local server = require "nvim-lsp-installer.server" -local process = require "nvim-lsp-installer.process" -local std = require "nvim-lsp-installer.installers.std" +local dotnet = require "nvim-lsp-installer.installers.dotnet" return function(name, root_dir) return server.Server:new { @@ -8,33 +7,9 @@ return function(name, root_dir) root_dir = root_dir, languages = { "f#" }, homepage = "https://github.com/fsharp/FsAutoComplete", - installer = { - std.ensure_executables { - { - "dotnet", - "dotnet was not found in path. Refer to https://dotnet.microsoft.com/download for installation instructions.", - }, - }, - ---@type ServerInstallerFunction - function(_, callback, ctx) - process.spawn("dotnet", { - args = { "tool", "update", "--tool-path", ".", "fsautocomplete" }, - cwd = ctx.install_dir, - stdio_sink = ctx.stdio_sink, - }, function(success) - if not success then - ctx.stdio_sink.stderr "Failed to install fsautocomplete.\n" - callback(false) - else - callback(true) - end - end) - end, - }, + installer = dotnet.package "fsautocomplete", default_options = { - cmd_env = { - PATH = process.extend_path { root_dir }, - }, + cmd_env = dotnet.env(root_dir), }, } end diff --git a/lua/nvim-lsp-installer/servers/groovyls/init.lua b/lua/nvim-lsp-installer/servers/groovyls/init.lua index 5d55dc29..becc1dd7 100644 --- a/lua/nvim-lsp-installer/servers/groovyls/init.lua +++ b/lua/nvim-lsp-installer/servers/groovyls/init.lua @@ -16,6 +16,14 @@ return function(name, root_dir) std.gradlew { args = { "build" }, }, + context.receipt(function(receipt, ctx) + receipt:with_primary_source( + receipt.git_remote( + "https://github.com/GroovyLanguageServer/groovy-language-server", + ctx.requested_server_version + ) + ) + end), }, default_options = { cmd = { "java", "-jar", path.concat { root_dir, "build", "libs", "groovyls-all.jar" } }, diff --git a/lua/nvim-lsp-installer/servers/hls/init.lua b/lua/nvim-lsp-installer/servers/hls/init.lua index d1987b22..a5966045 100644 --- a/lua/nvim-lsp-installer/servers/hls/init.lua +++ b/lua/nvim-lsp-installer/servers/hls/init.lua @@ -28,6 +28,9 @@ return function(name, root_dir) -- we can't use std.chmod because of shell wildcard expansion unix = shell.sh [[ chmod +x haskell* ]], }, + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/jdtls/init.lua b/lua/nvim-lsp-installer/servers/jdtls/init.lua index 4f3779b6..ddc00c26 100644 --- a/lua/nvim-lsp-installer/servers/jdtls/init.lua +++ b/lua/nvim-lsp-installer/servers/jdtls/init.lua @@ -4,6 +4,7 @@ local std = require "nvim-lsp-installer.installers.std" local context = require "nvim-lsp-installer.installers.context" local platform = require "nvim-lsp-installer.platform" local Data = require "nvim-lsp-installer.data" +local fetch = require "nvim-lsp-installer.core.fetch" return function(name, root_dir) local function get_cmd(workspace_name) @@ -49,13 +50,38 @@ return function(name, root_dir) languages = { "java" }, homepage = "https://github.com/eclipse/eclipse.jdt.ls", installer = { + ---@type ServerInstallerFunction + function(_, callback, ctx) + if ctx.requested_server_version then + callback(true) + return + end + fetch("https://download.eclipse.org/jdtls/snapshots/latest.txt", function(err, data) + if err then + ctx.stdio_sink.stderr "Failed to fetch latest verison.\n" + callback(false) + else + ctx.requested_server_version = vim.trim(data) + :gsub("^jdt%-language%-server%-", "") + :gsub("%.tar%.gz$", "") + callback(true) + end + end) + end, context.capture(function(ctx) - local version = ctx.requested_server_version or "latest" return std.untargz_remote( - ("https://download.eclipse.org/jdtls/snapshots/jdt-language-server-%s.tar.gz"):format(version) + ("https://download.eclipse.org/jdtls/snapshots/jdt-language-server-%s.tar.gz"):format( + ctx.requested_server_version + ) ) end), std.download_file("https://projectlombok.org/downloads/lombok.jar", "lombok.jar"), + context.receipt(function(receipt, ctx) + receipt:with_primary_source { + type = "jdtls", + version = ctx.requested_server_version, + } + end), }, default_options = { cmd = get_cmd(vim.env.WORKSPACE and vim.env.WORKSPACE or path.concat { vim.env.HOME, "workspace" }), diff --git a/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua b/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua index 2d70c2b3..4909b56d 100644 --- a/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua +++ b/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua @@ -15,6 +15,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/lemminx/init.lua b/lua/nvim-lsp-installer/servers/lemminx/init.lua index eedce082..72891a1e 100644 --- a/lua/nvim-lsp-installer/servers/lemminx/init.lua +++ b/lua/nvim-lsp-installer/servers/lemminx/init.lua @@ -45,6 +45,9 @@ return function(name, root_dir) platform.is_win and ("%s.exe"):format(unzipped_file) or unzipped_file, platform.is_win and "lemminx.exe" or "lemminx" ), + context.receipt(function(receipt) + receipt:with_primary_source(receipt.unmanaged) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/ltex/init.lua b/lua/nvim-lsp-installer/servers/ltex/init.lua index 3cb8259f..5eb10dc0 100644 --- a/lua/nvim-lsp-installer/servers/ltex/init.lua +++ b/lua/nvim-lsp-installer/servers/ltex/init.lua @@ -32,6 +32,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.rename(("ltex-ls-%s"):format(ctx.requested_server_version), "ltex-ls") end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/omnisharp/init.lua b/lua/nvim-lsp-installer/servers/omnisharp/init.lua index 3ee13a9f..7d4279b1 100644 --- a/lua/nvim-lsp-installer/servers/omnisharp/init.lua +++ b/lua/nvim-lsp-installer/servers/omnisharp/init.lua @@ -32,6 +32,9 @@ return function(name, root_dir) return std.unzip_remote(ctx.github_release_file, "omnisharp") end), std.chmod("+x", { "omnisharp/run" }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd = { diff --git a/lua/nvim-lsp-installer/servers/phpactor/init.lua b/lua/nvim-lsp-installer/servers/phpactor/init.lua index d48f9a2b..42ef65f6 100644 --- a/lua/nvim-lsp-installer/servers/phpactor/init.lua +++ b/lua/nvim-lsp-installer/servers/phpactor/init.lua @@ -3,6 +3,7 @@ local path = require "nvim-lsp-installer.path" local server = require "nvim-lsp-installer.server" local composer = require "nvim-lsp-installer.installers.composer" local std = require "nvim-lsp-installer.installers.std" +local context = require "nvim-lsp-installer.installers.context" local process = require "nvim-lsp-installer.process" return function(name, root_dir) @@ -15,6 +16,11 @@ return function(name, root_dir) unix = { std.git_clone "https://github.com/phpactor/phpactor.git", composer.install(), + context.receipt(function(receipt, ctx) + receipt:with_primary_source( + receipt.git_remote("https://github.com/phpactor/phpactor.git", ctx.requested_server_version) + ) + end), }, }, default_options = { diff --git a/lua/nvim-lsp-installer/servers/powershell_es/init.lua b/lua/nvim-lsp-installer/servers/powershell_es/init.lua index f95ebcf0..35facc2d 100644 --- a/lua/nvim-lsp-installer/servers/powershell_es/init.lua +++ b/lua/nvim-lsp-installer/servers/powershell_es/init.lua @@ -20,6 +20,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { bundle_path = path.concat { root_dir }, diff --git a/lua/nvim-lsp-installer/servers/puppet/init.lua b/lua/nvim-lsp-installer/servers/puppet/init.lua index 759fefe1..09842f30 100644 --- a/lua/nvim-lsp-installer/servers/puppet/init.lua +++ b/lua/nvim-lsp-installer/servers/puppet/init.lua @@ -16,6 +16,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua b/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua index 4944f8bf..1f292ae9 100644 --- a/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua +++ b/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua @@ -42,19 +42,22 @@ return function(name, root_dir) homepage = "https://quick-lint-js.com/", languages = { "javascript" }, installer = { + context.use_github_latest_tag "quick-lint/quick-lint-js", context.capture(function(ctx) - local requested_server_version = coalesce(ctx.requested_server_version, "latest") local url = "https://c.quick-lint-js.com/releases/%s/manual/%s" if platform.is_windows then - return std.unzip_remote(url:format(requested_server_version, release_file)) + return std.unzip_remote(url:format(ctx.requested_server_version, release_file)) else - return std.untargz_remote(url:format(requested_server_version, release_file)) + return std.untargz_remote(url:format(ctx.requested_server_version, release_file)) end end), installers.on { unix = context.set_working_dir "quick-lint-js", }, + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_tag(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/rescriptls/init.lua b/lua/nvim-lsp-installer/servers/rescriptls/init.lua index 5717c208..4f0e7865 100644 --- a/lua/nvim-lsp-installer/servers/rescriptls/init.lua +++ b/lua/nvim-lsp-installer/servers/rescriptls/init.lua @@ -16,6 +16,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd = { "node", path.concat { root_dir, "extension", "server", "out", "server.js" }, "--stdio" }, diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua index 5611dca3..b2c8f7b8 100644 --- a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua +++ b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua @@ -46,6 +46,9 @@ return function(name, root_dir) ) end), std.chmod("+x", { "rust-analyzer" }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/serve_d/init.lua b/lua/nvim-lsp-installer/servers/serve_d/init.lua index 36dba64a..092cbada 100644 --- a/lua/nvim-lsp-installer/servers/serve_d/init.lua +++ b/lua/nvim-lsp-installer/servers/serve_d/init.lua @@ -26,6 +26,9 @@ return function(name, root_dir) return std.untarxz_remote(ctx.github_release_file) end end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/solang/init.lua b/lua/nvim-lsp-installer/servers/solang/init.lua index 794c4edb..c46c90f0 100644 --- a/lua/nvim-lsp-installer/servers/solang/init.lua +++ b/lua/nvim-lsp-installer/servers/solang/init.lua @@ -24,6 +24,9 @@ return function(name, root_dir) return std.download_file(ctx.github_release_file, platform.is_win and "solang.exe" or "solang") end), std.chmod("+x", { "solang" }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), } local llvm_installer = installers.pipe { diff --git a/lua/nvim-lsp-installer/servers/solc/init.lua b/lua/nvim-lsp-installer/servers/solc/init.lua index dd04f592..bdd2b331 100644 --- a/lua/nvim-lsp-installer/servers/solc/init.lua +++ b/lua/nvim-lsp-installer/servers/solc/init.lua @@ -9,28 +9,27 @@ local coalesce, when = Data.coalesce, Data.when return function(name, root_dir) local bin_name = platform.is_win and "solc.exe" or "solc" - return server.Server:new { name = name, root_dir = root_dir, homepage = "https://github.com/ethereum/solidity", languages = { "solidity" }, installer = { - context.capture(function(ctx) - local file_template = coalesce( - when(platform.is_mac, "macosx-amd64/solc-macosx-amd64-%s"), - when(platform.is_linux and platform.arch == "x64", "linux-amd64/solc-linux-amd64-%s"), - when(platform.is_win and platform.arch == "x64", "windows-amd64/solc-windows-amd64-%s.exe") + context.use_github_release_file( + "ethereum/solidity", + coalesce( + when(platform.is_mac, "solc-macos"), + when(platform.is_linux, "solc-static-linux"), + when(platform.is_win, "solc-windows.exe") ) - if not file_template then - error( - ("Current operating system and/or arch (%q) is currently not supported."):format(platform.arch) - ) - end - file_template = file_template:format(coalesce(ctx.requested_server_version, "latest")) - return std.download_file(("https://binaries.soliditylang.org/%s"):format(file_template), bin_name) + ), + context.capture(function(ctx) + return std.download_file(ctx.github_release_file, bin_name) end), std.chmod("+x", { bin_name }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/sourcekit/init.lua b/lua/nvim-lsp-installer/servers/sourcekit/init.lua index 46fb008c..b7f3d3a1 100644 --- a/lua/nvim-lsp-installer/servers/sourcekit/init.lua +++ b/lua/nvim-lsp-installer/servers/sourcekit/init.lua @@ -1,5 +1,6 @@ local server = require "nvim-lsp-installer.server" local std = require "nvim-lsp-installer.installers.std" +local context = require "nvim-lsp-installer.installers.context" return function(name, root_dir) return server.Server:new { @@ -7,11 +8,16 @@ return function(name, root_dir) root_dir = root_dir, homepage = "https://github.com/apple/sourcekit-lsp", languages = { "swift" }, - installer = std.ensure_executables { - { - "sourcekit-lsp", - "sourcekit-lsp was not found in path. Refer to https://github.com/apple/sourcekit-lsp for installation instructions.", + installer = { + std.ensure_executables { + { + "sourcekit-lsp", + "sourcekit-lsp was not found in path. Refer to https://github.com/apple/sourcekit-lsp for installation instructions.", + }, }, + context.receipt(function(receipt) + receipt:with_primary_source(receipt.system "sourcekit-lsp") + end), }, default_options = {}, } diff --git a/lua/nvim-lsp-installer/servers/spectral/init.lua b/lua/nvim-lsp-installer/servers/spectral/init.lua index 0c46be10..28a09274 100644 --- a/lua/nvim-lsp-installer/servers/spectral/init.lua +++ b/lua/nvim-lsp-installer/servers/spectral/init.lua @@ -20,6 +20,9 @@ return function(name, root_dir) }, installers.always_succeed(npm.run "compile"), context.set_working_dir "server", + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd = { "node", path.concat { root_dir, "out", "server.js" }, "--stdio" }, diff --git a/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua b/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua index 1d562bb4..8294ae9d 100644 --- a/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua +++ b/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua @@ -39,6 +39,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/taplo/init.lua b/lua/nvim-lsp-installer/servers/taplo/init.lua index c9e405bb..b1bedb17 100644 --- a/lua/nvim-lsp-installer/servers/taplo/init.lua +++ b/lua/nvim-lsp-installer/servers/taplo/init.lua @@ -32,6 +32,11 @@ return function(name, root_dir) win = std.unzip_remote(ctx.github_release_file), } end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx, { + tag_name_pattern = "^release%-lsp%-", + })) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/terraformls/init.lua b/lua/nvim-lsp-installer/servers/terraformls/init.lua index 4e4c5bea..8bcb7f32 100644 --- a/lua/nvim-lsp-installer/servers/terraformls/init.lua +++ b/lua/nvim-lsp-installer/servers/terraformls/init.lua @@ -38,6 +38,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file, "terraform-ls") end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/texlab/init.lua b/lua/nvim-lsp-installer/servers/texlab/init.lua index 2379c5c0..4b1e02c9 100644 --- a/lua/nvim-lsp-installer/servers/texlab/init.lua +++ b/lua/nvim-lsp-installer/servers/texlab/init.lua @@ -29,6 +29,9 @@ return function(name, root_dir) win = std.unzip_remote(ctx.github_release_file), } end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/tflint/init.lua b/lua/nvim-lsp-installer/servers/tflint/init.lua index 8a6f987e..125afa86 100644 --- a/lua/nvim-lsp-installer/servers/tflint/init.lua +++ b/lua/nvim-lsp-installer/servers/tflint/init.lua @@ -28,6 +28,9 @@ return function(name, root_dir) context.capture(function(ctx) return std.unzip_remote(ctx.github_release_file) end), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/vala_ls/init.lua b/lua/nvim-lsp-installer/servers/vala_ls/init.lua index 8503579e..b3e51431 100644 --- a/lua/nvim-lsp-installer/servers/vala_ls/init.lua +++ b/lua/nvim-lsp-installer/servers/vala_ls/init.lua @@ -41,6 +41,9 @@ return function(name, root_dir) c.spawn(callback) end, std.rmrf "vala-language-server", + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/zk/init.lua b/lua/nvim-lsp-installer/servers/zk/init.lua index e8ea645a..02a416bf 100644 --- a/lua/nvim-lsp-installer/servers/zk/init.lua +++ b/lua/nvim-lsp-installer/servers/zk/init.lua @@ -51,6 +51,9 @@ return function(name, root_dir) return std.untargz_remote(ctx.github_release_file) end) )), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { diff --git a/lua/nvim-lsp-installer/servers/zls/init.lua b/lua/nvim-lsp-installer/servers/zls/init.lua index 98409640..21d52239 100644 --- a/lua/nvim-lsp-installer/servers/zls/init.lua +++ b/lua/nvim-lsp-installer/servers/zls/init.lua @@ -33,6 +33,9 @@ return function(name, root_dir) end), std.rename("bin", "package"), std.chmod("+x", { path.concat { "package", "zls" } }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { |
