package lsprpc
import "cuelang.org/go/internal/golangorgx/gopls/lsprpc"
Package lsprpc implements a jsonrpc2.StreamServer that may be used to serve the LSP on a jsonrpc2 channel.
Index ¶
- func ConnectToRemote(ctx context.Context, addr string) (net.Conn, error)
- func ExecuteCommand(ctx context.Context, addr string, id string, request, result any) error
- func NewForwarder(rawAddr string, argFunc func(network, address string) []string) (jsonrpc2.StreamServer, error)
- func NewStreamServer(cache *cache.Cache, daemon bool, optionsFunc func(*settings.Options)) jsonrpc2.StreamServer
- func ParseAddr(listen string) (network string, address string)
- func QueryServerState(ctx context.Context, addr string) (any, error)
Functions ¶
func ConnectToRemote ¶
func ExecuteCommand ¶
ExecuteCommand connects to the named server, sends it a workspace/executeCommand request (with command 'id' and arguments JSON encoded in 'request'), and populates the result variable.
func NewForwarder ¶
func NewForwarder(rawAddr string, argFunc func(network, address string) []string) (jsonrpc2.StreamServer, error)
NewForwarder creates a new forwarder (a jsonrpc2.StreamServer), ready to forward connections to the remote server specified by rawAddr. If provided and rawAddr indicates an 'automatic' address (starting with 'auto;'), argFunc may be used to start a remote server for the auto-discovered address.
func NewStreamServer ¶
func NewStreamServer(cache *cache.Cache, daemon bool, optionsFunc func(*settings.Options)) jsonrpc2.StreamServer
NewStreamServer creates a StreamServer using the shared cache. If withTelemetry is true, each session is instrumented with telemetry that records RPC statistics.
func ParseAddr ¶
ParseAddr parses the address of a gopls remote. TODO(rFindley): further document this syntax, and allow URI-style remote addresses such as "auto://...".
func QueryServerState ¶
QueryServerState returns a JSON-encodable struct describing the state of the named server.
Source Files ¶
autostart_default.go autostart_posix.go binder.go dialer.go goenv.go lsprpc.go
- Version
- v0.12.0 (latest)
- Published
- Jan 30, 2025
- Platform
- linux/amd64
- Imports
- 28 packages
- Last checked
- 8 hours ago –
Tools for package owners.