gopls.lua 495 B

1234567891011121314151617181920212223
  1. local common = require("lsp.common-config")
  2. local opts = {
  3. capabilities = common.capabilities,
  4. flags = common.flags,
  5. on_attach = function(_, bufnr)
  6. common.keyAttach(bufnr)
  7. -- common.disableFormat(client)
  8. end,
  9. -- https://github.com/golang/tools/blob/master/gopls/doc/vim.md#neovim
  10. settings = {
  11. gopls = {
  12. analyses = {
  13. unusedparams = true,
  14. },
  15. staticcheck = true,
  16. },
  17. },
  18. }
  19. return {
  20. on_setup = function(server)
  21. server.setup(opts)
  22. end,
  23. }