lsp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionItem

type CompletionItem struct {
	Label         string      `json:"label"`
	Kind          int         `json:"kind,omitempty"`
	Detail        *string     `json:"detail,omitempty"`
	Documentation interface{} `json:"documentation,omitempty"`
	InsertText    string      `json:"insertText,omitempty"`
}

type CompletionList

type CompletionList struct {
	IsIncomplete bool             `json:"isIncomplete"`
	Items        []CompletionItem `json:"items"`
}

type CompletionParams

type CompletionParams struct {
	TextDocumentPositionParams
}

type JSONRPCError

type JSONRPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

func (*JSONRPCError) Error

func (e *JSONRPCError) Error() string

type JSONRPCNotification

type JSONRPCNotification struct {
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

type JSONRPCRequest

type JSONRPCRequest struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int         `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

type JSONRPCResponse

type JSONRPCResponse struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      int             `json:"id,omitempty"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *JSONRPCError   `json:"error,omitempty"`
}

type LSPClient

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

LSPClient structure

func NewLSPClient

func NewLSPClient(ctx context.Context, workspace, filePath string) (*LSPClient, error)

NewLSPClient creates a new LSP client

func (*LSPClient) Close

func (c *LSPClient) Close() error

func (*LSPClient) DidOpen

func (c *LSPClient) DidOpen(ctx context.Context, filename, languageID string, version int, text string) error

func (*LSPClient) GetCompletions

func (c *LSPClient) GetCompletions(ctx context.Context, line, character int) (*CompletionList, error)

func (*LSPClient) GetFileURI

func (c *LSPClient) GetFileURI() string

func (*LSPClient) WaitForReady

func (c *LSPClient) WaitForReady(ctx context.Context) error

WaitForReady blocks until the client has received a notification that gopls has finished loading packages.

type Position

type Position struct {
	Line      int `json:"line"`
	Character int `json:"character"`
}

LSP protocol structures

type TextDocumentIdentifier

type TextDocumentIdentifier struct {
	URI string `json:"uri"`
}

type TextDocumentPositionParams

type TextDocumentPositionParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Position     Position               `json:"position"`
}

Jump to

Keyboard shortcuts

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