langserver

package
v1.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenGo

func GenGo(pattern ...string) (err error)

Types

type AsyncCall

type AsyncCall = jsonrpc2.AsyncCall

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client of the language server.

func Open

func Open(ctx context.Context, dialer Dialer, onDone func()) (ret Client, err error)

Open uses the dialer to make a new connection and returns a client of the LangServer based on the connection.

func ServeAndDial

func ServeAndDial(conf *ServeAndDialConfig, gopCmd string, args ...string) Client

ServeAndDial executes a command as a LangServer, makes a new connection to it and returns a client of the LangServer based on the connection.

func (Client) AsyncGenGo

func (p Client) AsyncGenGo(ctx context.Context, pattern ...string) *AsyncCall

func (Client) Changed

func (p Client) Changed(ctx context.Context, files ...string) (err error)

func (Client) Close

func (p Client) Close() error

func (Client) GenGo

func (p Client) GenGo(ctx context.Context, pattern ...string) (err error)

type Config

type Config struct {
	// Framer allows control over the message framing and encoding.
	// If nil, HeaderFramer will be used.
	Framer jsonrpc2.Framer
}

Config holds the options for new connections.

type Dialer

type Dialer = jsonrpc2.Dialer

Dialer is used by clients to dial a server.

type Listener

type Listener = jsonrpc2.Listener

Listener is implemented by protocols to accept new inbound connections.

type ServeAndDialConfig

type ServeAndDialConfig struct {
	// OnError is to customize how to process errors (optional).
	// It should panic in any case.
	OnError func(err error)
}

ServeAndDialConfig represents the configuration of ServeAndDial.

type Server

type Server = jsonrpc2.Server

Server is a running server that is accepting incoming connections.

func NewServer

func NewServer(ctx context.Context, listener Listener, conf *Config) (ret *Server)

NewServer creates a new LangServer and returns it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL