aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig
diff options
context:
space:
mode:
authorAlex Efros <powerman@powerman.name>2025-08-06 05:03:23 +0300
committerGitHub <noreply@github.com>2025-08-05 19:03:23 -0700
commit9141be4c1332afc83bdf1b0278dbb030f75ff8e3 (patch)
tree48d64341b1696ba2f94116416472f6feb8c2572b /lua/lspconfig
parentfix(vue_ls): correctly check if ts_clients exist #3987 (diff)
downloadnvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.tar
nvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.tar.gz
nvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.tar.bz2
nvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.tar.lz
nvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.tar.xz
nvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.tar.zst
nvim-lspconfig-9141be4c1332afc83bdf1b0278dbb030f75ff8e3.zip
fix(golangci_lint_ls): support v2 wrapper script #3984
Diffstat (limited to 'lua/lspconfig')
-rw-r--r--lua/lspconfig/configs/golangci_lint_ls.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lspconfig/configs/golangci_lint_ls.lua b/lua/lspconfig/configs/golangci_lint_ls.lua
index 14fd666b..d6c4df88 100644
--- a/lua/lspconfig/configs/golangci_lint_ls.lua
+++ b/lua/lspconfig/configs/golangci_lint_ls.lua
@@ -21,14 +21,16 @@ return {
before_init = function(_, config)
-- Add support for golangci-lint V1 (in V2 `--out-format=json` was replaced by
-- `--output.json.path=stdout`).
- local v1
+ local v1, v2 = false, false
-- PERF: `golangci-lint version` is very slow (about 0.1 sec) so let's find
-- version using `go version -m $(which golangci-lint) | grep '^\smod'`.
if vim.fn.executable 'go' == 1 then
local exe = vim.fn.exepath 'golangci-lint'
local version = vim.system({ 'go', 'version', '-m', exe }):wait()
v1 = string.match(version.stdout, '\tmod\tgithub.com/golangci/golangci%-lint\t')
- else
+ v2 = string.match(version.stdout, '\tmod\tgithub.com/golangci/golangci%-lint/v2\t')
+ end
+ if not v1 and not v2 then
local version = vim.system({ 'golangci-lint', 'version' }):wait()
v1 = string.match(version.stdout, 'version v?1%.')
end