nametake / golangci-lint-langserver

golangci-lint language server
MIT License
201 stars 19 forks source link

It does not tell which linter is throwing a warning while using with nvim lspconfig #11

Closed dakyskye closed 2 years ago

dakyskye commented 2 years ago

I would like to suppress this warning but I have no idea which linter might be throwing it. I happen to remember it's from errorlint but for other warnings I would have no way to guess it that easily. Is there any way to get it to tell me which linter is throwing the error so I can simply //nolint:<lintername that line?

image

if not lspconfig.golangci then
    configs.golangci = {
        default_config = {
            cmd = { 'golangci-lint-langserver' },
            root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
            init_options = {
                command = { 'golangci-lint', 'run', '--out-format', 'json' };
            }
        }
    }
end

lspconfig['golangci'].setup {
    on_attach = on_attach,
    flags = {
        debounce_text_changes = 150,
    },
    filetypes = { 'go' }
}
nametake commented 2 years ago

Fixed to show linter name https://github.com/nametake/golangci-lint-langserver/pull/12