Go LSP Configuration

The details below describe how to install and configure the Go language server found here.
NOTE: This installation process assumes Go has been installed on the machine.

Installing the Language Server

To install the language server run the following command:
go get github.com/sourcegraph/go-langserver
With the software installed test the installation by running go-langserver.exe --help at the command line prompt, which should result in the following output:
Usage of go-langserver.exe:
  -addr string
    	server listen address (tcp) (default ":4389")
    	aggressively free memory back to the OS (default true)
    	enable argument snippets on func completion. Can be overridden by InitializationOptions. (default true)
    	enable completion (extra memory burden). Can be overridden by InitializationOptions.
  -logfile string
    	also log to this file (in addition to stderr)
  -maxparallelism int
    	use at max N parallel goroutines to fulfill requests. Can be overridden by InitializationOptions.
  -mode string
    	communication mode (stdio|tcp) (default "stdio")
  -pprof string
    	start a pprof http server (https://golang.org/pkg/net/http/pprof/)
    	print all requests and responses
    	use $GOPATH/pkg binary .a files (improves performance). Can be overridden by InitializationOptions. (default true)
    	print version and exit
If that output is not produced check the installation and also check to make sure the executuble installation folder has been added to the system PATH environment variable.


Edit the Go document type and in the Language Server configuration panel apply the following configuration settings:
Program Type: Executable
     Program: go-langserver.exe
   Arguments: -mode=stdio
NOTE: The executable directory option can be omitted provided the executable folder is found in the system PATH environment variable.

Using the Language Server

To test the configuration create a simple test.go file and fire off an auto-complete request:
lsp go
If the auto complete does not fire make sure the GOPATH is correctly configured and the test.go file folder location is in that path.

Latest Version: Zeus 3.98s
Released: 9th November 2018