Gopls LSP Configuration

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

Installing the Language Server

Run the following command to install the language server:
go install golang.org/x/tools/gopls@latest
After the command completes run the following command to check the installation:
gopls.exe version
That command should result in outpuit similar to the following:
golang.org/x/tools/gopls v0.17.1
If that output is not produced the correct output check the installation and also check to make sure the executuble installation folder has been added to the system PATH environment variable.
Use the following command to locate the installation folder of the language server:
which gopls.exe
That command should result in output similar to the following:
C:\Go\bin\gopls.exe
Take note of that folder locate as it will be needed in the configuration steps that follow.

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: C:\Go\bin\gopls.exe
NOTE: The executable details used are the same as the details noted from the earlier steps of the configuration process.

Using the Language Server

To test the configuration create a simple test.go file and fire off an auto-complete request:
lsp go
In addition to code completion, code navigation, function signatures and document hover should also work.
IMPORTANT: If the auto complete does not fire, try closing then re-opening any Go files; make sure the GOPATH is correctly configured; make sure the test.go file folder location is found in that GOPATH and make sure the test.go file can be compiled inside of Zeus.


Latest Version: Zeus 3.99c
Released: 3rd January 2025