summary refs log tree commit diff
path: root/.config/nvim/lua/plugins/lsp.lua
blob: 306953c025e70e36b9a108fd6e7cca2e9cca9c72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
return {
  {
    enabled = true,
    'neovim/nvim-lspconfig',
    version = '^2.0',
  },
  {
    enabled = true,
    'nvimtools/none-ls.nvim',
    dependencies = {
      'nvim-lua/plenary.nvim',
      'gbprod/none-ls-shellcheck.nvim',
    },
    ft = {
      'sh',
      'bash',
      'go',
      'lua',
    },
    config = function()
      local nls = require('null-ls')
      nls.setup({
        sources = {
          -- nls.builtins.code_actions.impl,
          -- nls.builtins.completions.spell,

          nls.builtins.formatting.stylua,
          nls.builtins.formatting.shfmt,

          require('none-ls-shellcheck.diagnostics'),
          require('none-ls-shellcheck.code_actions'),

          nls.builtins.diagnostics.golangci_lint.with({
            command = 'task',
            args = {
              '--offline',
              '--silent',
              '--exit-code',
              '--failfast',
              '--output=interleaved',
              'go:lint',
              '--',
              '--show-stats=false',
              '--output.json.path=stdout',
              '--path-mode=abs',
            },
          }),
        },
      })
    end,
  },
}