diff options
| author | William Boman <william@redwill.se> | 2022-01-23 18:27:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-23 18:27:15 +0100 |
| commit | 2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6 (patch) | |
| tree | bc039d80b539828cc6a3ef1fff3c9e53cbae59cf /lua/nvim-lsp-installer/installers | |
| parent | ui: update Cowth Vader message (diff) | |
| download | mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.tar mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.tar.gz mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.tar.bz2 mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.tar.lz mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.tar.xz mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.tar.zst mason-2c80c2ffbfd28e1e2eec4993ba6aea411a0a52d6.zip | |
add golangci_lint_ls (#441)
Diffstat (limited to 'lua/nvim-lsp-installer/installers')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/go.lua | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lua/nvim-lsp-installer/installers/go.lua b/lua/nvim-lsp-installer/installers/go.lua index d7857498..bfa7bc54 100644 --- a/lua/nvim-lsp-installer/installers/go.lua +++ b/lua/nvim-lsp-installer/installers/go.lua @@ -4,8 +4,8 @@ local process = require "nvim-lsp-installer.process" local M = {} ----@param package string The Go package to install. -function M.package(package) +---@param packages string[] The Go packages to install. The first item in this list will be the recipient of the server version, should the user request a specific one. +function M.packages(packages) return installers.pipe { std.ensure_executables { { "go", "go was not found in path, refer to https://golang.org/doc/install." } }, ---@type ServerInstallerFunction @@ -18,12 +18,20 @@ function M.package(package) stdio_sink = ctx.stdio_sink, } - ctx.receipt:with_primary_source(ctx.receipt.go(package)) + -- Install the head package + do + local head_package = packages[1] + ctx.receipt:with_primary_source(ctx.receipt.go(head_package)) + local version = ctx.requested_server_version or "latest" + c.run("go", { "install", "-v", ("%s@%s"):format(head_package, version) }) + end - local version = ctx.requested_server_version or "latest" - local pkg = ("%s@%s"):format(package, version) - - c.run("go", { "install", "-v", pkg }) + -- Install secondary packages + for i = 2, #packages do + local package = packages[i] + ctx.receipt:with_secondary_source(ctx.receipt.go(package)) + c.run("go", { "install", "-v", ("%s@latest"):format(package) }) + end c.spawn(callback) end, |
