update none-ls

This commit is contained in:
Walter Jenkins 2025-09-09 10:05:56 -05:00
parent 553935a90b
commit bd3bcb33de
2 changed files with 17 additions and 16 deletions

View File

@ -17,6 +17,16 @@ return {
return util.root_pattern("go.work", "go.mod", ".git")(fname) return util.root_pattern("go.work", "go.mod", ".git")(fname)
or util.path.dirname(fname) or util.path.dirname(fname)
end, end,
handlers = {
-- Suppress signature help errors that are common with incomplete Go code
["textDocument/signatureHelp"] = function(err, result, ctx, config)
if err and string.find(err.message, "cannot get type") then
-- Silently ignore "cannot get type" errors for signature help
return nil
end
return vim.lsp.handlers["textDocument/signatureHelp"](err, result, ctx, config)
end,
},
settings = { settings = {
gopls = { gopls = {
gofumpt = true, gofumpt = true,
@ -54,6 +64,8 @@ return {
-- Performance optimizations for large repositories -- Performance optimizations for large repositories
memoryMode = "DegradeClosed", memoryMode = "DegradeClosed",
symbolMatcher = "FastFuzzy", symbolMatcher = "FastFuzzy",
-- Reduce signature help noise
["ui.completion.experimentalPostfixCompletions"] = false,
}, },
}, },
}) })

View File

@ -3,27 +3,16 @@ return {
'nvimtools/none-ls.nvim', 'nvimtools/none-ls.nvim',
dependencies = { dependencies = {
'nvimtools/none-ls-extras.nvim', 'nvimtools/none-ls-extras.nvim',
'jayp0521/mason-null-ls.nvim', -- ensure dependencies are installed 'gbprod/none-ls-shellcheck.nvim',
}, },
config = function() config = function()
local null_ls = require 'null-ls' local null_ls = require 'null-ls'
local formatting = null_ls.builtins.formatting -- to setup formatters local formatting = null_ls.builtins.formatting -- to setup formatters
local diagnostics = null_ls.builtins.diagnostics -- to setup linters local diagnostics = null_ls.builtins.diagnostics -- to setup linters
-- list of formatters & linters for mason to install
require('mason-null-ls').setup { -- Note: Use Mason to manually install tools:
ensure_installed = { -- :MasonInstall checkmake prettier stylua eslint_d shfmt ruff goimports
'checkmake',
'prettier', -- ts/js formatter
'stylua', -- lua formatter
'eslint_d', -- ts/js linter
'shfmt',
'ruff',
'goimports'
},
-- auto-install configured formatters & linters (with null-ls)
automatic_installation = true,
}
local sources = { local sources = {
diagnostics.checkmake, diagnostics.checkmake,
@ -37,7 +26,7 @@ return {
local augroup = vim.api.nvim_create_augroup('LspFormatting', {}) local augroup = vim.api.nvim_create_augroup('LspFormatting', {})
null_ls.setup { null_ls.setup {
-- debug = true, -- Enable debug mode. Inspect logs with :NullLsLog. debug = false, -- Disable debug mode to reduce log spam
sources = sources, sources = sources,
-- you can reuse a shared lspconfig on_attach callback here -- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr) on_attach = function(client, bufnr)