golangci-server

command module
v0.0.0-...-f75aef8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 17 Imported by: 0

README

golangci-server

golangci-server is a golangci-lint language server.

Installation

  1. Install golangci-lint

  2. Install golangci-server

     go install github.com/stephenafamo/golangci-server@latest
    

Inspiration

Most of the inspiration for this was taken from golangci-lint-langserver.

I started out trying to modify it but found it easier to just rebuild based on the excellent glsp package

Configuration for coc.nvim

coc-settings.json

{
  "languageserver": {
    "golangci-server": {
      "command": "golangci-server",
      "filetypes": ["go"],
    }
  }
}
Configuration for vim-lsp
augroup vim_lsp_golangci_server
  au!
  autocmd User lsp_setup call lsp#register_server({
      \ 'name': 'golangci-server',
      \ 'cmd': {server_info->['golangci-server']},
      \ 'whitelist': ['go'],
      \ })
augroup END
Configuration for nvim-lspconfig
local lspconfig = require 'lspconfig'
local configs = require 'lspconfig.configs'

if not configs.golangcilsp then
 	configs.golangcilsp = {
		default_config = {
			cmd = {'golangci-server'},
			root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
		};
	}
end
lspconfig.golangcilsp.setup {
	filetypes = {'go'}
}
Configuration for lsp-mode (Emacs)
(with-eval-after-load 'lsp-mode
  (lsp-register-client
   (make-lsp-client :new-connection (lsp-stdio-connection
                                     '("golangci-server"))
                    :major-modes '(go-mode)
                    :language-id "go"
                    :priority 0
                    :server-id 'golangci-lint
                    :add-on? t
                    :library-folders-fn #'lsp-go--library-default-directories

  (add-to-list 'lsp-language-id-configuration '(go-mode . "golangci-lint")))

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL