lsp

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeEdits added in v0.21.0

func ComputeEdits(before, after string) []types.TextEdit

ComputeEdits computes diff edits from 2 string inputs.

func FmtCommand added in v0.21.0

func FmtCommand(args []string) types.Command

func FmtV1Command added in v0.21.0

func FmtV1Command(args []string) types.Command

func NewConnectionFromLanguageServer added in v0.21.0

func NewConnectionFromLanguageServer(
	ctx context.Context,
	handler ConnectionHandlerFunc,
	opts *ConnectionOptions,
) *jsonrpc2.Conn

func NoWhiteSpaceCommentCommand added in v0.21.0

func NoWhiteSpaceCommentCommand(args []string) types.Command

func TokenFoldingRanges added in v0.21.0

func TokenFoldingRanges(policy string) []types.FoldingRange

func UseAssignmentOperatorCommand added in v0.21.0

func UseAssignmentOperatorCommand(args []string) types.Command

Types

type ConnectionHandlerFunc added in v0.21.0

type ConnectionHandlerFunc func(context.Context, *jsonrpc2.Conn, *jsonrpc2.Request) (result interface{}, err error)

type ConnectionLoggingConfig added in v0.21.0

type ConnectionLoggingConfig struct {
	Writer io.Writer

	LogInbound  bool
	LogOutbound bool

	// IncludeMethods is a list of methods to include in the request log.
	// If empty, all methods are included. IncludeMethods takes precedence
	// over ExcludeMethods.
	IncludeMethods []string
	// ExcludeMethods is a list of methods to exclude from the request log.
	ExcludeMethods []string
}

func (*ConnectionLoggingConfig) ShouldLog added in v0.21.0

func (cfg *ConnectionLoggingConfig) ShouldLog(method string) bool

type ConnectionOptions added in v0.21.0

type ConnectionOptions struct {
	LoggingConfig ConnectionLoggingConfig
}

type HoverResponse added in v0.20.0

type HoverResponse struct {
	Contents types.MarkupContent `json:"contents"`
	Range    types.Range         `json:"range"`
}

type LanguageServer

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

func NewLanguageServer

func NewLanguageServer(opts *LanguageServerOptions) *LanguageServer

func (*LanguageServer) Handle

func (l *LanguageServer) Handle(
	ctx context.Context,
	conn *jsonrpc2.Conn,
	req *jsonrpc2.Request,
) (result any, err error)

func (*LanguageServer) SetConn

func (l *LanguageServer) SetConn(conn *jsonrpc2.Conn)

func (*LanguageServer) StartCommandWorker added in v0.21.0

func (l *LanguageServer) StartCommandWorker(ctx context.Context)

func (*LanguageServer) StartConfigWorker added in v0.21.0

func (l *LanguageServer) StartConfigWorker(ctx context.Context)

func (*LanguageServer) StartDiagnosticsWorker

func (l *LanguageServer) StartDiagnosticsWorker(ctx context.Context)

func (*LanguageServer) StartHoverWorker added in v0.20.0

func (l *LanguageServer) StartHoverWorker(ctx context.Context)

type LanguageServerOptions

type LanguageServerOptions struct {
	ErrorLog io.Writer
}

type OpKind added in v0.21.0

type OpKind int

OpKind is used to denote the type of operation a line represents.

const (
	// Delete is the operation kind for a line that is present in the input
	// but not in the output.
	Delete OpKind = iota
	// Insert is the operation kind for a line that is new in the output.
	Insert
	// Equal is the operation kind for a line that is the same in the input and
	// output, often used to provide context around edited lines.
	Equal
)

type StdOutReadWriteCloser

type StdOutReadWriteCloser struct{}

func (StdOutReadWriteCloser) Close

func (StdOutReadWriteCloser) Close() error

func (StdOutReadWriteCloser) Read

func (StdOutReadWriteCloser) Read(p []byte) (int, error)

func (StdOutReadWriteCloser) Write

func (StdOutReadWriteCloser) Write(p []byte) (int, error)

Directories

Path Synopsis
opa

Jump to

Keyboard shortcuts

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