Go Bingo 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.
Downloading the Language Server
To download the language server run the following command:
go get github.com/saibing/bingo
Installing the Language Server
To install the language server run the following commands:
cd github.com/saibing/bingo
set GO111MODULE=on
go install
With the software installed test the installation by running bingo.exe --help
at the command line prompt, which should result in the following output:
bingo.exe --help
Usage of bingo:
-addr string
server listen address (tcp) (default ":4389")
-build-tags string
build tags, separated by spaces.
-cache-style string
set global cache style: none, on-demand, always. Can be overridden by InitializationOptions. (default "always")
-diagnostics-style string
diagnostics style: none, instant, onsave. Can be overridden by InitializationOptions. (default "onsave")
-disable-func-snippet
disable argument snippets on func completion. Can be overridden by InitializationOptions.
-enhance-signature-help
enhance signature help with return result. Can be overridden by InitializationOptions.
-format-style string
which format style is used to format documents. Supported: gofmt and goimports. Can be overridden by InitializationOptions. (default "goimports")
-freeosmemory int
the interval time that aggressively free memory back to the OS, unit is second, default value is 0, means no free memroy back to the OS
-goimports-prefix string
set '--local' flag for the goimports invocation. 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/)
-trace
print all requests and responses
-version
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.
Configuration
Start Zeus and use the
Options, Document Types menu to edit the Go document type and in the Language Server configuration panel apply the following configuration settings:
Program Type: Executable
Program: bingo.exe
Arguments: -mode=stdio
-trace
NOTE: The executable directory option was omitted because it was assumed 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:
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.
Released: 29th January 2024