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)
or util.path.dirname(fname)
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 = {
gopls = {
gofumpt = true,
@ -54,6 +64,8 @@ return {
-- Performance optimizations for large repositories
memoryMode = "DegradeClosed",
symbolMatcher = "FastFuzzy",
-- Reduce signature help noise
["ui.completion.experimentalPostfixCompletions"] = false,
},
},
})

View File

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