LSP

The GoHT CLI can be used as a Language Server Protocol (LSP) server. This allows you to use the GoHT CLI with any editor that supports the LSP protocol.

Purpose

The GoHT LSP server is for integration with editors and IDEs. It is not intended to be used directly from the command line.

Help

To get help with the GoHT LSP server, you can run the following command:

$ goht lsp -h

Dependencies

The GoHT LSP server has a dependency on the Go GoPLS LSP server. You can install it by running the following command:

$ go install golang.org/x/tools/gopls@latest

Usage

Normal usage of the GoHT LSP server does not require any flags or arguments. You can start the server by running the following command:

$ goht lsp

The GoHT LSP server will start and listen for connections on stdin and stdout. The IDE or editor will be the one that is expected to start the server and communicate with it.

The goht lsp command also supports the following flags:

  • --logFile string - The file to write the log output to. The default is stderr.
  • --traceClient - Enable tracing the messages between the IDE and the GoHT LSP server.
  • --traceGoPls - Enable tracing the messages between the GoHT LSP server and the GoPLS LSP server.