lsp

package module
v0.1.3-0...-500dcc6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

README

A client/server library for LSP (Language Server Protocol) written in golang

How to use

import "go.bug.st/lsp"

Documentation

TODO

Disclaimer

This is alpha-grade software, API may change without notice. If you decice to use this library, expect breaking changes.

Documentation

Overview

Package lsp is an implementation of a Language Server Protocol handler.

Index

Constants

View Source
const InitializeErrorUnknownProtocolVersion jsonrpc.ErrorCode = 1

InitializeErrorUnknownProtocolVersion If the protocol version provided by the client can't be handled by the server.

@deprecated This initialize error got replaced by client capabilities. There is no version handshake in version 3.0x

View Source
const PrepareSupportDefaultBehaviorIdentifier = 1

PrepareSupportDefaultBehaviorIdentifier The client's default behavior is to select the identifier according the to language's syntax rule.

View Source
const ResourceOperationKindCreate = ResourceOperationKind("create")

ResourceOperationKindCreate Supports creating new files and folders.

View Source
const ResourceOperationKindDelete = ResourceOperationKind("delete")

ResourceOperationKindDelete Supports deleting existing files and folders.

View Source
const ResourceOperationKindRename = ResourceOperationKind("rename")

ResourceOperationKindRename Supports renaming existing files and folders.

Variables

View Source
var NilRange = Range{}
View Source
var NilURI = DocumentURI{}

NilURI is the empty DocumentURI

Functions

func DecodeClientNotificationParams

func DecodeClientNotificationParams(method string, req json.RawMessage) (interface{}, error)

DecodeClientNotificationParams parse a CLIENT-NOTIFICATION (→)

func DecodeClientRequestParams

func DecodeClientRequestParams(method string, req json.RawMessage) (any, error)

DecodeClientRequestParams parse a CLIENT-REQUEST (↩)

func DecodeClientResponseResult

func DecodeClientResponseResult(method string, resp json.RawMessage) (interface{}, error)

DecodeClientResponseResult parse a CLIENT-RESPONSE to a SERVER-REQUEST (↪)

func DecodeServerNotificationParams

func DecodeServerNotificationParams(method string, req json.RawMessage) (interface{}, error)

DecodeServerNotificationParams parse a SERVER-NOTIFICATION (←)

func DecodeServerRequestParams

func DecodeServerRequestParams(method string, req json.RawMessage) (interface{}, error)

DecodeServerRequestParams parse a SERVER-REQUEST (↪)

func DecodeServerResponseResult

func DecodeServerResponseResult(method string, resp json.RawMessage) (interface{}, error)

DecodeServerResponseResult parse a SERVER-RESPONSE to a CLIENT-REQUEST (↩)

func EncodeMessage

func EncodeMessage(msg interface{}) json.RawMessage

Types

type ApplyWorkspaceEditParams

type ApplyWorkspaceEditParams struct {
	// An optional label of the workspace edit. This label is
	// presented in the user interface for example on an undo
	// stack to undo the workspace edit.
	Label string `json:"label,required"`

	// The edits to apply.
	Edit WorkspaceEdit `json:"edit,required"`
}

type ApplyWorkspaceEditResult

type ApplyWorkspaceEditResult struct {
	// Indicates whether the edit was applied or not.
	Applied bool `json:"applied,required"`

	// An optional textual description for why the edit was not applied.
	// This may be used by the server for diagnostic logging or to provide
	// a suitable error for a request that triggered the edit.
	FailureReason string `json:"failureReason,omitempty"`

	// Depending on the client's failure handling strategy `failedChange`
	// might contain the index of the change that failed. This property is
	// only available if the client signals a `failureHandling` strategy
	// in its client capabilities.
	FailedChange int `json:"failedChange,omitempty"`
}

type BooleanOrEmptyStruct

type BooleanOrEmptyStruct bool

func (*BooleanOrEmptyStruct) UnmarshalJSON

func (x *BooleanOrEmptyStruct) UnmarshalJSON(data []byte) error

type CallHierarchyClientCapabilities

type CallHierarchyClientCapabilities struct {
	// Whether implementation supports dynamic registration. If this is set to
	// `true` the client supports the new `(TextDocumentRegistrationOptions &
	// StaticRegistrationOptions)` return value for the corresponding server
	// capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type CallHierarchyIncomingCall

type CallHierarchyIncomingCall struct {

	// The item that makes the call.
	From CallHierarchyItem `json:"from,required"`

	// The ranges at which the calls appear. This is relative to the caller
	// denoted by [`this.from`](#CallHierarchyIncomingCall.from).
	FromRanges []Range `json:"fromRanges,required"`
}

type CallHierarchyIncomingCallsParams

type CallHierarchyIncomingCallsParams struct {
	WorkDoneProgressParams
	PartialResultParams

	Item CallHierarchyItem `json:"item,required"`
}

type CallHierarchyItem

type CallHierarchyItem struct {
	// The name of this item.
	Name string `json:"name,required"`

	// The kind of this item.
	Kind SymbolKind `json:"kind,required"`

	// Tags for this item.
	Tags []SymbolTag `json:"tags,omitempty"`

	// More detail for this item, e.g. the signature of a function.
	Detail string `json:"detail,omitempty"`

	// The resource identifier of this item.
	URI DocumentURI `json:"uri,required"`

	// The range enclosing this symbol not including leading/trailing whitespace
	// but everything else, e.g. comments and code.
	Range Range `json:"range,required"`

	// The range that should be selected and revealed when this symbol is being
	// picked, e.g. the name of a function. Must be contained by the
	// [`range`](#CallHierarchyItem.range).
	SelectionRange Range `json:"selectionRange,required"`

	// A data entry field that is preserved between a call hierarchy prepare and
	// incoming calls or outgoing calls requests.
	Data json.RawMessage `json:"data,omitempty"`
}

type CallHierarchyOptions

CallHierarchyOptions boolean | CallHierarchyOptions | CallHierarchyRegistrationOptions

func (*CallHierarchyOptions) UnmarshalJSON

func (s *CallHierarchyOptions) UnmarshalJSON(data []byte) error

type CallHierarchyOutgoingCall

type CallHierarchyOutgoingCall struct {
	// The item that is called.
	Ro CallHierarchyItem `json:"to,required"`

	// The range at which this item is called. This is the range relative to
	// the caller, e.g the item passed to `callHierarchy/outgoingCalls` request.
	FromRanges []Range `json:"fromRanges,required"`
}

type CallHierarchyOutgoingCallsParams

type CallHierarchyOutgoingCallsParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	Item CallHierarchyItem `json:"item,required"`
}

type CallHierarchyPrepareParams

type CallHierarchyPrepareParams struct {
	TextDocumentPositionParams
	WorkDoneProgressParams
}

type ChangeAnnotation

type ChangeAnnotation struct {
	// A human-readable string describing the actual change. The string
	// is rendered prominent in the user interface.
	Label string `json:"label,required"`

	// A flag which indicates that user confirmation is needed
	// before applying the change.
	NeedsConfirmation bool `json:"needsConfirmation,omitempty"`

	// A human-readable string which is rendered less prominent in
	// the user interface.
	Description string `json:"description,omitempty"`
}

ChangeAnnotation Additional information that describes document changes.

@since 3.16.0

type Client

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

Client is an LSP Client

func NewClient

func NewClient(in io.Reader, out io.Writer, handler ServerMessagesHandler) *Client

func (*Client) CallHierarchyIncomingCalls

func (client *Client) CallHierarchyIncomingCalls(ctx context.Context, param *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall, *jsonrpc.ResponseError, error)

func (*Client) CallHierarchyOutgoingCalls

func (client *Client) CallHierarchyOutgoingCalls(ctx context.Context, param *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall, *jsonrpc.ResponseError, error)

func (*Client) CodeActionResolve

func (client *Client) CodeActionResolve(ctx context.Context, param *CodeAction) (*CodeAction, *jsonrpc.ResponseError, error)

func (*Client) CodeLensResolve

func (client *Client) CodeLensResolve(ctx context.Context, param *CodeLens) (*CodeLens, *jsonrpc.ResponseError, error)

func (*Client) CompletionItemResolve

func (client *Client) CompletionItemResolve(ctx context.Context, param *CompletionItem) (*CompletionItem, *jsonrpc.ResponseError, error)

func (*Client) DocumentLinkResolve

func (client *Client) DocumentLinkResolve(ctx context.Context, param *DocumentLink) (*DocumentLink, *jsonrpc.ResponseError, error)

func (*Client) Exit

func (client *Client) Exit() error

func (*Client) Initialize

func (client *Client) Initialize(ctx context.Context, param *InitializeParams) (*InitializeResult, *jsonrpc.ResponseError, error)

func (*Client) Initialized

func (client *Client) Initialized(param *InitializedParams) error

func (*Client) Progress

func (client *Client) Progress(param *ProgressParams) error

func (*Client) RegisterCustomNotification

func (client *Client) RegisterCustomNotification(method string, callback CustomNotification)

func (*Client) RegisterCustomRequest

func (client *Client) RegisterCustomRequest(method string, callback CustomRequest)

func (*Client) Run

func (client *Client) Run()

func (*Client) SetErrorHandler

func (client *Client) SetErrorHandler(handler func(e error))

func (*Client) SetLogger

func (client *Client) SetLogger(l jsonrpc.Logger)

func (*Client) SetTrace

func (client *Client) SetTrace(param *SetTraceParams) error

func (*Client) Shutdown

func (client *Client) Shutdown(ctx context.Context) (*jsonrpc.ResponseError, error)

func (*Client) TextDocumentCodeAction

func (client *Client) TextDocumentCodeAction(ctx context.Context, param *CodeActionParams) ([]CommandOrCodeAction, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentCodeLens

func (client *Client) TextDocumentCodeLens(ctx context.Context, param *CodeLensParams) ([]CodeLens, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentColorPresentation

func (client *Client) TextDocumentColorPresentation(ctx context.Context, param *ColorPresentationParams) ([]ColorPresentation, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentCompletion

func (client *Client) TextDocumentCompletion(ctx context.Context, param *CompletionParams) (*CompletionList, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentDeclaration

func (client *Client) TextDocumentDeclaration(ctx context.Context, param *DeclarationParams) ([]Location, []LocationLink, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentDefinition

func (client *Client) TextDocumentDefinition(ctx context.Context, param *DefinitionParams) ([]Location, []LocationLink, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentDidChange

func (client *Client) TextDocumentDidChange(param *DidChangeTextDocumentParams) error

func (*Client) TextDocumentDidClose

func (client *Client) TextDocumentDidClose(param *DidCloseTextDocumentParams) error

func (*Client) TextDocumentDidOpen

func (client *Client) TextDocumentDidOpen(param *DidOpenTextDocumentParams) error

func (*Client) TextDocumentDidSave

func (client *Client) TextDocumentDidSave(param *DidSaveTextDocumentParams) error

func (*Client) TextDocumentDocumentColor

func (client *Client) TextDocumentDocumentColor(ctx context.Context, param *DocumentColorParams) ([]ColorInformation, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentDocumentHighlight

func (client *Client) TextDocumentDocumentHighlight(ctx context.Context, param *DocumentHighlightParams) ([]DocumentHighlight, *jsonrpc.ResponseError, error)
func (client *Client) TextDocumentDocumentLink(ctx context.Context, param *DocumentLinkParams) ([]DocumentLink, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentDocumentSymbol

func (client *Client) TextDocumentDocumentSymbol(ctx context.Context, param *DocumentSymbolParams) ([]DocumentSymbol, []SymbolInformation, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentFoldingRange

func (client *Client) TextDocumentFoldingRange(ctx context.Context, param *FoldingRangeParams) ([]FoldingRange, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentFormatting

func (client *Client) TextDocumentFormatting(ctx context.Context, param *DocumentFormattingParams) ([]TextEdit, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentHover

func (client *Client) TextDocumentHover(ctx context.Context, param *HoverParams) (*Hover, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentImplementation

func (client *Client) TextDocumentImplementation(ctx context.Context, param *ImplementationParams) ([]Location, []LocationLink, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentLinkedEditingRange

func (client *Client) TextDocumentLinkedEditingRange(ctx context.Context, param *LinkedEditingRangeParams) (*LinkedEditingRanges, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentMoniker

func (client *Client) TextDocumentMoniker(ctx context.Context, param *MonikerParams) ([]Moniker, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentOnTypeFormatting

func (client *Client) TextDocumentOnTypeFormatting(ctx context.Context, param *DocumentOnTypeFormattingParams) ([]TextEdit, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentPrepareCallHierarchy

func (client *Client) TextDocumentPrepareCallHierarchy(ctx context.Context, param *CallHierarchyPrepareParams) ([]CallHierarchyItem, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentPrepareRename

func (client *Client) TextDocumentPrepareRename(ctx context.Context, param *PrepareRenameParams) (json.RawMessage, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentRangeFormatting

func (client *Client) TextDocumentRangeFormatting(ctx context.Context, param *DocumentRangeFormattingParams) ([]TextEdit, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentReferences

func (client *Client) TextDocumentReferences(ctx context.Context, param *ReferenceParams) ([]Location, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentRename

func (client *Client) TextDocumentRename(ctx context.Context, param *RenameParams) (*WorkspaceEdit, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentSelectionRange

func (client *Client) TextDocumentSelectionRange(ctx context.Context, param *SelectionRangeParams) ([]SelectionRange, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentSemanticTokensFull

func (client *Client) TextDocumentSemanticTokensFull(ctx context.Context, param *SemanticTokensParams) (*SemanticTokens, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentSemanticTokensFullDelta

func (client *Client) TextDocumentSemanticTokensFullDelta(ctx context.Context, param *SemanticTokensDeltaParams) (*SemanticTokens, *SemanticTokensDelta, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentSemanticTokensRange

func (client *Client) TextDocumentSemanticTokensRange(ctx context.Context, param *SemanticTokensRangeParams) (*SemanticTokens, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentSignatureHelp

func (client *Client) TextDocumentSignatureHelp(ctx context.Context, param *SignatureHelpParams) (*SignatureHelp, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentTypeDefinition

func (client *Client) TextDocumentTypeDefinition(ctx context.Context, param *TypeDefinitionParams) ([]Location, []LocationLink, *jsonrpc.ResponseError, error)

func (*Client) TextDocumentWillSave

func (client *Client) TextDocumentWillSave(param *WillSaveTextDocumentParams) error

func (*Client) TextDocumentWillSaveWaitUntil

func (client *Client) TextDocumentWillSaveWaitUntil(ctx context.Context, param *WillSaveTextDocumentParams) ([]TextEdit, *jsonrpc.ResponseError, error)

func (*Client) WindowWorkDoneProgressCancel

func (client *Client) WindowWorkDoneProgressCancel(param *WorkDoneProgressCancelParams) error

func (*Client) WorkspaceDidChangeConfiguration

func (client *Client) WorkspaceDidChangeConfiguration(param *DidChangeConfigurationParams) error

func (*Client) WorkspaceDidChangeWatchedFiles

func (client *Client) WorkspaceDidChangeWatchedFiles(param *DidChangeWatchedFilesParams) error

func (*Client) WorkspaceDidChangeWorkspaceFolders

func (client *Client) WorkspaceDidChangeWorkspaceFolders(param *DidChangeWorkspaceFoldersParams) error

func (*Client) WorkspaceDidCreateFiles

func (client *Client) WorkspaceDidCreateFiles(param *CreateFilesParams) error

func (*Client) WorkspaceDidDeleteFiles

func (client *Client) WorkspaceDidDeleteFiles(param *DeleteFilesParams) error

func (*Client) WorkspaceDidRenameFiles

func (client *Client) WorkspaceDidRenameFiles(param *RenameFilesParams) error

func (*Client) WorkspaceExecuteCommand

func (client *Client) WorkspaceExecuteCommand(ctx context.Context, param *ExecuteCommandParams) (json.RawMessage, *jsonrpc.ResponseError, error)

func (*Client) WorkspaceSemanticTokensRefresh

func (client *Client) WorkspaceSemanticTokensRefresh(ctx context.Context) (*jsonrpc.ResponseError, error)

func (*Client) WorkspaceSymbol

func (client *Client) WorkspaceSymbol(ctx context.Context, param *WorkspaceSymbolParams) ([]SymbolInformation, *jsonrpc.ResponseError, error)

func (*Client) WorkspaceWillCreateFiles

func (client *Client) WorkspaceWillCreateFiles(ctx context.Context, param *CreateFilesParams) (*WorkspaceEdit, *jsonrpc.ResponseError, error)

func (*Client) WorkspaceWillDeleteFiles

func (client *Client) WorkspaceWillDeleteFiles(ctx context.Context, param *DeleteFilesParams) (*WorkspaceEdit, *jsonrpc.ResponseError, error)

func (*Client) WorkspaceWillRenameFiles

func (client *Client) WorkspaceWillRenameFiles(ctx context.Context, param *RenameFilesParams) (*WorkspaceEdit, *jsonrpc.ResponseError, error)

type ClientCapabilities

type ClientCapabilities struct {
	Workspace *struct {
		// The client supports applying batch edits
		// to the workspace by supporting the request
		// 'workspace/applyEdit'
		ApplyEdit bool `json:"applyEdit,omitempty"`

		// Capabilities specific to `WorkspaceEdit`s
		WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`

		// Capabilities specific to the `workspace/didChangeConfiguration`
		// notification.
		DidChangeConfiguration *DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`

		// Capabilities specific to the `workspace/didChangeWatchedFiles`
		// notification.
		DidChangeWatchedFiles *DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`

		// Capabilities specific to the `workspace/symbol` request.
		Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`

		// Capabilities specific to the `workspace/executeCommand` request.
		ExecuteCommand *ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`

		// The client has support for workspace folders.
		//
		// @since 3.6.0
		WorkspaceFolders bool `json:"workspaceFolders,omitempty"`

		// The client supports `workspace/configuration` requests.
		//
		// @since 3.6.0
		Configuration bool `json:"configuration,omitempty"`

		// Capabilities specific to the semantic token requests scoped to the
		// workspace.
		//
		// @since 3.16.0
		SemanticTokens *SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`

		// Capabilities specific to the code lens requests scoped to the
		// workspace.
		//
		// @since 3.16.0
		CodeLens *CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`

		// The client has support for file requests/notifications.
		//
		// @since 3.16.0
		FileOperations *struct {
			// Whether the client supports dynamic registration for file
			// requests/notifications.
			DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

			// The client has support for sending didCreateFiles notifications.
			DidCreate bool `json:"didCreate,omitempty"`

			// The client has support for sending willCreateFiles requests.
			WillCreate bool `json:"willCreate,omitempty"`

			// The client has support for sending didRenameFiles notifications.
			DidRename bool `json:"didRename,omitempty"`

			// The client has support for sending willRenameFiles requests.
			WillRename bool `json:"willRename,omitempty"`

			// The client has support for sending didDeleteFiles notifications.
			DidDelete bool `json:"didDelete,omitempty"`

			// The client has support for sending willDeleteFiles requests.
			WillDelete bool `json:"willDelete,omitempty"`
		} `json:"fileOperations,omitempty"`
	} `json:"workspace,omitempty"`

	// Text document specific client capabilities.
	TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitempty"`

	// Window specific client capabilities.
	Window *struct {

		// Whether client supports handling progress notifications. If set
		// servers are allowed to report in `workDoneProgress` property in the
		// request specific server capabilities.
		//
		// @since 3.15.0
		WorkDoneProgress *bool `json:"workDoneProgress,omitempty"`

		// Capabilities specific to the showMessage request
		//
		// @since 3.16.0
		ShowMessage *ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`

		// Client capabilities for the show document request.
		//
		// @since 3.16.0
		ShowDocument *ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
	} `json:"window,omitempty"`

	// General client capabilities.
	//
	// @since 3.16.0
	General *struct {

		// Client capability that signals how the client
		// handles stale requests (e.g. a request
		// for which the client will not process the response
		// anymore since the information is outdated).
		//
		// @since 3.17.0
		StaleRequestSupport *struct {
			// The client will actively cancel the request.
			Cancel bool `json:"cancel,required"`

			// The list of requests for which the client
			// will retry the request if it receives a
			// response with error code `ContentModified“
			RetryOnContentModified []string `json:"retryOnContentModified,required"`
		} `json:"staleRequestSupport,omitempty"`

		// Client capabilities specific to regular expressions.
		//
		// @since 3.16.0
		RegularExpressions *RegularExpressionsClientCapabilities `json:"regularExpressions,omitempty"`

		// Client capabilities specific to the client's markdown parser.
		//
		// @since 3.16.0
		Markdown *MarkdownClientCapabilities `json:"markdown,omitempty"`
	} `json:"general,omitempty"`

	// Experimental client capabilities.
	Experimental json.RawMessage `json:"experimental,omitempty"`
}

ClientCapabilities Workspace specific client capabilities.

type ClientMessagesHandler

type ClientMessagesHandler interface {
	Initialize(context.Context, jsonrpc.FunctionLogger, *InitializeParams) (*InitializeResult, *jsonrpc.ResponseError)
	Shutdown(context.Context, jsonrpc.FunctionLogger) *jsonrpc.ResponseError
	WorkspaceSymbol(context.Context, jsonrpc.FunctionLogger, *WorkspaceSymbolParams) ([]SymbolInformation, *jsonrpc.ResponseError)
	WorkspaceExecuteCommand(context.Context, jsonrpc.FunctionLogger, *ExecuteCommandParams) (json.RawMessage, *jsonrpc.ResponseError)
	WorkspaceWillCreateFiles(context.Context, jsonrpc.FunctionLogger, *CreateFilesParams) (*WorkspaceEdit, *jsonrpc.ResponseError)
	WorkspaceWillRenameFiles(context.Context, jsonrpc.FunctionLogger, *RenameFilesParams) (*WorkspaceEdit, *jsonrpc.ResponseError)
	WorkspaceWillDeleteFiles(context.Context, jsonrpc.FunctionLogger, *DeleteFilesParams) (*WorkspaceEdit, *jsonrpc.ResponseError)
	TextDocumentWillSaveWaitUntil(context.Context, jsonrpc.FunctionLogger, *WillSaveTextDocumentParams) ([]TextEdit, *jsonrpc.ResponseError)
	TextDocumentCompletion(context.Context, jsonrpc.FunctionLogger, *CompletionParams) (*CompletionList, *jsonrpc.ResponseError)
	CompletionItemResolve(context.Context, jsonrpc.FunctionLogger, *CompletionItem) (*CompletionItem, *jsonrpc.ResponseError)
	TextDocumentHover(context.Context, jsonrpc.FunctionLogger, *HoverParams) (*Hover, *jsonrpc.ResponseError)
	TextDocumentSignatureHelp(context.Context, jsonrpc.FunctionLogger, *SignatureHelpParams) (*SignatureHelp, *jsonrpc.ResponseError)
	TextDocumentDeclaration(context.Context, jsonrpc.FunctionLogger, *DeclarationParams) ([]Location, []LocationLink, *jsonrpc.ResponseError)
	TextDocumentDefinition(context.Context, jsonrpc.FunctionLogger, *DefinitionParams) ([]Location, []LocationLink, *jsonrpc.ResponseError)
	TextDocumentTypeDefinition(context.Context, jsonrpc.FunctionLogger, *TypeDefinitionParams) ([]Location, []LocationLink, *jsonrpc.ResponseError)
	TextDocumentImplementation(context.Context, jsonrpc.FunctionLogger, *ImplementationParams) ([]Location, []LocationLink, *jsonrpc.ResponseError)
	TextDocumentReferences(context.Context, jsonrpc.FunctionLogger, *ReferenceParams) ([]Location, *jsonrpc.ResponseError)
	TextDocumentDocumentHighlight(context.Context, jsonrpc.FunctionLogger, *DocumentHighlightParams) ([]DocumentHighlight, *jsonrpc.ResponseError)
	TextDocumentDocumentSymbol(context.Context, jsonrpc.FunctionLogger, *DocumentSymbolParams) ([]DocumentSymbol, []SymbolInformation, *jsonrpc.ResponseError)
	TextDocumentCodeAction(context.Context, jsonrpc.FunctionLogger, *CodeActionParams) ([]CommandOrCodeAction, *jsonrpc.ResponseError)
	CodeActionResolve(context.Context, jsonrpc.FunctionLogger, *CodeAction) (*CodeAction, *jsonrpc.ResponseError)
	TextDocumentCodeLens(context.Context, jsonrpc.FunctionLogger, *CodeLensParams) ([]CodeLens, *jsonrpc.ResponseError)
	CodeLensResolve(context.Context, jsonrpc.FunctionLogger, *CodeLens) (*CodeLens, *jsonrpc.ResponseError)
	TextDocumentDocumentLink(context.Context, jsonrpc.FunctionLogger, *DocumentLinkParams) ([]DocumentLink, *jsonrpc.ResponseError)
	DocumentLinkResolve(context.Context, jsonrpc.FunctionLogger, *DocumentLink) (*DocumentLink, *jsonrpc.ResponseError)
	TextDocumentDocumentColor(context.Context, jsonrpc.FunctionLogger, *DocumentColorParams) ([]ColorInformation, *jsonrpc.ResponseError)
	TextDocumentColorPresentation(context.Context, jsonrpc.FunctionLogger, *ColorPresentationParams) ([]ColorPresentation, *jsonrpc.ResponseError)
	TextDocumentFormatting(context.Context, jsonrpc.FunctionLogger, *DocumentFormattingParams) ([]TextEdit, *jsonrpc.ResponseError)
	TextDocumentRangeFormatting(context.Context, jsonrpc.FunctionLogger, *DocumentRangeFormattingParams) ([]TextEdit, *jsonrpc.ResponseError)
	TextDocumentOnTypeFormatting(context.Context, jsonrpc.FunctionLogger, *DocumentOnTypeFormattingParams) ([]TextEdit, *jsonrpc.ResponseError)
	TextDocumentRename(context.Context, jsonrpc.FunctionLogger, *RenameParams) (*WorkspaceEdit, *jsonrpc.ResponseError)
	//TextDocumentPrepareRename(context.Context,jsonrpc.FunctionLogger, *PrepareRenameParams) (???, *jsonrpc.ResponseError)
	TextDocumentFoldingRange(context.Context, jsonrpc.FunctionLogger, *FoldingRangeParams) ([]FoldingRange, *jsonrpc.ResponseError)
	TextDocumentSelectionRange(context.Context, jsonrpc.FunctionLogger, *SelectionRangeParams) ([]SelectionRange, *jsonrpc.ResponseError)
	TextDocumentPrepareCallHierarchy(context.Context, jsonrpc.FunctionLogger, *CallHierarchyPrepareParams) ([]CallHierarchyItem, *jsonrpc.ResponseError)
	CallHierarchyIncomingCalls(context.Context, jsonrpc.FunctionLogger, *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall, *jsonrpc.ResponseError)
	CallHierarchyOutgoingCalls(context.Context, jsonrpc.FunctionLogger, *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall, *jsonrpc.ResponseError)
	TextDocumentSemanticTokensFull(context.Context, jsonrpc.FunctionLogger, *SemanticTokensParams) (*SemanticTokens, *jsonrpc.ResponseError)
	TextDocumentSemanticTokensFullDelta(context.Context, jsonrpc.FunctionLogger, *SemanticTokensDeltaParams) (*SemanticTokens, *SemanticTokensDelta, *jsonrpc.ResponseError)
	TextDocumentSemanticTokensRange(context.Context, jsonrpc.FunctionLogger, *SemanticTokensRangeParams) (*SemanticTokens, *jsonrpc.ResponseError)
	WorkspaceSemanticTokensRefresh(context.Context, jsonrpc.FunctionLogger) *jsonrpc.ResponseError
	TextDocumentLinkedEditingRange(context.Context, jsonrpc.FunctionLogger, *LinkedEditingRangeParams) (*LinkedEditingRanges, *jsonrpc.ResponseError)
	TextDocumentMoniker(context.Context, jsonrpc.FunctionLogger, *MonikerParams) ([]Moniker, *jsonrpc.ResponseError)

	Progress(jsonrpc.FunctionLogger, *ProgressParams)
	// CancelRequrest(*jsonrpc.CancelParams) - automatically handled by the rpc library
	Initialized(jsonrpc.FunctionLogger, *InitializedParams)
	Exit(jsonrpc.FunctionLogger)
	SetTrace(jsonrpc.FunctionLogger, *SetTraceParams)
	WindowWorkDoneProgressCancel(jsonrpc.FunctionLogger, *WorkDoneProgressCancelParams)
	WorkspaceDidChangeWorkspaceFolders(jsonrpc.FunctionLogger, *DidChangeWorkspaceFoldersParams)
	WorkspaceDidChangeConfiguration(jsonrpc.FunctionLogger, *DidChangeConfigurationParams)
	WorkspaceDidChangeWatchedFiles(jsonrpc.FunctionLogger, *DidChangeWatchedFilesParams)
	WorkspaceDidCreateFiles(jsonrpc.FunctionLogger, *CreateFilesParams)
	WorkspaceDidRenameFiles(jsonrpc.FunctionLogger, *RenameFilesParams)
	WorkspaceDidDeleteFiles(jsonrpc.FunctionLogger, *DeleteFilesParams)
	TextDocumentDidOpen(jsonrpc.FunctionLogger, *DidOpenTextDocumentParams)
	TextDocumentDidChange(jsonrpc.FunctionLogger, *DidChangeTextDocumentParams)
	TextDocumentWillSave(jsonrpc.FunctionLogger, *WillSaveTextDocumentParams)
	TextDocumentDidSave(jsonrpc.FunctionLogger, *DidSaveTextDocumentParams)
	TextDocumentDidClose(jsonrpc.FunctionLogger, *DidCloseTextDocumentParams)
}

ClientMessagesHandler interface has all the methods that an LSP Server should implement to correctly parse incoming messages

type CodeAction

type CodeAction struct {

	// A short, human-readable, title for this code action.
	Title string `json:"title,required"`

	// The kind of the code action.
	//
	// Used to filter code actions.
	Kind CodeActionKind `json:"kind,omitempty"`

	// The diagnostics that this code action resolves.
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`

	// Marks this as a preferred action. Preferred actions are used by the
	// `auto fix` command and can be targeted by keybindings.
	//
	// A quick fix should be marked preferred if it properly addresses the
	// underlying error. A refactoring should be marked preferred if it is the
	// most reasonable choice of actions to take.
	//
	// @since 3.15.0
	IsPreferred bool `json:"isPreferred,omitempty"`

	// Marks that the code action cannot currently be applied.
	//
	// Clients should follow the following guidelines regarding disabled code
	// actions:
	//
	// - Disabled code actions are not shown in automatic lightbulbs code
	//   action menus.
	//
	// - Disabled actions are shown as faded out in the code action menu when
	//   the user request a more specific type of code action, such as
	//   refactorings.
	//
	// - If the user has a keybinding that auto applies a code action and only
	//   a disabled code actions are returned, the client should show the user
	//   an error message with `reason` in the editor.
	//
	// @since 3.16.0
	Disabled *struct {

		// Human readable description of why the code action is currently
		// disabled.
		//
		// This is displayed in the code actions UI.
		Reason string `json:"reason,required"`
	} `json:"disabled,omitempty"`

	// The workspace edit this code action performs.
	Edit *WorkspaceEdit `json:"edit,omitempty"`

	// A command this code action executes. If a code action
	// provides an edit and a command, first the edit is
	// executed and then the command.
	Command *Command `json:"command,omitempty"`

	// A data entry field that is preserved on a code action between
	// a `textDocument/codeAction` and a `codeAction/resolve` request.
	//
	// @since 3.16.0
	Data json.RawMessage `json:"data,omitempty"`
}

CodeAction A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.

A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.

type CodeActionClientCapabilities

type CodeActionClientCapabilities struct {
	// Whether code action supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports code action literals as a valid
	// response of the `textDocument/codeAction` request.
	//
	// @since 3.8.0
	CodeActionLiteralSupport *struct {
		// The code action kind is supported with the following value
		// set.
		CodeActionKind struct {
			// The code action kind values the client supports. When this
			// property exists the client also guarantees that it will
			// handle values outside its set gracefully and falls back
			// to a default value when unknown.
			ValueSet []CodeActionKind `json:"valueSet"`
		} `json:"codeActionKind"`
	} `json:"codeActionLiteralSupport,omitempty"`

	// Whether code action supports the `isPreferred` property.
	//
	// @since 3.15.0
	IsPreferredSupport bool `json:"isPreferredSupport,omitempty"`

	// Whether code action supports the `disabled` property.
	//
	// @since 3.16.0
	DisabledSupport bool `json:"disabledSupport,omitempty"`

	// Whether code action supports the `data` property which is
	// preserved between a `textDocument/codeAction` and a
	// `codeAction/resolve` request.
	//
	// @since 3.16.0
	DataSupport bool `json:"dataSupport,omitempty"`

	// Whether the client supports resolving additional code action
	// properties via a separate `codeAction/resolve` request.
	//
	// @since 3.16.0
	ResolveSupport *struct {

		// The properties that a client can resolve lazily.
		Properties []string `json:"properties"`
	} `json:"resolveSupport,omitempty"`

	// Whether the client honors the change annotations in
	// text edits and resource operations returned via the
	// `CodeAction#edit` property by for example presenting
	// the workspace edit in the user interface and asking
	// for confirmation.
	//
	// @since 3.16.0
	HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitempty"`
}

type CodeActionContext

type CodeActionContext struct {
	// An array of diagnostics known on the client side overlapping the range
	// provided to the `textDocument/codeAction` request. They are provided so
	// that the server knows which errors are currently presented to the user
	// for the given range. There is no guarantee that these accurately reflect
	// the error state of the resource. The primary parameter
	// to compute code actions is the provided range.
	Diagnostics []Diagnostic `json:"diagnostics,required"`

	// Requested kind of actions to return.
	//
	// Actions not of this kind are filtered out by the client before being
	// shown. So servers can omit computing them.
	Only []CodeActionKind `json:"only,omitempty"`
}

CodeActionContext Contains additional diagnostic information about the context in which a code action is run.

type CodeActionKind

type CodeActionKind string

CodeActionKind The kind of a code action.

Kinds are a hierarchical list of identifiers separated by `.`, e.g. `"refactor.extract.function"`.

The set of kinds is open and client needs to announce the kinds it supports to the server during initialization.

const CodeActionKindEmpty CodeActionKind = ""

CodeActionKindEmpty Empty kind.

const CodeActionKindQuickFix CodeActionKind = "quickfix"

CodeActionKindQuickFix Base kind for quickfix actions: "quickfix".

const CodeActionKindRefactor CodeActionKind = "refactor"

CodeActionKindRefactor Base kind for refactoring actions: "refactor".

const CodeActionKindRefactorExtract CodeActionKind = "refactor.extract"

CodeActionKindRefactorExtract Base kind for refactoring extraction actions: "refactor.extract".

Example extract actions:

- Extract method - Extract function - Extract variable - Extract interface from class - ...

const CodeActionKindRefactorInline CodeActionKind = "refactor.inline"

CodeActionKindRefactorInline Base kind for refactoring inline actions: "refactor.inline".

Example inline actions:

- Inline function - Inline variable - Inline constant - ...

const CodeActionKindRefactorRewrite CodeActionKind = "refactor.rewrite"

CodeActionKindRefactorRewrite Base kind for refactoring rewrite actions: "refactor.rewrite".

Example rewrite actions:

- Convert JavaScript function to class - Add or remove parameter - Encapsulate field - Make method static - Move method to base class - ...

const CodeActionKindSource CodeActionKind = "source"

CodeActionKindSource Base kind for source actions: `source`.

Source code actions apply to the entire file.

const CodeActionKindSourceFixAll CodeActionKind = "source.fixAll"

CodeActionKindSourceFixAll Base kind for a "fix all" source action: `source.fixAll`.

"Fix all" actions automatically fix errors that have a clear fix that do not require user input. They should not suppress errors or perform unsafe fixes such as generating new types or classes.

@since 3.17.0

const CodeActionKindSourceOrganizeImports CodeActionKind = "source.organizeImports"

CodeActionKindSourceOrganizeImports Base kind for an organize imports source action: `source.organizeImports`.

type CodeActionOptions

type CodeActionOptions struct {
	*WorkDoneProgressOptions

	// CodeActionKinds that this server may return.
	//
	// The list of kinds may be generic, such as `CodeActionKind.Refactor`,
	// or the server may list out every specific kind they provide.
	CodeActionKinds []CodeActionKind `json:"codeActionKinds,omitempty"`

	// The server provides support to resolve additional
	// information for a code action.
	//
	// @since 3.16.0
	ResolveProvider bool `json:"resolveProvider,omitempty"`
}

CodeActionOptions boolean | CodeActionOptions

func (*CodeActionOptions) UnmarshalJSON

func (s *CodeActionOptions) UnmarshalJSON(data []byte) error

type CodeActionParams

type CodeActionParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The document in which the command was invoked.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The range for which the command was invoked.
	Range Range `json:"range,required"`

	// Context carrying additional information.
	Context CodeActionContext `json:"context,required"`
}

CodeActionParams Params for the CodeActionRequest

type CodeDescription

type CodeDescription struct {
	// An URI to open with more information about the diagnostic error.
	Href URI `json:"href,required"`
}

CodeDescription Structure to capture a description for an error code.

@since 3.16.0

type CodeLens

type CodeLens struct {
	// The range in which this code lens is valid. Should only span a single
	// line.
	Range Range `json:"range,required"`

	// The command this code lens represents.
	Command *Command `json:"command,omitempty"`

	// A data entry field that is preserved on a code lens item between
	// a code lens and a code lens resolve request.
	Data json.RawMessage `json:"data,omitempty"`
}

CodeLens A code lens represents a command that should be shown along with source text, like the number of references, a way to run tests, etc.

A code lens is _unresolved_ when no command is associated to it. For performance reasons the creation of a code lens and resolving should be done in two stages.

type CodeLensClientCapabilities

type CodeLensClientCapabilities struct {
	// Whether code lens supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type CodeLensOptions

type CodeLensOptions struct {
	*WorkDoneProgressOptions

	// Code lens has a resolve provider as well.
	ResolveProvider bool `json:"resolveProvider,omitempty"`
}

type CodeLensParams

type CodeLensParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The document to request code lens for.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type CodeLensWorkspaceClientCapabilities

type CodeLensWorkspaceClientCapabilities struct {
	// Whether the client implementation supports a refresh request sent from the
	// server to the client.
	//
	// Note that this event is global and will force the client to refresh all
	// code lenses currently shown. It should be used with absolute care and is
	// useful for situation where a server for example detect a project wide
	// change that requires such a calculation.
	RefreshSupport bool `json:"refreshSupport,omitempty"`
}

type Color

type Color struct {
	// The red component of this color in the range [0-1].
	Red float64 `json:"red,required"`

	// The green component of this color in the range [0-1].
	Green float64 `json:"green,required"`

	// The blue component of this color in the range [0-1].
	Blue float64 `json:"blue,required"`

	// The alpha component of this color in the range [0-1].
	Alpha float64 `json:"alpha,required"`
}

Color Represents a color in RGBA space.

type ColorInformation

type ColorInformation struct {
	// The range in the document where this color appears.
	Range Range `json:"range,required"`

	// The actual color value for this color range.
	Color Color `json:"color,required"`
}

type ColorPresentation

type ColorPresentation struct {
	// The label of this color presentation. It will be shown on the color
	// picker header. By default this is also the text that is inserted when
	// selecting this color presentation.
	Label string `json:"label,required"`
	// An [edit](#TextEdit) which is applied to a document when selecting
	// this presentation for the color. When `falsy` the
	// [label](#ColorPresentation.label) is used.
	RextEdit *TextEdit `json:"textEdit,omitempty"`
	// An optional array of additional [text edits](#TextEdit) that are applied
	// when selecting this color presentation. Edits must not overlap with the
	// main [edit](#ColorPresentation.textEdit) nor with themselves.
	AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
}

type ColorPresentationParams

type ColorPresentationParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The text document.
	RextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The color information to request presentations for.
	Color Color `json:"color,required"`

	// The range where the color would be inserted. Serves as a context.
	Range Range `json:"range,required"`
}

type Command

type Command struct {
	// Title of the command, like `save`.
	Title string `json:"title,required"`

	// The identifier of the actual command handler.
	Command string `json:"command,required"`

	// Arguments that the command handler should be
	// invoked with.
	Arguments []json.RawMessage `json:"arguments,omitempty"`
}

type CommandOrCodeAction

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

func (*CommandOrCodeAction) Get

func (c *CommandOrCodeAction) Get() interface{}

func (CommandOrCodeAction) MarshalJSON

func (c CommandOrCodeAction) MarshalJSON() ([]byte, error)

func (*CommandOrCodeAction) Set

func (c *CommandOrCodeAction) Set(value interface{})

func (*CommandOrCodeAction) UnmarshalJSON

func (c *CommandOrCodeAction) UnmarshalJSON(data []byte) error

type CompletionClientCapabilities

type CompletionClientCapabilities struct {
	// Whether completion supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports the following `CompletionItem` specific
	// capabilities.
	CompletionItem *struct {
		// Client supports snippets as insert text.
		//
		// A snippet can define tab stops and placeholders with `$1`, `$2`
		// and `${3:foo}`. `$0` defines the final tab stop, it defaults to
		// the end of the snippet. Placeholders with equal identifiers are
		// linked, that is typing in one will update others too.
		SnippetSupport bool `json:"snippetSupport,omitempty"`

		// Client supports commit characters on a completion item.
		CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"`

		// Client supports the follow content formats for the documentation
		// property. The order describes the preferred format of the client.
		DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`

		// Client supports the deprecated property on a completion item.
		DeprecatedSupport bool `json:"deprecatedSupport,omitempty"`

		// Client supports the preselect property on a completion item.
		PreselectSupport bool `json:"preselectSupport,omitempty"`

		// Client supports the tag property on a completion item. Clients
		// supporting tags have to handle unknown tags gracefully. Clients
		// especially need to preserve unknown tags when sending a completion
		// item back to the server in a resolve call.
		//
		// @since 3.15.0
		TagSupport *struct {
			// The tags supported by the client.
			ValueSet []CompletionItemTag `json:"valueSet"`
		} `json:"tagSupport,omitempty"`

		// Client supports insert replace edit to control different behavior if
		// a completion item is inserted in the text or should replace text.
		//
		// @since 3.16.0
		InsertReplaceSupport bool `json:"insertReplaceSupport,omitempty"`

		// Indicates which properties a client can resolve lazily on a
		// completion item. Before version 3.16.0 only the predefined properties
		// `documentation` and `detail` could be resolved lazily.
		//
		// @since 3.16.0
		ResolveSupport *struct {
			// The properties that a client can resolve lazily.
			Properties []string `json:"properties"`
		} `json:"resolveSupport,omitempty"`

		// The client supports the `insertTextMode` property on
		// a completion item to override the whitespace handling mode
		// as defined by the client (see `insertTextMode`).
		//
		// @since 3.16.0
		InsertTextModeSupport *struct {
			ValueSet []InsertTextMode `json:"valueSet"`
		} `json:"insertTextModeSupport,omitempty"`

		// The client has support for completion item label
		// details (see also `CompletionItemLabelDetails`).
		//
		// @since 3.17.0 - proposed state
		LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
	} `json:"completionItem,omitempty"`

	CompletionItemKind *struct {
		// The completion item kind values the client supports. When this
		// property exists the client also guarantees that it will
		// handle values outside its set gracefully and falls back
		// to a default value when unknown.
		//
		// If this property is not present the client only supports
		// the completion items kinds from `Text` to `Reference` as defined in
		// the initial version of the protocol.
		ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
	} `json:"completionItemKind,omitempty"`

	// The client supports to send additional context information for a
	// `textDocument/completion` request.
	ContextSupport bool `json:"contextSupport,omitempty"`

	// The client's default when the completion item doesn't provide a
	// `insertTextMode` property.
	//
	// @since 3.17.0
	InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
}

type CompletionContext

type CompletionContext struct {
	// How the completion was triggered.
	TriggerKind CompletionTriggerKind `json:"triggerKind,required"`

	// The trigger character (a single character) that has trigger code
	// complete. Is undefined if
	// `triggerKind !== CompletionTriggerKind.TriggerCharacter`
	TriggerCharacter string `json:"triggerCharacter,omitempty"`
}

CompletionContext Contains additional information about the context in which a completion request is triggered.

type CompletionItem

type CompletionItem struct {
	// The label of this completion item.
	//
	// The label property is also by default the text that
	// is inserted when selecting this completion.
	//
	// If label details are provided the label itself should
	// be an unqualified name of the completion item.
	Label string `json:"label,required"`

	// Additional details for the label
	//
	// @since 3.17.0 - proposed state
	LabelDetails *CompletionItemLabelDetails `json:"labelDetails,omitempty"`

	// The kind of this completion item. Based of the kind
	// an icon is chosen by the editor. The standardized set
	// of available values is defined in `CompletionItemKind`.
	Kind CompletionItemKind `json:"kind,omitempty"`

	// Tags for this completion item.
	//
	// @since 3.15.0
	Tags []CompletionItemTag `json:"tags,omitempty"`

	// A human-readable string with additional information
	// about this item, like type or symbol information.
	Detail string `json:"detail,omitempty"`

	// A human-readable string that represents a doc-comment.
	Documentation json.RawMessage `json:"documentation,omitempty"`

	// Indicates if this item is deprecated.
	//
	// @deprecated Use `tags` instead if supported.
	Deprecated bool `json:"deprecated,omitempty"`

	// Select this item when showing.
	//
	// *Note* that only one completion item can be selected and that the
	// tool / client decides which item that is. The rule is that the *first*
	// item of those that match best is selected.
	Preselect bool `json:"preselect,omitempty"`

	// A string that should be used when comparing this item
	// with other items. When `falsy` the label is used
	// as the sort text for this item.
	SortText string `json:"sortText,omitempty"`

	// A string that should be used when filtering a set of
	// completion items. When `falsy` the label is used as the
	// filter text for this item.
	FilterText string `json:"filterText,omitempty"`

	// A string that should be inserted into a document when selecting
	// this completion. When `falsy` the label is used as the insert text
	// for this item.
	//
	// The `insertText` is subject to interpretation by the client side.
	// Some tools might not take the string literally. For example
	// VS Code when code complete is requested in this example
	// `con<cursor position>` and a completion item with an `insertText` of
	// `console` is provided it will only insert `sole`. Therefore it is
	// recommended to use `textEdit` instead since it avoids additional client
	// side interpretation.
	InsertText string `json:"insertText,omitempty"`

	// The format of the insert text. The format applies to both the
	// `insertText` property and the `newText` property of a provided
	// `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
	InsertTextFormat InsertTextFormat `json:"insertTextFormat,omitempty"`

	// How whitespace and indentation is handled during completion
	// item insertion. If not provided the client's default value depends on
	// the `textDocument.completion.insertTextMode` client capability.
	//
	// @since 3.16.0
	// @since 3.17.0 - support for `textDocument.completion.insertTextMode`
	InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`

	// An edit which is applied to a document when selecting this completion.
	// When an edit is provided the value of `insertText` is ignored.
	//
	// *Note:* The range of the edit must be a single line range and it must
	// contain the position at which completion has been requested.
	//
	// Most editors support two different operations when accepting a completion
	// item. One is to insert a completion text and the other is to replace an
	// existing text with a completion text. Since this can usually not be
	// predetermined by a server it can report both ranges. Clients need to
	// signal support for `InsertReplaceEdit`s via the
	// `textDocument.completion.completionItem.insertReplaceSupport` client
	// capability property.
	//
	// *Note 1:* The text edit's range as well as both ranges from an insert
	// replace edit must be a [single line] and they must contain the position
	// at which completion has been requested.
	// *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
	// must be a prefix of the edit's replace range, that means it must be
	// contained and starting at the same position.
	//
	// @since 3.16.0 additional type `InsertReplaceEdit`
	// TODO: TextEdit?: TextEdit | InsertReplaceEdit
	TextEdit *TextEdit `json:"textEdit,omitempty"`

	// An optional array of additional text edits that are applied when
	// selecting this completion. Edits must not overlap (including the same
	// insert position) with the main edit nor with themselves.
	//
	// Additional text edits should be used to change text unrelated to the
	// current cursor position (for example adding an import statement at the
	// top of the file if the completion item will insert an unqualified type).
	AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`

	// An optional set of characters that when pressed while this completion is
	// active will accept it first and then type that character. *Note* that all
	// commit characters should have `length=1` and that superfluous characters
	// will be ignored.
	CommitCharacters []string `json:"commitCharacters,omitempty"`

	// An optional command that is executed *after* inserting this completion.
	// *Note* that additional modifications to the current document should be
	// described with the additionalTextEdits-property.
	Command *Command `json:"command,omitempty"`

	// A data entry field that is preserved on a completion item between
	// a completion and a completion resolve request.
	Data json.RawMessage `json:"data,omitempty"`
}

type CompletionItemKind

type CompletionItemKind int

CompletionItemKind The kind of a completion entry.

const CompletionItemKindClass CompletionItemKind = 7
const CompletionItemKindColor CompletionItemKind = 16
const CompletionItemKindConstant CompletionItemKind = 21
const CompletionItemKindConstructor CompletionItemKind = 4
const CompletionItemKindEnum CompletionItemKind = 13
const CompletionItemKindEnumMember CompletionItemKind = 20
const CompletionItemKindEvent CompletionItemKind = 23
const CompletionItemKindField CompletionItemKind = 5
const CompletionItemKindFile CompletionItemKind = 17
const CompletionItemKindFolder CompletionItemKind = 19
const CompletionItemKindFunction CompletionItemKind = 3
const CompletionItemKindInterface CompletionItemKind = 8
const CompletionItemKindKeyword CompletionItemKind = 14
const CompletionItemKindMethod CompletionItemKind = 2
const CompletionItemKindModule CompletionItemKind = 9
const CompletionItemKindOperator CompletionItemKind = 24
const CompletionItemKindProperty CompletionItemKind = 10
const CompletionItemKindReference CompletionItemKind = 18
const CompletionItemKindSnippet CompletionItemKind = 15
const CompletionItemKindStruct CompletionItemKind = 22
const CompletionItemKindText CompletionItemKind = 1
const CompletionItemKindTypeParameter CompletionItemKind = 25
const CompletionItemKindUnit CompletionItemKind = 11
const CompletionItemKindValue CompletionItemKind = 12
const CompletionItemKindVariable CompletionItemKind = 6

type CompletionItemLabelDetails

type CompletionItemLabelDetails struct {
	// An optional string which is rendered less prominently directly after
	// {@link CompletionItemLabel.label label}, without any spacing. Should be
	// used for function signatures or type annotations.
	Detail string `json:"detail,omitempty"`

	// An optional string which is rendered less prominently after
	// {@link CompletionItemLabel.detail}. Should be used for fully qualified
	// names or file path.
	Description string `json:"description,omitempty"`
}

CompletionItemLabelDetails Additional details for a completion item label.

@since 3.17.0 - proposed state

type CompletionItemOptions

type CompletionItemOptions struct {
	// The server has support for completion item label
	// details (see also `CompletionItemLabelDetails`) when receiving
	// a completion item in a resolve call.
	//
	// @since 3.17.0 - proposed state
	LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
}

type CompletionItemTag

type CompletionItemTag int

CompletionItemTag Completion item tags are extra annotations that tweak the rendering of a completion item.

@since 3.15.0

const CompletionItemTagDeprecated CompletionItemTag = 1

CompletionItemTagDeprecated Render a completion as obsolete, usually using a strike-out.

type CompletionKindCapabilities

type CompletionKindCapabilities struct {
	// Whether completion supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports the following `CompletionItem` specific
	// capabilities.
	CompletionItem *struct {
		// Client supports snippets as insert text.
		//
		// A snippet can define tab stops and placeholders with `$1`, `$2`
		// and `${3:foo}`. `$0` defines the final tab stop, it defaults to
		// the end of the snippet. Placeholders with equal identifiers are
		// linked, that is typing in one will update others too.
		SnippetSupport bool `json:"snippetSupport,omitempty"`

		// Client supports commit characters on a completion item.
		CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"`

		// Client supports the follow content formats for the documentation
		// property. The order describes the preferred format of the client.
		DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`

		// Client supports the deprecated property on a completion item.
		DeprecatedSupport bool `json:"deprecatedSupport,omitempty"`

		// Client supports the preselect property on a completion item.
		PreselectSupport bool `json:"preselectSupport,omitempty"`

		// Client supports the tag property on a completion item. Clients
		// supporting tags have to handle unknown tags gracefully. Clients
		// especially need to preserve unknown tags when sending a completion
		// item back to the server in a resolve call.
		//
		// @since 3.15.0
		TagSupport *struct {
			// The tags supported by the client.
			ValueSet []CompletionItemTag `json:"valueSet"`
		} `json:"tagSupport,omitempty"`

		// Client supports insert replace edit to control different behavior if
		// a completion item is inserted in the text or should replace text.
		//
		// @since 3.16.0
		InsertReplaceSupport bool `json:"insertReplaceSupport,omitempty"`

		// Indicates which properties a client can resolve lazily on a
		// completion item. Before version 3.16.0 only the predefined properties
		// `documentation` and `detail` could be resolved lazily.
		//
		// @since 3.16.0
		ResolveSupport *struct {
			// The properties that a client can resolve lazily.
			Properties []string `json:"properties"`
		} `json:"resolveSupport,omitempty"`

		// The client supports the `insertTextMode` property on
		// a completion item to override the whitespace handling mode
		// as defined by the client (see `insertTextMode`).
		//
		// @since 3.16.0
		InsertTextModeSupport *struct {
			ValueSet []InsertTextMode `json:"valueSet"`
		} `json:"insertTextModeSupport,omitempty"`

		// The client has support for completion item label
		// details (see also `CompletionItemLabelDetails`).
		//
		// @since 3.17.0 - proposed state
		LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
	} `json:"completionItem,omitempty"`

	CompletionItemKind *struct {
		// The completion item kind values the client supports. When this
		// property exists the client also guarantees that it will
		// handle values outside its set gracefully and falls back
		// to a default value when unknown.
		//
		// If this property is not present the client only supports
		// the completion items kinds from `Text` to `Reference` as defined in
		// the initial version of the protocol.
		ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
	} `json:"completionItemKind,omitempty"`

	// The client supports to send additional context information for a
	// `textDocument/completion` request.
	ContextSupport bool `json:"contextSupport,omitempty"`

	// The client's default when the completion item doesn't provide a
	// `insertTextMode` property.
	//
	// @since 3.17.0
	InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
}

type CompletionList

type CompletionList struct {
	// This list is not complete. Further typing should result in recomputing
	// this list.
	//
	// Recomputed lists have all their items replaced (not appended) in the
	// incomplete completion sessions.
	IsIncomplete bool `json:"isIncomplete,required"`

	// The completion items.
	Items []CompletionItem `json:"items,required"`
}

CompletionList Represents a collection of [completion items](#CompletionItem) to be presented in the editor.

type CompletionOptions

type CompletionOptions struct {
	WorkDoneProgressOptions

	// Most tools trigger completion request automatically without explicitly
	// requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they
	// do so when the user starts to type an identifier. For example if the user
	// types `c` in a JavaScript file code complete will automatically pop up
	// present `console` besides others as a completion item. Characters that
	// make up identifiers don't need to be listed here.
	//
	// If code complete should automatically be trigger on characters not being
	// valid inside an identifier (for example `.` in JavaScript) list them in
	// `triggerCharacters`.
	TriggerCharacters []string `json:"triggerCharacters,omitempty"`

	// The list of all possible characters that commit a completion. This field
	// can be used if clients don't support individual commit characters per
	// completion item. See client capability
	// `completion.completionItem.commitCharactersSupport`.
	//
	// If a server provides both `allCommitCharacters` and commit characters on
	// an individual completion item the ones on the completion item win.
	//
	// @since 3.2.0
	AllCommitCharacters []string `json:"allCommitCharacters,omitempty"`

	// The server provides support to resolve additional
	// information for a completion item.
	ResolveProvider bool `json:"resolveProvider,omitempty"`

	// The server supports the following `CompletionItem` specific
	// capabilities.
	//
	// @since 3.17.0 - proposed state
	CompletionItem *CompletionItemOptions `json:"completionItem,omitempty"`
}

type CompletionParams

type CompletionParams struct {
	TextDocumentPositionParams
	*WorkDoneProgressParams
	*PartialResultParams

	// The completion context. This is only available if the client specifies
	// to send this using the client capability
	// `completion.contextSupport === true`
	Context *CompletionContext `json:"context,omitempty"`
}

type CompletionTriggerKind

type CompletionTriggerKind int

CompletionTriggerKind How a completion was triggered

const CompletionTriggerKindInvoked CompletionTriggerKind = 1

CompletionTriggerKindInvoked Completion was triggered by typing an identifier (24x7 code complete), manual invocation (e.g Ctrl+Space) or via API.

const CompletionTriggerKindTriggerCharacter CompletionTriggerKind = 2

CompletionTriggerKindTriggerCharacter Completion was triggered by a trigger character specified by the `triggerCharacters` properties of the `CompletionRegistrationOptions`.

const CompletionTriggerKindTriggerForIncompleteCompletions CompletionTriggerKind = 3

CompletionTriggerKindTriggerForIncompleteCompletions Completion was re-triggered as the current completion list is incomplete.

type ConfigurationItem

type ConfigurationItem struct {
	// The scope to get the configuration section for.
	ScopeURI DocumentURI `json:"scopeUri,omitempty"`

	// The configuration section asked for.
	Section string `json:"section,omitempty"`
}

type ConfigurationParams

type ConfigurationParams struct {
	Items []ConfigurationItem `json:"items,required"`
}

type CreateFilesParams

type CreateFilesParams struct {
	// An array of all files/folders created in this operation.
	Files []FileCreate `json:"files,required"`
}

CreateFilesParams The parameters sent in notifications/requests for user-initiated creation of files.

@since 3.16.0

type CustomNotification

type CustomNotification func(logger jsonrpc.FunctionLogger, req json.RawMessage)

CustomNotification is a function type for incoming custom notifications callbacks

type CustomRequest

type CustomRequest func(ctx context.Context, logger jsonrpc.FunctionLogger, req json.RawMessage) (res interface{}, err *jsonrpc.ResponseError)

CustomRequest is a function type for incoming custom requests callbacks

type DeclarationClientCapabilities

type DeclarationClientCapabilities struct {
	// Whether declaration supports dynamic registration. If this is set to
	// `true` the client supports the new `DeclarationRegistrationOptions`
	// return value for the corresponding server capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports additional metadata in the form of declaration links.
	LinkSupport bool `json:"linkSupport,omitempty"`
}

type DeclarationOptions

DeclarationOptions boolean|DeclarationOptions|DeclarationRegistrationOptions

func (*DeclarationOptions) UnmarshalJSON

func (s *DeclarationOptions) UnmarshalJSON(data []byte) error

type DefinitionClientCapabilities

type DefinitionClientCapabilities struct {
	// Whether definition supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports additional metadata in the form of definition links.
	//
	// @since 3.14.0
	LinkSupport bool `json:"linkSupport,omitempty"`
}

type DefinitionOptions

type DefinitionOptions struct {
	*WorkDoneProgressOptions
}

DefinitionOptions boolean|DefinitionOptions

func (*DefinitionOptions) UnmarshalJSON

func (s *DefinitionOptions) UnmarshalJSON(data []byte) error

type DeleteFilesParams

type DeleteFilesParams struct {
	// An array of all files/folders deleted in this operation.
	Files []FileDelete `json:"files,required"`
}

DeleteFilesParams The parameters sent in notifications/requests for user-initiated deletes of files.

@since 3.16.0

type Diagnostic

type Diagnostic struct {
	// The range at which the message applies.
	Range Range `json:"range,required"`

	// The diagnostic's severity. Can be omitted. If omitted it is up to the
	// client to interpret diagnostics as error, warning, info or hint.
	Severity DiagnosticSeverity `json:"severity,omitempty"`

	// The diagnostic's code, which might appear in the user interface.
	// integer | string
	Code json.RawMessage `json:"code,omitempty"`

	// An optional property to describe the error code.
	//
	// @since 3.16.0
	CodeDescription *CodeDescription `json:"codeDescription,omitempty"`

	// A human-readable string describing the source of this
	// diagnostic, e.g. 'typescript' or 'super lint'.
	Source string `json:"source,omitempty"`

	// The diagnostic's message.
	Message string `json:"message,required"`

	// Additional metadata about the diagnostic.
	//
	// @since 3.15.0
	Tags []DiagnosticTag `json:"tags,omitempty"`

	// An array of related diagnostic information, e.g. when symbol-names within
	// a scope collide all definitions can be marked via this property.
	RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitempty"`

	// A data entry field that is preserved between a
	// `textDocument/publishDiagnostics` notification and
	// `textDocument/codeAction` request.
	//
	// @since 3.16.0
	Data json.RawMessage `json:"data,omitempty"`
}

type DiagnosticRelatedInformation

type DiagnosticRelatedInformation struct {
	// The location of this related diagnostic information.
	Location Location `json:"location,required"`

	// The message of this related diagnostic information.
	Message string `json:"message,required"`
}

DiagnosticRelatedInformation Represents a related message and source code location for a diagnostic. This should be used to point to code locations that cause or are related to a diagnostics, e.g when duplicating a symbol in a scope.

type DiagnosticSeverity

type DiagnosticSeverity int
const DiagnosticSeverityError DiagnosticSeverity = 1

DiagnosticSeverityError Reports an error.

const DiagnosticSeverityHint DiagnosticSeverity = 4

DiagnosticSeverityHint Reports a hint.

const DiagnosticSeverityInformation DiagnosticSeverity = 3

DiagnosticSeverityInformation Reports an information.

const DiagnosticSeverityWarning DiagnosticSeverity = 2

DiagnosticSeverityWarning Reports a warning.

func (DiagnosticSeverity) String

func (ds DiagnosticSeverity) String() string

type DiagnosticTag

type DiagnosticTag int

DiagnosticTag The diagnostic tags.

@since 3.15.0

const DiagnosticTagDeprecated DiagnosticTag = 2

DiagnosticTagDeprecated Deprecated or obsolete code.

Clients are allowed to rendered diagnostics with this tag strike through.

const DiagnosticTagUnnecessary DiagnosticTag = 1

DiagnosticTagUnnecessary Unused or unnecessary code.

Clients are allowed to render diagnostics with this tag faded out instead of having an error squiggle.

func (DiagnosticTag) String

func (dt DiagnosticTag) String() string

type DidChangeConfigurationClientCapabilities

type DidChangeConfigurationClientCapabilities struct {
	// Did change configuration notification supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DidChangeConfigurationParams

type DidChangeConfigurationParams struct {
	// The actual changed settings
	Settings json.RawMessage `json:"settings,required"`
}

type DidChangeTextDocumentParams

type DidChangeTextDocumentParams struct {
	// The document that did change. The version number points
	// to the version after all provided content changes have
	// been applied.
	TextDocument VersionedTextDocumentIdentifier `json:"textDocument,required"`

	// The actual content changes. The content changes describe single state
	// changes to the document. So if there are two content changes c1 (at
	// array index 0) and c2 (at array index 1) for a document in state S then
	// c1 moves the document from S to S' and c2 from S' to S”. So c1 is
	// computed on the state S and c2 is computed on the state S'.
	//
	// To mirror the content of a document using change events use the following
	// approach:
	// - start with the same initial content
	// - apply the 'textDocument/didChange' notifications in the order you
	//   receive them.
	// - apply the `TextDocumentContentChangeEvent`s in a single notification
	//   in the order you receive them.
	ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges,required"`
}

type DidChangeWatchedFilesClientCapabilities

type DidChangeWatchedFilesClientCapabilities struct {
	// Did change watched files notification supports dynamic registration.
	// Please note that the current protocol doesn't support static
	// configuration for file changes from the server side.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DidChangeWatchedFilesParams

type DidChangeWatchedFilesParams struct {
	// The actual file events.
	Changes []FileEvent `json:"changes,required"`
}

type DidChangeWorkspaceFoldersParams

type DidChangeWorkspaceFoldersParams struct {
	// The actual workspace folder change event.
	Event WorkspaceFoldersChangeEvent `json:"event,required"`
}

type DidCloseTextDocumentParams

type DidCloseTextDocumentParams struct {
	// The document that was closed.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type DidOpenTextDocumentParams

type DidOpenTextDocumentParams struct {
	// The document that was opened.
	TextDocument TextDocumentItem `json:"textDocument,required"`
}

type DidSaveTextDocumentParams

type DidSaveTextDocumentParams struct {
	// The document that was saved.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// Optional the content when saved. Depends on the includeText value
	// when the save notification was requested.
	Text string `json:"text,omitempty"`
}

type DocumentColorClientCapabilities

type DocumentColorClientCapabilities struct {
	// Whether document color supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DocumentColorOptions

DocumentColorOptions boolean | DocumentColorOptions | DocumentColorRegistrationOptions

func (*DocumentColorOptions) UnmarshalJSON

func (s *DocumentColorOptions) UnmarshalJSON(data []byte) error

type DocumentColorParams

type DocumentColorParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The text document.
	RextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type DocumentFilter

type DocumentFilter struct {
	// A language id, like `typescript`.
	Language string `json:"language,omitempty"`

	// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
	Scheme string `json:"scheme,omitempty"`

	// A glob pattern, like `*.{ts,js}`.
	//
	// Glob patterns can have the following syntax:
	// - `*` to match one or more characters in a path segment
	// - `?` to match on one character in a path segment
	// - `**` to match any number of path segments, including none
	// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}`
	//   matches all TypeScript and JavaScript files)
	// - `[]` to declare a range of characters to match in a path segment
	//   (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
	// - `[!...]` to negate a range of characters to match in a path segment
	//   (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
	//   not `example.0`)
	Pattern string `json:"pattern,omitempty"`
}

type DocumentFormattingClientCapabilities

type DocumentFormattingClientCapabilities struct {
	// Whether formatting supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DocumentFormattingOptions

type DocumentFormattingOptions struct {
	*WorkDoneProgressOptions
}

DocumentFormattingOptions boolean | DocumentFormattingOptions

func (*DocumentFormattingOptions) UnmarshalJSON

func (s *DocumentFormattingOptions) UnmarshalJSON(data []byte) error

type DocumentFormattingParams

type DocumentFormattingParams struct {
	*WorkDoneProgressParams

	// The document to format.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The format options.
	Options FormattingOptions `json:"options,required"`
}

type DocumentHighlight

type DocumentHighlight struct {
	// The range this highlight applies to.
	Range Range `json:"range,required"`

	// The highlight kind, default is DocumentHighlightKind.Text.
	Kind DocumentHighlightKind `json:"kind,omitempty"`
}

DocumentHighlight A document highlight is a range inside a text document which deserves special attention. Usually a document highlight is visualized by changing the background color of its range.

type DocumentHighlightClientCapabilities

type DocumentHighlightClientCapabilities struct {
	// Whether document highlight supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DocumentHighlightKind

type DocumentHighlightKind int

DocumentHighlightKind A document highlight kind.

const DocumentHighlightKindRead DocumentHighlightKind = 2

DocumentHighlightKindRead Read-access of a symbol, like reading a variable.

const DocumentHighlightKindText DocumentHighlightKind = 1

DocumentHighlightKindText A textual occurrence.

const DocumentHighlightKindWrite DocumentHighlightKind = 3

DocumentHighlightKindWrite Write-access of a symbol, like writing to a variable.

type DocumentHighlightOptions

type DocumentHighlightOptions struct {
	*WorkDoneProgressOptions
}

DocumentHighlightOptions boolean | DocumentHighlightOptions

func (*DocumentHighlightOptions) UnmarshalJSON

func (s *DocumentHighlightOptions) UnmarshalJSON(data []byte) error
type DocumentLink struct {
	// The range this link applies to.
	Range Range `json:"range,required"`

	// The uri this link points to. If missing a resolve request is sent later.
	Target DocumentURI `json:"target,omitempty"`

	// The tooltip text when you hover over this link.
	//
	// If a tooltip is provided, is will be displayed in a string that includes
	// instructions on how to trigger the link, such as `{0} (ctrl + click)`.
	// The specific instructions vary depending on OS, user settings, and
	// localization.
	//
	// @since 3.15.0
	Tooltip string `json:"tooltip,omitempty"`

	// A data entry field that is preserved on a document link between a
	// DocumentLinkRequest and a DocumentLinkResolveRequest.
	Data json.RawMessage `json:"data,omitempty"`
}

DocumentLink A document link is a range in a text document that links to an internal or external resource, like another text document or a web site.

type DocumentLinkClientCapabilities

type DocumentLinkClientCapabilities struct {
	// Whether document link supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// Whether the client supports the `tooltip` property on `DocumentLink`.
	//
	// @since 3.15.0
	TooltipSupport bool `json:"tooltipSupport,omitempty"`
}

type DocumentLinkOptions

type DocumentLinkOptions struct {
	*WorkDoneProgressOptions

	// Document links have a resolve provider as well.
	ResolveProvider bool `json:"resolveProvider,omitempty"`
}

type DocumentLinkParams

type DocumentLinkParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The document to provide document links for.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type DocumentOnTypeFormattingClientCapabilities

type DocumentOnTypeFormattingClientCapabilities struct {
	// Whether on type formatting supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DocumentOnTypeFormattingOptions

type DocumentOnTypeFormattingOptions struct {
	// A character on which formatting should be triggered, like `}`.
	FirstTriggerCharacter string `json:"firstTriggerCharacter,required"`

	// More trigger characters.
	MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"`
}

type DocumentOnTypeFormattingParams

type DocumentOnTypeFormattingParams struct {
	TextDocumentPositionParams

	// The character that has been typed.
	Ch string `json:"ch,required"`

	// The format options.
	Options FormattingOptions `json:"options,required"`
}

type DocumentRangeFormattingClientCapabilities

type DocumentRangeFormattingClientCapabilities struct {
	// Whether formatting supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type DocumentRangeFormattingOptions

type DocumentRangeFormattingOptions struct {
	*WorkDoneProgressOptions
}

DocumentRangeFormattingOptions boolean | DocumentFormattingOptions

func (*DocumentRangeFormattingOptions) UnmarshalJSON

func (s *DocumentRangeFormattingOptions) UnmarshalJSON(data []byte) error

type DocumentRangeFormattingParams

type DocumentRangeFormattingParams struct {
	*WorkDoneProgressParams

	// The document to format.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The range to format
	Range Range `json:"range,required"`

	// The format options
	Options FormattingOptions `json:"options,required"`
}

type DocumentSelector

type DocumentSelector []DocumentFilter

type DocumentSymbol

type DocumentSymbol struct {

	// The name of this symbol. Will be displayed in the user interface and
	// therefore must not be an empty string or a string only consisting of
	// white spaces.
	Name string `json:"name,required"`

	// More detail for this symbol, e.g the signature of a function.
	Detail string `json:"detail,omitempty"`

	// The kind of this symbol.
	Kind SymbolKind `json:"kind,required"`

	// Tags for this document symbol.
	//
	// @since 3.16.0
	Tags []SymbolTag `json:"tags,omitempty"`

	// Indicates if this symbol is deprecated.
	//
	// @deprecated Use tags instead
	Deprecated bool `json:"deprecated,omitempty"`

	// The range enclosing this symbol not including leading/trailing whitespace
	// but everything else like comments. This information is typically used to
	// determine if the clients cursor is inside the symbol to reveal in the
	// symbol in the UI.
	Range Range `json:"range,required"`

	// The range that should be selected and revealed when this symbol is being
	// picked, e.g. the name of a function. Must be contained by the `range`.
	SelectionRange Range `json:"selectionRange,required"`

	// Children of this symbol, e.g. properties of a class.
	Children []DocumentSymbol `json:"children,omitempty"`
}

DocumentSymbol Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range, e.g. the range of an identifier.

type DocumentSymbolClientCapabilities

type DocumentSymbolClientCapabilities struct {
	// Whether document symbol supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// Specific capabilities for the `SymbolKind` in the
	// `textDocument/documentSymbol` request.
	SymbolKind *struct {
		// The symbol kind values the client supports. When this
		// property exists the client also guarantees that it will
		// handle values outside its set gracefully and falls back
		// to a default value when unknown.
		//
		// If this property is not present the client only supports
		// the symbol kinds from `File` to `Array` as defined in
		// the initial version of the protocol.
		ValueSet []SymbolKind `json:"valueSet,omitempty"`
	} `json:"symbolKind,omitempty"`

	// The client supports hierarchical document symbols.
	HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`

	// The client supports tags on `SymbolInformation`. Tags are supported on
	// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.
	// Clients supporting tags have to handle unknown tags gracefully.
	//
	// @since 3.16.0
	TagSupport *struct {
		// The tags supported by the client.
		ValueSet []SymbolTag `json:"valueSet"`
	} `json:"tagSupport,omitempty"`

	// The client supports an additional label presented in the UI when
	// registering a document symbol provider.
	//
	// @since 3.16.0
	LabelSupport bool `json:"labelSupport,omitempty"`
}

type DocumentSymbolOptions

type DocumentSymbolOptions struct {
	*WorkDoneProgressOptions

	// A human-readable string that is shown when multiple outlines trees
	// are shown for the same document.
	//
	// @since 3.16.0
	Label string `json:"label,omitempty"`
}

DocumentSymbolOptions boolean | DocumentSymbolOptions

func (*DocumentSymbolOptions) UnmarshalJSON

func (s *DocumentSymbolOptions) UnmarshalJSON(data []byte) error

type DocumentSymbolParams

type DocumentSymbolParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The text document.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type DocumentURI

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

DocumentURI Many of the interfaces contain fields that correspond to the URI of a document. For clarity, the type of such a field is declared as a DocumentUri. Over the wire, it will still be transferred as a string, but this guarantees that the contents of that string can be parsed as a valid URI.

func NewDocumentURI

func NewDocumentURI(path string) DocumentURI

NewDocumentURI create a DocumentURI from the given string path

func NewDocumentURIFromPath

func NewDocumentURIFromPath(path *paths.Path) DocumentURI

NewDocumentURIFromPath create a DocumentURI from the given Path object

func NewDocumentURIFromURL

func NewDocumentURIFromURL(inURL string) (DocumentURI, error)

NewDocumentURIFromURL converts an URL into a DocumentURI

func (DocumentURI) AsPath

func (uri DocumentURI) AsPath() *paths.Path

AsPath convert the DocumentURI to a paths.Path

func (DocumentURI) Ext

func (uri DocumentURI) Ext() string

Ext returns the extension of the file pointed by the URI

func (DocumentURI) MarshalJSON

func (uri DocumentURI) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaller interface

func (DocumentURI) MarshalText

func (uri DocumentURI) MarshalText() (text []byte, err error)

func (DocumentURI) String

func (uri DocumentURI) String() string

func (*DocumentURI) UnmarshalJSON

func (uri *DocumentURI) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaller interface

func (*DocumentURI) UnmarshalText

func (uri *DocumentURI) UnmarshalText(text []byte) error

type ExecuteCommandClientCapabilities

type ExecuteCommandClientCapabilities struct {
	// Execute command supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type ExecuteCommandOptions

type ExecuteCommandOptions struct {
	*WorkDoneProgressOptions

	// The commands to be executed on the server
	Commands []string `json:"commands"`
}

type ExecuteCommandParams

type ExecuteCommandParams struct {
	*WorkDoneProgressParams

	// The identifier of the actual command handler.
	Command string `json:"command,required"`

	// Arguments that the command should be invoked with.
	Arguments []interface{} `json:"arguments,required"`
}

type FailureHandlingKind

type FailureHandlingKind string
const FailureHandlingKindAbort FailureHandlingKind = "abort"

FailureHandlingKindAbort Applying the workspace change is simply aborted if one of the changes provided fails. All operations executed before the failing operation stay executed.

const FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"

FailureHandlingKindTextOnlyTransactional If the workspace edit contains only textual file changes they are executed transactional. If resource changes (create, rename or delete file) are part of the change the failure handling strategy is abort.

const FailureHandlingKindTransactional FailureHandlingKind = "transactional"

FailureHandlingKindTransactional All operations are executed transactional. That means they either all succeed or no changes at all are applied to the workspace.

const FailureHandlingKindUndo FailureHandlingKind = "undo"

FailureHandlingKindUndo The client tries to undo the operations already executed. But there is no guarantee that this is succeeding.

type FileCreate

type FileCreate struct {
	// A file:// URI for the location of the file/folder being created.
	URI string `json:"uri,required"`
}

FileCreate Represents information on a file/folder create.

@since 3.16.0

type FileDelete

type FileDelete struct {
	// A file:// URI for the location of the file/folder being deleted.
	URI string `json:"uri,required"`
}

FileDelete Represents information on a file/folder delete.

@since 3.16.0

type FileEvent

type FileEvent struct {
	// The file's URI.
	URI DocumentURI `json:"uri,required"`

	// The change type.
	Type int `json:"type,required"`
}

FileEvent An event describing a file change.

type FileOperationFilter

type FileOperationFilter struct {
	// A Uri like `file` or `untitled`.
	Scheme string `json:"scheme,omitempty"`

	// The actual file operation pattern.
	Pattern FileOperationPattern `json:"pattern"`
}

FileOperationFilter A filter to describe in which file operation requests or notifications the server is interested in.

@since 3.16.0

type FileOperationPattern

type FileOperationPattern struct {
	// The glob pattern to match. Glob patterns can have the following syntax:
	// - `*` to match one or more characters in a path segment
	// - `?` to match on one character in a path segment
	// - `**` to match any number of path segments, including none
	// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}`
	//   matches all TypeScript and JavaScript files)
	// - `[]` to declare a range of characters to match in a path segment
	//   (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
	// - `[!...]` to negate a range of characters to match in a path segment
	//   (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
	//   not `example.0`)
	Glob string `json:"glob"`

	// Whether to match files or folders with this pattern.
	//
	// Matches both if undefined.
	Matches *FileOperationPatternKind `json:"matches,omitempty"`

	// Additional options used during matching.
	Options *FileOperationPatternOptions `json:"options,omitempty"`
}

FileOperationPattern A pattern to describe in which file operation requests or notifications the server is interested in.

@since 3.16.0

type FileOperationPatternKind

type FileOperationPatternKind string

FileOperationPatternKind A pattern kind describing if a glob pattern matches a file a folder or both.

@since 3.16.0

const FileOperationPatternKindFile FileOperationPatternKind = "file"

FileOperationPatternKindFile The pattern matches a file only.

const FileOperationPatternKindFolder FileOperationPatternKind = "folder"

FileOperationPatternKindFolder The pattern matches a folder only.

type FileOperationPatternOptions

type FileOperationPatternOptions struct {
	// The pattern should be matched ignoring casing.
	IgnoreCase bool `json:"ignoreCase,omitempty"`
}

FileOperationPatternOptions Matching options for the file operation pattern.

@since 3.16.0

type FileOperationRegistrationOptions

type FileOperationRegistrationOptions struct {
	// The actual filters.
	Filters []FileOperationFilter `json:"filters"`
}

FileOperationRegistrationOptions The options to register for file operations.

@since 3.16.0

type FileRename

type FileRename struct {
	// A file:// URI for the original location of the file/folder being renamed.
	OldURI string `json:"oldUri,required"`

	// A file:// URI for the new location of the file/folder being renamed.
	NewURI string `json:"newUri,required"`
}

FileRename Represents information on a file/folder rename.

@since 3.16.0

type FoldingRange

type FoldingRange struct {

	// The zero-based start line of the range to fold. The folded area starts
	// after the line's last character. To be valid, the end must be zero or
	// larger and smaller than the number of lines in the document.
	StartLine int `json:"startLine,required"`

	// The zero-based character offset from where the folded range starts. If
	// not defined, defaults to the length of the start line.
	StartCharacter *int `json:"startCharacter,omitempty"`

	// The zero-based end line of the range to fold. The folded area ends with
	// the line's last character. To be valid, the end must be zero or larger
	// and smaller than the number of lines in the document.
	EndLine int `json:"endLine,required"`

	// The zero-based character offset before the folded range ends. If not
	// defined, defaults to the length of the end line.
	EndCharacter *int `json:"endCharacter,omitempty"`

	// Describes the kind of the folding range such as `comment` or `region`.
	// The kind is used to categorize folding ranges and used by commands like
	// 'Fold all comments'. See [FoldingRangeKind](#FoldingRangeKind) for an
	// enumeration of standardized kinds.
	Kind string `json:"kind,omitempty"`
}

FoldingRange Represents a folding range. To be valid, start and end line must be bigger than zero and smaller than the number of lines in the document. Clients are free to ignore invalid ranges.

type FoldingRangeClientCapabilities

type FoldingRangeClientCapabilities struct {
	// Whether implementation supports dynamic registration for folding range
	// providers. If this is set to `true` the client supports the new
	// `FoldingRangeRegistrationOptions` return value for the corresponding
	// server capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The maximum number of folding ranges that the client prefers to receive
	// per document. The value serves as a hint, servers are free to follow the
	// limit.
	RangeLimit *int `json:"rangeLimit,omitempty"`

	// If set, the client signals that it only supports folding complete lines.
	// If set, client will ignore specified `startCharacter` and `endCharacter`
	// properties in a FoldingRange.
	LineFoldingOnly bool `json:"lineFoldingOnly,omitempty"`
}

type FoldingRangeKind

type FoldingRangeKind string

FoldingRangeKind Enum of known range kinds

const FoldingRangeKindComment FoldingRangeKind = "comment"

FoldingRangeKindComment Folding range for a comment

const FoldingRangeKindImports FoldingRangeKind = "imports"

FoldingRangeKindImports Folding range for a imports or includes

const FoldingRangeKindRegion FoldingRangeKind = "region"

FoldingRangeKindRegion Folding range for a region (e.g. `#region`)

type FoldingRangeOptions

FoldingRangeOptions boolean | FoldingRangeOptions | FoldingRangeRegistrationOptions

func (*FoldingRangeOptions) UnmarshalJSON

func (s *FoldingRangeOptions) UnmarshalJSON(data []byte) error

type FoldingRangeParams

type FoldingRangeParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The text document.
	RextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type FormattingOptions

type FormattingOptions map[string]interface{}

type Hover

type Hover struct {
	// The hover's content
	Contents MarkupContent `json:"contents,required"`

	// An optional range is a range inside a text document
	// that is used to visualize a hover, e.g. by changing the background color.
	Range *Range `json:"range,omitempty"`
}

Hover The result of a hover request.

type HoverClientCapabilities

type HoverClientCapabilities struct {
	// Whether hover supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// Client supports the follow content formats if the content
	// property refers to a `literal of type MarkupContent`.
	// The order describes the preferred format of the client.
	ContentFormat []MarkupKind `json:"contentFormat,omitempty"`
}

type HoverOptions

type HoverOptions struct {
	*WorkDoneProgressOptions
}

func (*HoverOptions) UnmarshalJSON

func (s *HoverOptions) UnmarshalJSON(data []byte) error

type ImplementationClientCapabilities

type ImplementationClientCapabilities struct {
	// Whether implementation supports dynamic registration. If this is set to
	// `true` the client supports the new `ImplementationRegistrationOptions`
	// return value for the corresponding server capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports additional metadata in the form of definition links.
	//
	// @since 3.14.0
	LinkSupport bool `json:"linkSupport,omitempty"`
}

type ImplementationOptions

ImplementationOptions boolean | ImplementationOptions | ImplementationRegistrationOptions

func (*ImplementationOptions) UnmarshalJSON

func (s *ImplementationOptions) UnmarshalJSON(data []byte) error

type InitializeError

type InitializeError struct {
	// Indicates whether the client execute the following retry logic:
	// (1) show the message provided by the ResponseError to the user
	// (2) user selects retry or cancel
	// (3) if user selected retry the initialize method is sent again.
	Retry bool `json:"retry,required"`
}

type InitializeParams

type InitializeParams struct {
	WorkDoneProgressParams

	// The process Id of the parent process that started the server. Is null if
	// the process has not been started by another process. If the parent
	// process is not alive then the server should exit (see exit notification)
	// its process.
	ProcessID *int `json:"processId,required"`

	// Information about the client
	//
	// @since 3.15.0
	ClientInfo *struct {
		// The name of the client as defined by the client.
		Name string `json:"name,required"`

		// The client's version as defined by the client.
		Version *string `json:"version,omitempty"`
	} `json:"clientInfo,omitempty"`

	// The locale the client is currently showing the user interface
	// in. This must not necessarily be the locale of the operating
	// system.
	//
	// Uses IETF language tags as the value's syntax
	// (See https://en.wikipedia.org/wiki/IETF_language_tag)
	//
	// @since 3.16.0
	Locale *string `json:"locale,omitempty"`

	// The rootPath of the workspace. Is null
	// if no folder is open.
	//
	// @deprecated in favour of `rootUri`.
	RootPath string `json:"rootPath,omitempty"`

	// The rootUri of the workspace. Is null if no
	// folder is open. If both `rootPath` and `rootUri` are set
	// `rootUri` wins.
	//
	// @deprecated in favour of `workspaceFolders`
	RootURI DocumentURI `json:"rootUri,required"`

	// User provided initialization options.
	InitializationOptions json.RawMessage `json:"initializationOptions,omitempty"`

	// The capabilities provided by the client (editor or tool)
	Capabilities ClientCapabilities `json:"capabilities,required"`

	// The initial trace setting. If omitted trace is disabled ('off').
	Trace *TraceValue `json:"trace,omitempty"`

	// The workspace folders configured in the client when the server starts.
	// This property is only available if the client supports workspace folders.
	// It can be `null` if the client supports workspace folders but none are
	// configured.
	//
	// @since 3.6.0
	WorkspaceFolders *[]WorkspaceFolder `json:"workspaceFolders"`
}

type InitializeResult

type InitializeResult struct {
	// The capabilities the language server provides.
	Capabilities ServerCapabilities `json:"capabilities,required"`

	// Information about the server.
	//
	// @since 3.15.0
	ServerInfo *InitializeResultServerInfo `json:"serverInfo,omitempty"`
}

type InitializeResultServerInfo

type InitializeResultServerInfo struct {
	// The name of the server as defined by the server.
	Name string `json:"name,required"`

	// The server's version as defined by the server.
	Version string `json:"version,omitempty"`
}

type InitializedParams

type InitializedParams struct{}

InitializedParams The initialized notification is sent from the client to the server after the client received the result of the initialize equest but before the client is sending any other request or notification to the server. The server can use the initialized notification for example to dynamically register capabilities. The initialized notification may only be sent once.

type InsertReplaceEdit

type InsertReplaceEdit struct {
	// The string to be inserted.
	NewText string `json:"newText,required"`

	// The range if the insert is requested
	Insert Range `json:"insert,required"`

	// The range if the replace is requested.
	Replace Range `json:"replace,required"`
}

InsertReplaceEdit A special text edit to provide an insert and a replace operation.

@since 3.16.0

type InsertTextFormat

type InsertTextFormat int

InsertTextFormat Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.

const InsertTextFormatPlainText InsertTextFormat = 1

InsertTextFormatPlainText The primary text to be inserted is treated as a plain string.

const InsertTextFormatSnippet InsertTextFormat = 2

InsertTextFormatSnippet The primary text to be inserted is treated as a snippet.

A snippet can define tab stops and placeholders with `$1`, `$2` and `${3:foo}`. `$0` defines the final tab stop, it defaults to the end of the snippet. Placeholders with equal identifiers are linked, that is typing in one will update others too.

type InsertTextMode

type InsertTextMode int

InsertTextMode How whitespace and indentation is handled during completion item insertion.

@since 3.16.0

const InsertTextModeAdjustIndentation InsertTextMode = 2

InsertTextModeAdjustIndentation The editor adjusts leading whitespace of new lines so that they match the indentation up to the cursor of the line for which the item is accepted.

Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a multi line completion item is indented using 2 tabs and all following lines inserted will be indented using 2 tabs as well.

const InsertTextModeAsIs InsertTextMode = 1

InsertTextModeAsIs The insertion or replace strings is taken as it is. If the value is multi line the lines below the cursor will be inserted using the indentation defined in the string value. The client will not apply any kind of adjustments to the string.

type LinkedEditingRangeClientCapabilities

type LinkedEditingRangeClientCapabilities struct {
	// Whether implementation supports dynamic registration.
	// If this is set to `true` the client supports the new
	// `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
	// return value for the corresponding server capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type LinkedEditingRangeOptions

LinkedEditingRangeOptions boolean | LinkedEditingRangeOptions | LinkedEditingRangeRegistrationOptions

func (*LinkedEditingRangeOptions) UnmarshalJSON

func (s *LinkedEditingRangeOptions) UnmarshalJSON(data []byte) error

type LinkedEditingRangeParams

type LinkedEditingRangeParams struct {
	TextDocumentPositionParams
	*WorkDoneProgressParams
}

type LinkedEditingRanges

type LinkedEditingRanges struct {
	// A list of ranges that can be renamed together. The ranges must have
	// identical length and contain identical text content. The ranges cannot overlap.
	Ranges []Range `json:"ranges,required"`

	// An optional word pattern (regular expression) that describes valid contents for
	// the given ranges. If no pattern is provided, the client configuration's word
	// pattern will be used.
	WordPattern string `json:"wordPattern,omitempty"`
}

type Location

type Location struct {
	URI DocumentURI `json:"uri,required"`

	Range Range `json:"range,required"`
}

Location represents a location inside a resource, such as a line inside a text file.

type LocationLink struct {
	// Span of the origin of this link.
	//
	// Used as the underlined span for mouse interaction. Defaults to the word
	// range at the mouse position.
	OriginSelectionRange *Range `json:"originSelectionRange,omitempty"`

	// The target resource identifier of this link.
	TargetURI DocumentURI `json:"targetUri,required"`

	// The full target range of this link. If the target for example is a symbol
	// then target range is the range enclosing this symbol not including
	// leading/trailing whitespace but everything else like comments. This
	// information is typically used to highlight the range in the editor.
	TargetRange Range `json:"targetRange,required"`

	// The range that should be selected and revealed when this link is being
	// followed, e.g the name of a function. Must be contained by the the
	// `targetRange`. See also `DocumentSymbol#range`
	TargetSelectionRange Range `json:"targetSelectionRange,required"`
}

type LogMessageParams

type LogMessageParams struct {
	// The message type. See {@link MessageType}
	Type MessageType `json:"type,required"`

	// The actual message
	Message string `json:"message,required"`
}

type LogTraceParams

type LogTraceParams struct {
	// The message to be logged.
	Message string `json:"message,required"`

	// Additional information that can be computed if the `trace` configuration
	// is set to `'verbose'`
	Verbose *string `json:"verbose,omitempty"`
}

type MarkdownClientCapabilities

type MarkdownClientCapabilities struct {
	// The name of the parser.
	Parser string `json:"parser,required"`

	// The version of the parser.
	Version string `json:"version,omitempty"`
}

MarkdownClientCapabilities Client capabilities specific to the used markdown parser.

@since 3.16.0

type MarkedString

type MarkedString struct {
	Language string `json:"language,required"`
	Value    string `json:"value,required"`
}

MarkedString can be used to render human readable text. It is either a markdown string or a code-block that provides a language and a code snippet. The language identifier is semantically equal to the optional language identifier in fenced code blocks in GitHub issues.

The pair of a language and a value is an equivalent to markdown: ```${language} ${value} ```

Note that markdown strings will be sanitized - that means html will be escaped.

@deprecated use MarkupContent instead.

func (MarkedString) MarshalJSON

func (ms MarkedString) MarshalJSON() ([]byte, error)

func (*MarkedString) UnmarshalJSON

func (ms *MarkedString) UnmarshalJSON(data []byte) error

UnmarshalJSON type MarkedString = string | { language: string; value: string };

type MarkupContent

type MarkupContent struct {
	// The type of the Markup
	Kind MarkupKind `json:"kind,required"`

	// The content itself
	Value string `json:"value,required"`
}

MarkupContent A `MarkupContent` literal represents a string value which content is interpreted base on its kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.

If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.

Here is an example how such a string can be constructed using JavaScript / TypeScript: ```typescript

let markdown: MarkdownContent = {
	kind: MarkupKind.Markdown,
	value: [
		'# Header',
		'Some text',
		'```typescript',
		'someCode();',
		'```'
	].join('\n')
};

```

Please Note* that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.

type MarkupKind

type MarkupKind string
const MarkupKindMarkdown MarkupKind = "markdown"

MarkupKindMarkdown Markdown is supported as a content format

const MarkupKindPlainText MarkupKind = "plaintext"

MarkupKindPlainText Plain text is supported as a content format

type MessageActionItem

type MessageActionItem struct {
	// A short title like 'Retry', 'Open Log' etc.
	Title string `json:"title,required"`
}

type MessageType

type MessageType int
const MessageTypeError MessageType = 1

MessageTypeError An error message.

const MessageTypeInfo MessageType = 3

MessageTypeInfo An information message.

const MessageTypeLog MessageType = 4

MessageTypeLog A log message.

const MessageTypeWarning MessageType = 2

MessageTypeWarning A warning message.

type Moniker

type Moniker struct {
	// The scheme of the moniker. For example tsc or .Net
	Scheme string `json:"scheme,required"`

	// The identifier of the moniker. The value is opaque in LSIF however
	// schema owners are allowed to define the structure if they want.
	Identifier string `json:"identifier,required"`

	// The scope in which the moniker is unique
	Unique UniquenessLevel `json:"unique,required"`

	// The moniker kind if known.
	Kind MonikerKind `json:"kind,omitempty"`
}

Moniker definition to match LSIF 0.5 moniker definition.

type MonikerClientCapabilities

type MonikerClientCapabilities struct {
	// Whether implementation supports dynamic registration. If this is set to
	// `true` the client supports the new `(TextDocumentRegistrationOptions &
	// StaticRegistrationOptions)` return value for the corresponding server
	// capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type MonikerKind

type MonikerKind string

MonikerKind The moniker kind.

const MonikerKindExport MonikerKind = "export"

MonikerKindExport The moniker represents a symbol that is exported from a project

const MonikerKindImport MonikerKind = "import"

MonikerKindImport The moniker represent a symbol that is imported into a project

const MonikerKindLocal MonikerKind = "local"

MonikerKindLocal The moniker represents a symbol that is local to a project (e.g. a local variable of a function, a class not visible outside the project, ...)

type MonikerOptions

type MonikerOptions struct {
	*WorkDoneProgressOptions
	*TextDocumentRegistrationOptions
}

MonikerOptions boolean | MonikerOptions | MonikerRegistrationOptions is defined as follows:

func (*MonikerOptions) UnmarshalJSON

func (s *MonikerOptions) UnmarshalJSON(data []byte) error

type ParameterInformation

type ParameterInformation struct {
	// The label of this parameter information.
	//
	// Either a string or an inclusive start and exclusive end offsets within
	// its containing signature label. (see SignatureInformation.label). The
	// offsets are based on a UTF-16 string representation as `Position` and
	// `Range` does.
	//
	////Note*: a label of type string should be a substring of its containing
	// signature label. Its intended use case is to highlight the parameter
	// label part in the `SignatureInformation.label`.
	Label json.RawMessage `json:"label,required"`

	// The human-readable doc-comment of this parameter. Will be shown
	// in the UI but can be omitted.
	Documentation json.RawMessage `json:"documentation,omitempty"`
}

ParameterInformation Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.

type PartialResultParams

type PartialResultParams struct {
	// An optional token that a server can use to report partial results (e.g.
	// streaming) to the client.
	PartialResultToken jsonrpc.ProgressToken `json:"partialResultToken,omitempty"`
}

type Position

type Position struct {
	// Line position in a document (zero-based).
	Line int `json:"line,required"`

	// Character offset on a line in a document (zero-based).
	Character int `json:"character,required"`
}

func (Position) AfterOrEq

func (p Position) AfterOrEq(q Position) bool

AfterOrEq returns true if the Position is after or equal the give Position

func (Position) BeforeOrEq

func (p Position) BeforeOrEq(q Position) bool

BeforeOrEq returns true if the Position is before or equal the give Position

func (Position) In

func (p Position) In(r Range) bool

In returns true if the Position is within the Range r

func (Position) String

func (p Position) String() string

type PrepareRenameParams

type PrepareRenameParams struct {
	TextDocumentPositionParams
}

type PrepareSupportDefaultBehavior

type PrepareSupportDefaultBehavior int

type ProgressParams

type ProgressParams struct {
	// The progress token provided by the client or server.
	Token json.RawMessage `json:"token,required"`

	// The progress data.
	Value json.RawMessage `json:"value,required"`
}

func (*ProgressParams) TryToDecodeWellKnownValues

func (p *ProgressParams) TryToDecodeWellKnownValues() interface{}

type PublishDiagnosticsClientCapabilities

type PublishDiagnosticsClientCapabilities struct {
	// Whether the clients accepts diagnostics with related information.
	RelatedInformation bool `json:"relatedInformation,omitempty"`

	// Client supports the tag property to provide meta data about a diagnostic.
	// Clients supporting tags have to handle unknown tags gracefully.
	//
	// @since 3.15.0
	TagSupport *struct {
		// The tags supported by the client.
		ValueSet []DiagnosticTag `json:"valueSet"`
	} `json:"tagSupport,omitempty"`

	// Whether the client interprets the version property of the
	// `textDocument/publishDiagnostics` notification's parameter.
	//
	// @since 3.15.0
	VersionSupport bool `json:"versionSupport,omitempty"`

	// Client supports a codeDescription property
	//
	// @since 3.16.0
	CodeDescriptionSupport bool `json:"codeDescriptionSupport,omitempty"`

	// Whether code action supports the `data` property which is
	// preserved between a `textDocument/publishDiagnostics` and
	// `textDocument/codeAction` request.
	//
	// @since 3.16.0
	DataSupport bool `json:"dataSupport,omitempty"`
}

type PublishDiagnosticsParams

type PublishDiagnosticsParams struct {
	// The URI for which diagnostic information is reported.
	URI DocumentURI `json:"uri,required"`

	// Optional the version number of the document the diagnostics are published
	// for.
	//
	// @since 3.15.0
	Version int `json:"version,omitempty"`

	// An array of diagnostic information items.
	Diagnostics []Diagnostic `json:"diagnostics"`
}

type Range

type Range struct {
	// The range's start position.
	Start Position `json:"start,required"`

	// The range's end position.
	End Position `json:"end,required"`
}

func (Range) Overlaps

func (r Range) Overlaps(p Range) bool

Overlaps returns true if the Range overlaps with the given Range p

func (Range) String

func (r Range) String() string

type ReferenceClientCapabilities

type ReferenceClientCapabilities struct {
	// Whether references supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type ReferenceContext

type ReferenceContext struct {
	// Include the declaration of the current symbol.
	IncludeDeclaration bool `json:"includeDeclaration,required"`
}

type ReferenceOptions

type ReferenceOptions struct {
	*WorkDoneProgressOptions
}

ReferenceOptions boolean | ReferenceOptions

func (*ReferenceOptions) UnmarshalJSON

func (s *ReferenceOptions) UnmarshalJSON(data []byte) error

type ReferenceParams

type ReferenceParams struct {
	TextDocumentPositionParams
	*WorkDoneProgressParams
	*PartialResultParams
	Context *ReferenceContext `json:"context,required"`
}

type Registration

type Registration struct {
	// The id used to register the request. The id can be used to deregister
	// the request again.
	ID string `json:"id,required"`

	// The method / capability to register for.
	Method string `json:"method,required"`

	// Options necessary for the registration.
	RegisterOptions json.RawMessage `json:"registerOptions,omitempty"`
}

Registration General parameters to register for a capability.

type RegistrationParams

type RegistrationParams struct {
	Registrations []Registration `json:"registrations,required"`
}

type RegularExpressionsClientCapabilities

type RegularExpressionsClientCapabilities struct {
	// The engine's name.
	Engine string `json:"engine,required"`

	// The engine's version.
	Version string `json:"version,omitempty"`
}

RegularExpressionsClientCapabilities Client capabilities specific to regular expressions.

type RenameClientCapabilities

type RenameClientCapabilities struct {
	// Whether rename supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// Client supports testing for validity of rename operations
	// before execution.
	//
	// @since version 3.12.0
	PrepareSupport bool `json:"prepareSupport,omitempty"`

	// Client supports the default behavior result
	// (`{ defaultBehavior: boolean }`).
	//
	// The value indicates the default behavior used by the
	// client.
	//
	// @since version 3.16.0
	PrepareSupportDefaultBehavior *PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitempty"`

	// Whether th client honors the change annotations in
	// text edits and resource operations returned via the
	// rename request's workspace edit by for example presenting
	// the workspace edit in the user interface and asking
	// for confirmation.
	//
	// @since 3.16.0
	HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitempty"`
}

type RenameFilesParams

type RenameFilesParams struct {
	// An array of all files/folders renamed in this operation. When a folder
	// is renamed, only the folder will be included, and not its children.
	Files []FileRename `json:"files,required"`
}

RenameFilesParams The parameters sent in notifications/requests for user-initiated renames of files.

@since 3.16.0

type RenameOptions

type RenameOptions struct {
	*WorkDoneProgressOptions

	// Renames should be checked and tested before being executed.
	PrepareProvider bool `json:"prepareProvider,omitempty"`
}

RenameOptions boolean | RenameOptions

func (*RenameOptions) UnmarshalJSON

func (s *RenameOptions) UnmarshalJSON(data []byte) error

type RenameParams

type RenameParams struct {
	TextDocumentPositionParams
	*WorkDoneProgressParams

	// The new name of the symbol. If the given name is not valid the
	// request must return a [ResponseError](#ResponseError) with an
	// appropriate message set.
	NewName string `json:"newName,required"`
}

type ResourceOperationKind

type ResourceOperationKind string

type SaveOptions

type SaveOptions struct {
	// The client is supposed to include the content on save.
	IncludeText bool `json:"includeText,omitempty"`
}

func (*SaveOptions) UnmarshalJSON

func (s *SaveOptions) UnmarshalJSON(data []byte) error

type SelectionRange

type SelectionRange struct {
	// The [range](#Range) of this selection range.
	Range Range `json:"range,required"`
	// The parent selection range containing this range. Therefore
	// `parent.range` must contain `this.range`.
	Parent *SelectionRange `json:"parent,omitempty"`
}

type SelectionRangeClientCapabilities

type SelectionRangeClientCapabilities struct {
	// Whether implementation supports dynamic registration for selection range
	// providers. If this is set to `true` the client supports the new
	// `SelectionRangeRegistrationOptions` return value for the corresponding
	// server capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type SelectionRangeOptions

SelectionRangeOptions boolean | SelectionRangeOptions | SelectionRangeRegistrationOptions

func (*SelectionRangeOptions) UnmarshalJSON

func (s *SelectionRangeOptions) UnmarshalJSON(data []byte) error

type SelectionRangeParams

type SelectionRangeParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// The text document.
	RextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The positions inside the text document.
	Positions []Position `json:"positions,required"`
}

type SemanticTokenFullOptions

type SemanticTokenFullOptions struct {
	// The server supports deltas for full documents.
	Delta bool `json:"delta,omitempty"`
}

type SemanticTokens

type SemanticTokens struct {
	// An optional result id. If provided and clients support delta updating
	// the client will include the result id in the next semantic token request.
	// A server can then instead of computing all semantic tokens again simply
	// send a delta.
	ResultID string `json:"resultId,omitempty"`

	// The actual tokens.
	Data []int `json:"data,required"`
}

type SemanticTokensClientCapabilities

type SemanticTokensClientCapabilities struct {
	// Whether implementation supports dynamic registration. If this is set to
	// `true` the client supports the new `(TextDocumentRegistrationOptions &
	// StaticRegistrationOptions)` return value for the corresponding server
	// capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// Which requests the client supports and might send to the server
	// depending on the server's capability. Please note that clients might not
	// show semantic tokens or degrade some of the user experience if a range
	// or full request is advertised by the client but not provided by the
	// server. If for example the client capability `requests.full` and
	// `request.range` are both set to true but the server only provides a
	// range provider the client might not render a minimap correctly or might
	// even decide to not show any semantic tokens at all.
	Requests struct {

		// The client will send the `textDocument/semanticTokens/range` request
		// if the server provides a corresponding handler.
		Range bool `json:"range,omitempty"`

		// The client will send the `textDocument/semanticTokens/full` request
		// if the server provides a corresponding handler.
		Full *struct {
			// The client will send the `textDocument/semanticTokens/full/delta`
			// request if the server provides a corresponding handler.
			Delta bool `json:"delta,omitempty"`
		} `json:"full,omitempty"`
	} `json:"requests"`

	// The token types that the client supports.
	TokenTypes []string `json:"tokenTypes"`

	// The token modifiers that the client supports.
	TokenModifiers []string `json:"tokenModifiers"`

	// The formats the clients supports.
	Formats []TokenFormat `json:"formats"`

	// Whether the client supports tokens that can overlap each other.
	OverlappingTokenSupport bool `json:"overlappingTokenSupport,omitempty"`

	// Whether the client supports tokens that can span multiple lines.
	MultilineTokenSupport bool `json:"multilineTokenSupport,omitempty"`
}

type SemanticTokensDelta

type SemanticTokensDelta struct {
	ResultID string `json:"resultId,omitempty"`

	// The semantic token edits to transform a previous result into a new
	// result.
	Edits []SemanticTokensEdit `json:"edits,required"`
}

type SemanticTokensDeltaParams

type SemanticTokensDeltaParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The text document.
	RextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The result id of a previous response. The result Id can either point to
	// a full response or a delta response depending on what was received last.
	PreviousResultID string `json:"previousResultId,required"`
}

type SemanticTokensEdit

type SemanticTokensEdit struct {
	// The start offset of the edit.
	Start int `json:"start,required"`

	// The count of elements to remove.
	DeleteCount int `json:"deleteCount,required"`

	// The elements to insert.
	Data []int `json:"data,omitempty"`
}

type SemanticTokensLegend

type SemanticTokensLegend struct {
	// The token types a server uses.
	TokenTypes []string `json:"tokenTypes"`

	// The token modifiers a server uses.
	TokenModifiers []string `json:"tokenModifiers"`
}

type SemanticTokensOptions

type SemanticTokensOptions struct {
	*TextDocumentRegistrationOptions
	*StaticRegistrationOptions

	// WorkDoneProgressOptions
	// The legend used by the server
	Legend SemanticTokensLegend `json:"legend,required"`

	// Server supports providing semantic tokens for a specific range
	// of a document.
	// type: boolean | { }
	Range BooleanOrEmptyStruct `json:"range,required"`

	// Server supports providing semantic tokens for a full document.
	// type: boolean | { delta?: boolean }
	Full *SemanticTokenFullOptions `json:"full,omitempty"`
}

type SemanticTokensParams

type SemanticTokensParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// The text document.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`
}

type SemanticTokensRangeParams

type SemanticTokensRangeParams struct {
	*WorkDoneProgressParams
	*PartialResultParams
	// The text document.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The range the semantic tokens are requested for.
	Range Range `json:"range,required"`
}

type SemanticTokensWorkspaceClientCapabilities

type SemanticTokensWorkspaceClientCapabilities struct {
	// Whether the client implementation supports a refresh request sent from
	// the server to the client.
	//
	// Note that this event is global and will force the client to refresh all
	// semantic tokens currently shown. It should be used with absolute care
	// and is useful for situation where a server for example detect a project
	// wide change that requires such a calculation.
	RefreshSupport bool `json:"refreshSupport,omitempty"`
}

type Server

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

Server is an LSP Server

func NewServer

func NewServer(in io.Reader, out io.Writer, handler ClientMessagesHandler) *Server

func (*Server) ClientRegisterCapability

func (serv *Server) ClientRegisterCapability(ctx context.Context, param *RegistrationParams) (*jsonrpc.ResponseError, error)

func (*Server) ClientUnregisterCapability

func (serv *Server) ClientUnregisterCapability(ctx context.Context, param *UnregistrationParams) (*jsonrpc.ResponseError, error)

func (*Server) LogTrace

func (serv *Server) LogTrace(param *LogTraceParams) error

func (*Server) Progress

func (serv *Server) Progress(param *ProgressParams) error

func (*Server) RegisterCustomNotification

func (serv *Server) RegisterCustomNotification(method string, callback CustomNotification)

func (*Server) RegisterCustomRequest

func (serv *Server) RegisterCustomRequest(method string, callback CustomRequest)

func (*Server) Run

func (serv *Server) Run()

func (*Server) SetErrorHandler

func (serv *Server) SetErrorHandler(handler func(e error))

func (*Server) SetLogger

func (serv *Server) SetLogger(l jsonrpc.Logger)

func (*Server) TelemetryEvent

func (serv *Server) TelemetryEvent(param json.RawMessage) error

func (*Server) TextDocumentPublishDiagnostics

func (serv *Server) TextDocumentPublishDiagnostics(param *PublishDiagnosticsParams) error

func (*Server) WindowLogMessage

func (serv *Server) WindowLogMessage(param *LogMessageParams) error

func (*Server) WindowShowDocument

func (serv *Server) WindowShowDocument(ctx context.Context, param *ShowDocumentParams) (*ShowDocumentResult, *jsonrpc.ResponseError, error)

func (*Server) WindowShowMessage

func (serv *Server) WindowShowMessage(param *ShowMessageParams) error

func (*Server) WindowShowMessageRequest

func (serv *Server) WindowShowMessageRequest(ctx context.Context, param *ShowMessageRequestParams) (*MessageActionItem, *jsonrpc.ResponseError, error)

func (*Server) WindowWorkDoneProgressCreate

func (serv *Server) WindowWorkDoneProgressCreate(ctx context.Context, param *WorkDoneProgressCreateParams) (*jsonrpc.ResponseError, error)

func (*Server) WorkspaceApplyEdit

func (*Server) WorkspaceCodeLensRefresh

func (serv *Server) WorkspaceCodeLensRefresh(ctx context.Context) (*jsonrpc.ResponseError, error)

func (*Server) WorkspaceConfiguration

func (serv *Server) WorkspaceConfiguration(ctx context.Context, param *ConfigurationParams) ([]json.RawMessage, *jsonrpc.ResponseError, error)

func (*Server) WorkspaceWorkspaceFolders

func (serv *Server) WorkspaceWorkspaceFolders(ctx context.Context) ([]WorkspaceFolder, *jsonrpc.ResponseError, error)

type ServerCapabilities

type ServerCapabilities struct {
	// Defines how text documents are synced. Is either a detailed structure
	// defining each notification or for backwards compatibility the
	// TextDocumentSyncKind number. If omitted it defaults to
	// `TextDocumentSyncKind.None`.
	TextDocumentSync *TextDocumentSyncOptions `json:"textDocumentSync,omitempty"`

	// The server provides completion support.
	CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`

	// The server provides hover support.
	HoverProvider *HoverOptions `json:"hoverProvider,omitempty"`

	// The server provides signature help support.
	SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`

	// The server provides go to declaration support.
	//
	// @since 3.14.0
	DeclarationProvider *DeclarationOptions `json:"declarationProvider,omitempty"`

	// The server provides goto definition support.
	DefinitionProvider *DefinitionOptions `json:"definitionProvider,omitempty"`

	// The server provides goto type definition support.
	//
	// @since 3.6.0
	TypeDefinitionProvider *TypeDefinitionOptions `json:"typeDefinitionProvider,omitempty"`

	// The server provides goto implementation support.
	//
	// @since 3.6.0
	ImplementationProvider *ImplementationOptions `json:"implementationProvider,omitempty"`

	// The server provides find references support.
	ReferencesProvider *ReferenceOptions `json:"referencesProvider,omitempty"`

	// The server provides document highlight support.
	DocumentHighlightProvider *DocumentHighlightOptions `json:"documentHighlightProvider,omitempty"`

	// The server provides document symbol support.
	DocumentSymbolProvider *DocumentSymbolOptions `json:"documentSymbolProvider,omitempty"`

	// The server provides code actions. The `CodeActionOptions` return type is
	// only valid if the client signals code action literal support via the
	// property `textDocument.codeAction.codeActionLiteralSupport`.
	CodeActionProvider *CodeActionOptions `json:"codeActionProvider,omitempty"`

	// The server provides code lens.
	CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"`

	// The server provides document link support.
	DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"`

	// The server provides color provider support.
	//
	// @since 3.6.0
	ColorProvider *DocumentColorOptions `json:"colorProvider,omitempty"`

	// The server provides document formatting.
	DocumentFormattingProvider *DocumentFormattingOptions `json:"documentFormattingProvider,omitempty"`

	// The server provides document range formatting.
	DocumentRangeFormattingProvider *DocumentRangeFormattingOptions `json:"documentRangeFormattingProvider,omitempty"`

	// The server provides document formatting on typing.
	DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"`

	// The server provides rename support. RenameOptions may only be
	// specified if the client states that it supports
	// `prepareSupport` in its initial `initialize` request.
	RenameProvider *RenameOptions `json:"renameProvider,omitempty"`

	// The server provides folding provider support.
	//
	// @since 3.10.0
	FoldingRangeProvider *FoldingRangeOptions `json:"foldingRangeProvider,omitempty"`

	// The server provides execute command support.
	ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"`

	// The server provides selection range support.
	//
	// @since 3.15.0
	SelectionRangeProvider *SelectionRangeOptions `json:"selectionRangeProvider,omitempty"`

	// The server provides linked editing range support.
	//
	// @since 3.16.0
	LinkedEditingRangeProvider *LinkedEditingRangeOptions `json:"linkedEditingRangeProvider,omitempty"`

	// The server provides call hierarchy support.
	//
	// @since 3.16.0
	CallHierarchyProvider *CallHierarchyOptions `json:"callHierarchyProvider,omitempty"`

	// The server provides semantic tokens support.
	//
	// @since 3.16.0
	SemanticTokensProvider *SemanticTokensOptions `json:"semanticTokensProvider,omitempty"`

	// Whether server provides moniker support.
	//
	// @since 3.16.0
	MonikerProvider *MonikerOptions `json:"monikerProvider,omitempty"`

	// The server provides workspace symbol support.
	WorkspaceSymbolProvider *WorkspaceSymbolOptions `json:"workspaceSymbolProvider,omitempty"`

	// Workspace specific server capabilities
	Workspace *struct {
		// The server supports workspace folder.
		//
		// @since 3.6.0
		WorkspaceFolders *WorkspaceFoldersServerCapabilities `json:"workspaceFolders,omitempty"`

		// The server is interested in file notifications/requests.
		//
		// @since 3.16.0
		FileOperations *struct {
			// The server is interested in receiving didCreateFiles
			// notifications.
			DidCreate *FileOperationRegistrationOptions `json:"didCreate,omitempty"`

			// The server is interested in receiving willCreateFiles requests.
			WillCreate *FileOperationRegistrationOptions `json:"willCreate,omitempty"`

			// The server is interested in receiving didRenameFiles
			// notifications.
			DidRename *FileOperationRegistrationOptions `json:"didRename,omitempty"`

			// The server is interested in receiving willRenameFiles requests.
			WillRename *FileOperationRegistrationOptions `json:"willRename,omitempty"`

			// The server is interested in receiving didDeleteFiles file
			// notifications.
			DidDelete *FileOperationRegistrationOptions `json:"didDelete,omitempty"`

			// The server is interested in receiving willDeleteFiles file
			// requests.
			WillDelete *FileOperationRegistrationOptions `json:"willDelete,omitempty"`
		} `json:"fileOperations,omitempty"`
	} `json:"workspace,omitempty"`

	// Experimental server capabilities.
	Experimental json.RawMessage `json:"experimental,omitempty"`
}

type ServerMessagesHandler

ServerMessagesHandler interface has all the methods that an LSP Client should implement to correctly parse incoming messages

type SetTraceParams

type SetTraceParams struct {
	// The new value that should be assigned to the trace setting.
	Value TraceValue `json:"value,required"`
}

type ShowDocumentClientCapabilities

type ShowDocumentClientCapabilities struct {
	// The client has support for the show document
	// request.
	Support bool `json:"support"`
}

ShowDocumentClientCapabilities Client capabilities for the show document request.

@since 3.16.0

type ShowDocumentParams

type ShowDocumentParams struct {
	// The document uri to show.
	URI URI `json:"uri,omitempty"`

	// Indicates to show the resource in an external program.
	// To show for example `https://code.visualstudio.com/`
	// in the default WEB browser set `external` to `true`.
	External bool `json:"external,omitempty"`

	// An optional property to indicate whether the editor
	// showing the document should take focus or not.
	// Clients might ignore this property if an external
	// program is started.
	TakeFocus bool `json:"takeFocus,omitempty"`

	// An optional selection range if the document is a text
	// document. Clients might ignore the property if an
	// external program is started or the file is not a text
	// file.
	Selection Range `json:"selection,omitempty"`
}

ShowDocumentParams Params to show a document.

@since 3.16.0

type ShowDocumentResult

type ShowDocumentResult struct {
	// A boolean indicating if the show was successful.
	Success bool `json:"success,required"`
}

ShowDocumentResult The result of an show document request.

@since 3.16.0

type ShowMessageParams

type ShowMessageParams struct {
	// The message type. See {@link MessageType}.
	Type MessageType `json:"type,required"`

	// The actual message.
	Message string `json:"message,required"`
}

type ShowMessageRequestClientCapabilities

type ShowMessageRequestClientCapabilities struct {
	// Capabilities specific to the `MessageActionItem` type.
	MessageActionItem struct {

		// Whether the client supports additional attributes which
		// are preserved and sent back to the server in the
		// request's response.
		AdditionalPropertiesSupport bool `json:"additionalPropertiesSupport,omitempty"`
	} `json:"messageActionItem"`
}

ShowMessageRequestClientCapabilities Show message request client capabilities

type ShowMessageRequestParams

type ShowMessageRequestParams struct {
	// The message type. See {@link MessageType}
	Type MessageType `json:"type,required"`

	// The actual message
	Message string `json:"message,required"`

	// The message action items to present.
	Actions []MessageActionItem `json:"actions,omitempty"`
}

type SignatureHelp

type SignatureHelp struct {
	// One or more signatures. If no signatures are available the signature help
	// request should return `null`.
	Signatures []SignatureInformation `json:"signatures,required"`

	// The active signature. If omitted or the value lies outside the
	// range of `signatures` the value defaults to zero or is ignore if
	// the `SignatureHelp` as no signatures.
	//
	// Whenever possible implementors should make an active decision about
	// the active signature and shouldn't rely on a default value.
	//
	// In future version of the protocol this property might become
	// mandatory to better express this.
	ActiveSignature *int `json:"activeSignature,omitempty"`

	// The active parameter of the active signature. If omitted or the value
	// lies outside the range of `signatures[activeSignature].parameters`
	// defaults to 0 if the active signature has parameters. If
	// the active signature has no parameters it is ignored.
	// In future version of the protocol this property might become
	// mandatory to better express the active parameter if the
	// active signature does have any.
	ActiveParameter *int `json:"activeParameter,omitempty"`
}

SignatureHelp Signature help represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.

type SignatureHelpClientCapabilities

type SignatureHelpClientCapabilities struct {
	// Whether signature help supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports the following `SignatureInformation`
	// specific properties.
	SignatureInformation *struct {
		// Client supports the follow content formats for the documentation
		// property. The order describes the preferred format of the client.
		DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`

		// Client capabilities specific to parameter information.
		ParameterInformation *struct {
			// The client supports processing label offsets instead of a
			// simple label string.
			//
			// @since 3.14.0
			LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
		} `json:"parameterInformation,omitempty"`

		// The client supports the `activeParameter` property on
		// `SignatureInformation` literal.
		//
		// @since 3.16.0
		ActiveParameterSupport bool `json:"activeParameterSupport,omitempty"`
	} `json:"signatureInformation,omitempty"`

	// The client supports to send additional context information for a
	// `textDocument/signatureHelp` request. A client that opts into
	// contextSupport will also support the `retriggerCharacters` on
	// `SignatureHelpOptions`.
	//
	// @since 3.15.0
	ContextSupport bool `json:"contextSupport,omitempty"`
}

type SignatureHelpContext

type SignatureHelpContext struct {
	// Action that caused signature help to be triggered.
	TriggerKind SignatureHelpTriggerKind `json:"triggerKind,required"`

	// Character that caused signature help to be triggered.
	//
	// This is undefined when triggerKind !==
	// SignatureHelpTriggerKind.TriggerCharacter
	TriggerCharacter string `json:"triggerCharacter,omitempty"`

	// `true` if signature help was already showing when it was triggered.
	//
	// Retriggers occur when the signature help is already active and can be
	// caused by actions such as typing a trigger character, a cursor move, or
	// document content changes.
	IsRetrigger bool `json:"isRetrigger,required"`

	// The currently active `SignatureHelp`.
	//
	// The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field
	// updated based on the user navigating through available signatures.
	ActiveSignatureHelp *SignatureHelp `json:"activeSignatureHelp,omitempty"`
}

SignatureHelpContext Additional information about the context in which a signature help request was triggered.

@since 3.15.0

type SignatureHelpOptions

type SignatureHelpOptions struct {
	WorkDoneProgressOptions

	// The characters that trigger signature help
	// automatically.
	TriggerCharacters []string `json:"triggerCharacters,omitempty"`

	// List of characters that re-trigger signature help.
	//
	// These trigger characters are only active when signature help is already
	// showing. All trigger characters are also counted as re-trigger
	// characters.
	//
	// @since 3.15.0
	RetriggerCharacters []string `json:"retriggerCharacters,omitempty"`
}

type SignatureHelpParams

type SignatureHelpParams struct {
	TextDocumentPositionParams
	*WorkDoneProgressParams

	// The signature help context. This is only available if the client
	// specifies to send this using the client capability
	// `textDocument.signatureHelp.contextSupport === true`
	//
	// @since 3.15.0
	Context *SignatureHelpContext `json:"context,omitempty"`
}

type SignatureHelpTriggerKind

type SignatureHelpTriggerKind int

SignatureHelpTriggerKind How a signature help was triggered.

@since 3.15.0

const SignatureHelpTriggerKindContentChange SignatureHelpTriggerKind = 3

SignatureHelpTriggerKindContentChange Signature help was triggered by the cursor moving or by the document content changing.

const SignatureHelpTriggerKindInvoked SignatureHelpTriggerKind = 1

SignatureHelpTriggerKindInvoked Signature help was invoked manually by the user or by a command.

const SignatureHelpTriggerKindTriggerCharacter SignatureHelpTriggerKind = 2

SignatureHelpTriggerKindTriggerCharacter Signature help was triggered by a trigger character.

type SignatureInformation

type SignatureInformation struct {
	// The label of this signature. Will be shown in
	// the UI.
	Label string `json:"label,required"`

	// The human-readable doc-comment of this signature. Will be shown
	// in the UI but can be omitted.
	Documentation json.RawMessage `json:"documentation,omitempty"`

	// The parameters of this signature.
	Parameters []ParameterInformation `json:"parameters,omitempty"`

	// The index of the active parameter.
	//
	// If provided, this is used in place of `SignatureHelp.activeParameter`.
	//
	// @since 3.16.0
	ActiveParameter *int `json:"activeParameter,omitempty"`
}

SignatureInformation Represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.

type StaticRegistrationOptions

type StaticRegistrationOptions struct {
	// The id used to register the request. The id can be used to deregister
	// the request again. See also Registration#id.
	ID string `json:"id,omitempty"`
}

StaticRegistrationOptions Static registration options to be returned in the initialize request.

type SymbolInformation

type SymbolInformation struct {
	// The name of this symbol.
	Name string `json:"name,required"`

	// The kind of this symbol.
	Kind SymbolKind `json:"kind,required"`

	// Tags for this symbol.
	//
	// @since 3.16.0
	Tags []SymbolTag `json:"tags,omitempty"`

	// Indicates if this symbol is deprecated.
	//
	// @deprecated Use tags instead
	Deprecated bool `json:"deprecated,omitempty"`

	// The location of this symbol. The location's range is used by a tool
	// to reveal the location in the editor. If the symbol is selected in the
	// tool the range's start information is used to position the cursor. So
	// the range usually spans more then the actual symbol's name and does
	// normally include things like visibility modifiers.
	//
	// The range doesn't have to denote a node range in the sense of a abstract
	// syntax tree. It can therefore not be used to re-construct a hierarchy of
	// the symbols.
	Location Location `json:"location,required"`

	// The name of the symbol containing this symbol. This information is for
	// user interface purposes (e.g. to render a qualifier in the user interface
	// if necessary). It can't be used to re-infer a hierarchy for the document
	// symbols.
	ContainerName string `json:"containerName,omitempty"`
}

SymbolInformation Represents information about programming constructs like variables, classes, interfaces etc.

type SymbolKind

type SymbolKind int
const SymbolKindArray SymbolKind = 18
const SymbolKindBoolean SymbolKind = 17
const SymbolKindClass SymbolKind = 5
const SymbolKindConstant SymbolKind = 14
const SymbolKindConstructor SymbolKind = 9
const SymbolKindEnum SymbolKind = 10
const SymbolKindEnumMember SymbolKind = 22
const SymbolKindEvent SymbolKind = 24
const SymbolKindField SymbolKind = 8
const SymbolKindFile SymbolKind = 1
const SymbolKindFunction SymbolKind = 12
const SymbolKindInterface SymbolKind = 11
const SymbolKindKey SymbolKind = 20
const SymbolKindMethod SymbolKind = 6
const SymbolKindModule SymbolKind = 2
const SymbolKindNamespace SymbolKind = 3
const SymbolKindNull SymbolKind = 21
const SymbolKindNumber SymbolKind = 16
const SymbolKindObject SymbolKind = 19
const SymbolKindOperator SymbolKind = 25
const SymbolKindPackage SymbolKind = 4
const SymbolKindProperty SymbolKind = 7
const SymbolKindString SymbolKind = 15
const SymbolKindStruct SymbolKind = 23
const SymbolKindTypeParameter SymbolKind = 26
const SymbolKindVariable SymbolKind = 13

func (SymbolKind) String

func (s SymbolKind) String() string

type SymbolTag

type SymbolTag int
const SymbolTagDeprecated SymbolTag = 1

type TextDocumentClientCapabilities

type TextDocumentClientCapabilities struct {
	Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"`

	// Capabilities specific to the `textDocument/completion` request.
	Completion *CompletionClientCapabilities `json:"completion,omitempty"`

	// Capabilities specific to the `textDocument/hover` request.
	Hover *HoverClientCapabilities `json:"hover,omitempty"`

	// Capabilities specific to the `textDocument/signatureHelp` request.
	SignatureHelp *SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"`

	// Capabilities specific to the `textDocument/declaration` request.
	//
	// @since 3.14.0
	Declaration *DeclarationClientCapabilities `json:"declaration,omitempty"`

	// Capabilities specific to the `textDocument/definition` request.
	Definition *DefinitionClientCapabilities `json:"definition,omitempty"`

	// Capabilities specific to the `textDocument/typeDefinition` request.
	//
	// @since 3.6.0
	TypeDefinition *TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"`

	// Capabilities specific to the `textDocument/implementation` request.
	//
	// @since 3.6.0
	Implementation *ImplementationClientCapabilities `json:"implementation,omitempty"`

	// Capabilities specific to the `textDocument/references` request.
	References *ReferenceClientCapabilities `json:"references,omitempty"`

	// Capabilities specific to the `textDocument/documentHighlight` request.
	DocumentHighlight *DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"`

	// Capabilities specific to the `textDocument/documentSymbol` request.
	DocumentSymbol *DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"`

	// Capabilities specific to the `textDocument/codeAction` request.
	CodeAction *CodeActionClientCapabilities `json:"codeAction,omitempty"`

	// Capabilities specific to the `textDocument/codeLens` request.
	CodeLens *CodeLensClientCapabilities `json:"codeLens,omitempty"`

	// Capabilities specific to the `textDocument/documentLink` request.
	DocumentLink *DocumentLinkClientCapabilities `json:"documentLink,omitempty"`

	// Capabilities specific to the `textDocument/documentColor` and the
	// `textDocument/colorPresentation` request.
	//
	// @since 3.6.0
	ColorProvider *DocumentColorClientCapabilities `json:"colorProvider,omitempty"`

	// Capabilities specific to the `textDocument/formatting` request.
	Formatting *DocumentFormattingClientCapabilities `json:"formatting,omitempty"`

	// Capabilities specific to the `textDocument/rangeFormatting` request.
	RangeFormatting *DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"`

	// Capabilities specific to the `textDocument/onTypeFormatting` request.
	OnTypeFormatting *DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"`

	// Capabilities specific to the `textDocument/rename` request.
	Rename *RenameClientCapabilities `json:"rename,omitempty"`

	// Capabilities specific to the `textDocument/publishDiagnostics`
	// notification.
	PublishDiagnostics *PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"`

	// Capabilities specific to the `textDocument/foldingRange` request.
	//
	// @since 3.10.0
	FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitempty"`

	// Capabilities specific to the `textDocument/selectionRange` request.
	//
	// @since 3.15.0
	SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitempty"`

	// Capabilities specific to the `textDocument/linkedEditingRange` request.
	//
	// @since 3.16.0
	LinkedEditingRange *LinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitempty"`

	// Capabilities specific to the various call hierarchy requests.
	//
	// @since 3.16.0
	CallHierarchy *CallHierarchyClientCapabilities `json:"callHierarchy,omitempty"`

	// Capabilities specific to the various semantic token requests.
	//
	// @since 3.16.0
	SemanticTokens *SemanticTokensClientCapabilities `json:"semanticTokens,omitempty"`

	// Capabilities specific to the `textDocument/moniker` request.
	//
	// @since 3.16.0
	Moniker *MonikerClientCapabilities `json:"moniker,omitempty"`
}

type TextDocumentContentChangeEvent

type TextDocumentContentChangeEvent struct {
	// The range of the document that changed.
	Range *Range `json:"range,omitempty"`

	// The optional length of the range that got replaced.
	//
	// @deprecated use range instead.
	RangeLength *int `json:"rangeLength,omitempty"`

	// The new text for the provided range or the new text of the whole document if range and rangeLength are omitted.
	Text string `json:"text,required"`
}

TextDocumentContentChangeEvent An event describing a change to a text document. If range and rangeLength are omitted the new text is considered to be the full content of the document.

func (TextDocumentContentChangeEvent) String

func (change TextDocumentContentChangeEvent) String() string

type TextDocumentIdentifier

type TextDocumentIdentifier struct {
	// The text document's URI.
	URI DocumentURI `json:"uri,required"`
}

func (TextDocumentIdentifier) String

func (t TextDocumentIdentifier) String() string

type TextDocumentItem

type TextDocumentItem struct {
	// The text document's URI.
	URI DocumentURI `json:"uri,required"`

	// The text document's language identifier.
	LanguageID string `json:"languageId,required"`

	// The version number of this document (it will increase after each
	// change, including undo/redo).
	Version int `json:"version,required"`

	// The content of the opened text document.
	Text string `json:"text,required"`
}

func (TextDocumentItem) String

func (t TextDocumentItem) String() string

type TextDocumentPositionParams

type TextDocumentPositionParams struct {
	// The text document.
	TextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The position inside the text document.
	Position Position `json:"position,required"`
}

func (TextDocumentPositionParams) String

type TextDocumentRegistrationOptions

type TextDocumentRegistrationOptions struct {
	// A document selector to identify the scope of the registration. If set to
	// null the document selector provided on the client side will be used.
	DocumentSelector *DocumentSelector `json:"documentSelector,omitempty"`
}

TextDocumentRegistrationOptions General text document registration options.

type TextDocumentSaveReason

type TextDocumentSaveReason int

TextDocumentSaveReason Represents reasons why a text document is saved.

const TextDocumentSaveReasonAfterDelay TextDocumentSaveReason = 2

TextDocumentSaveReasonAfterDelay Automatic after a delay.

const TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3

TextDocumentSaveReasonFocusOut When the editor lost focus.

const TextDocumentSaveReasonManual TextDocumentSaveReason = 1

TextDocumentSaveReasonManual Manually triggered, e.g. by the user pressing save, by starting debugging, or by an API call.

type TextDocumentSyncClientCapabilities

type TextDocumentSyncClientCapabilities struct {
	// Whether text document synchronization supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports sending will save notifications.
	WillSave bool `json:"willSave,omitempty"`

	// The client supports sending a will save request and
	// waits for a response providing text edits which will
	// be applied to the document before it is saved.
	WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`

	// The client supports did save notifications.
	DidSave bool `json:"didSave,omitempty"`
}

type TextDocumentSyncKind

type TextDocumentSyncKind int
const TextDocumentSyncKindFull TextDocumentSyncKind = 1
const TextDocumentSyncKindIncremental TextDocumentSyncKind = 2
const TextDocumentSyncKindNone TextDocumentSyncKind = 0

type TextDocumentSyncOptions

type TextDocumentSyncOptions struct {
	// Open and close notifications are sent to the server. If omitted open
	// close notification should not be sent.
	OpenClose bool `json:"openClose,omitempty"`

	// Change notifications are sent to the server. See
	// TextDocumentSyncKind.None, TextDocumentSyncKind.Full and
	// TextDocumentSyncKind.Incremental. If omitted it defaults to
	// TextDocumentSyncKind.None.
	Change TextDocumentSyncKind `json:"change,omitempty"`

	// If present will save notifications are sent to the server. If omitted
	// the notification should not be sent.
	WillSave bool `json:"willSave,omitempty"`

	// If present will save wait until requests are sent to the server. If
	// omitted the request should not be sent.
	WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`

	// If present save notifications are sent to the server. If omitted the
	// notification should not be sent.
	Save *SaveOptions `json:"save,omitempty"`
}

type TextEdit

type TextEdit struct {
	// The range of the text document to be manipulated. To insert
	// text into a document create a range where start === end.
	Range Range `json:"range,required"`

	// The string to be inserted. For delete operations use an
	// empty string.
	NewText string `json:"newText,required"`
}

type TokenFormat

type TokenFormat string
const TokenFormatRelative TokenFormat = "relative"

type TraceValue

type TraceValue string
const TraceValueMessages TraceValue = "messages"
const TraceValueOff TraceValue = "off"
const TraceValueVerbose TraceValue = "verbose"

type TypeDefinitionClientCapabilities

type TypeDefinitionClientCapabilities struct {
	// Whether implementation supports dynamic registration. If this is set to
	// `true` the client supports the new `TypeDefinitionRegistrationOptions`
	// return value for the corresponding server capability as well.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// The client supports additional metadata in the form of definition links.
	//
	// @since 3.14.0
	LinkSupport bool `json:"linkSupport,omitempty"`
}

type TypeDefinitionOptions

TypeDefinitionOptions boolean | TypeDefinitionOptions | TypeDefinitionRegistrationOptions

func (*TypeDefinitionOptions) UnmarshalJSON

func (s *TypeDefinitionOptions) UnmarshalJSON(data []byte) error

type URI

type URI string

type Unimplemented

type Unimplemented struct{}

func (*Unimplemented) UnmarshalJSON

func (*Unimplemented) UnmarshalJSON([]byte) error

type UniquenessLevel

type UniquenessLevel string

UniquenessLevel Moniker uniqueness level to define scope of the moniker.

const UniquenessLevelDocument UniquenessLevel = "document"

UniquenessLevelDocument The moniker is only unique inside a document

const UniquenessLevelGlobal UniquenessLevel = "global"

UniquenessLevelGlobal The moniker is globally unique

const UniquenessLevelGroup UniquenessLevel = "group"

UniquenessLevelGroup The moniker is unique inside the group to which a project belongs

const UniquenessLevelProject UniquenessLevel = "project"

UniquenessLevelProject The moniker is unique inside a project for which a dump got created

const UniquenessLevelScheme UniquenessLevel = "scheme"

UniquenessLevelScheme The moniker is unique inside the moniker scheme.

type Unregistration

type Unregistration struct {
	// The id used to unregister the request or notification. Usually an id
	// provided during the register request.
	ID string `json:"id,required"`

	// The method / capability to unregister for.
	Method string `json:"method,required"`
}

Unregistration General parameters to unregister a capability.

type UnregistrationParams

type UnregistrationParams struct {
	// This should correctly be named `unregistrations`. However changing this
	// is a breaking change and needs to wait until we deliver a 4.x version
	// of the specification.
	Unregisterations []Unregistration `json:"unregisterations,required"`
}

type VersionedTextDocumentIdentifier

type VersionedTextDocumentIdentifier struct {
	TextDocumentIdentifier

	// The version number of this document.
	//
	// The version number of a document will increase after each change,
	// including undo/redo. The number doesn't need to be consecutive.
	Version int `json:"version,required"`
}

func (VersionedTextDocumentIdentifier) String

type WillSaveTextDocumentParams

type WillSaveTextDocumentParams struct {
	// The document that will be saved.
	RextDocument TextDocumentIdentifier `json:"textDocument,required"`

	// The 'TextDocumentSaveReason'.
	Reason TextDocumentSaveReason `json:"reason,required"`
}

WillSaveTextDocumentParams The parameters send in a will save text document notification.

type WorkDoneProgressBegin

type WorkDoneProgressBegin struct {

	// Mandatory title of the progress operation. Used to briefly inform about
	// the kind of operation being performed.
	//
	// Examples: "Indexing" or "Linking dependencies".
	Title string `json:"title,required"`

	// Controls if a cancel button should show to allow the user to cancel the
	// long running operation. Clients that don't support cancellation are
	// allowed to ignore the setting.
	Cancellable bool `json:"cancellable,omitempty"`

	// Optional, more detailed associated progress message. Contains
	// complementary information to the `title`.
	//
	// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
	// If unset, the previous progress message (if any) is still valid.
	Message string `json:"message,omitempty"`

	// Optional progress percentage to display (value 100 is considered 100%).
	// If not provided infinite progress is assumed and clients are allowed
	// to ignore the `percentage` value in subsequent in report notifications.
	//
	// The value should be steadily rising. Clients are free to ignore values
	// that are not following this rule. The value range is [0, 100]
	Percentage *float64 `json:"percentage,omitempty"`
}

func (WorkDoneProgressBegin) MarshalJSON

func (p WorkDoneProgressBegin) MarshalJSON() ([]byte, error)

func (WorkDoneProgressBegin) String

func (p WorkDoneProgressBegin) String() string

func (*WorkDoneProgressBegin) UnmarshalJSON

func (p *WorkDoneProgressBegin) UnmarshalJSON(data []byte) error

type WorkDoneProgressCancelParams

type WorkDoneProgressCancelParams struct {
	// The token to be used to report progress.
	Token json.RawMessage `json:"token,required"`
}

type WorkDoneProgressCreateParams

type WorkDoneProgressCreateParams struct {
	// The token to be used to report progress.
	Token json.RawMessage `json:"token,required"`
}

type WorkDoneProgressEnd

type WorkDoneProgressEnd struct {

	// Optional, a final message indicating to for example indicate the outcome
	// of the operation.
	Message string `json:"message,omitempty"`
}

func (WorkDoneProgressEnd) MarshalJSON

func (p WorkDoneProgressEnd) MarshalJSON() ([]byte, error)

func (WorkDoneProgressEnd) String

func (p WorkDoneProgressEnd) String() string

func (*WorkDoneProgressEnd) UnmarshalJSON

func (p *WorkDoneProgressEnd) UnmarshalJSON(data []byte) error

type WorkDoneProgressOptions

type WorkDoneProgressOptions struct {
	WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
}

type WorkDoneProgressParams

type WorkDoneProgressParams struct {
	// An optional token that a server can use to report work done progress.
	WorkDoneToken jsonrpc.ProgressToken `json:"workDoneToken,omitempty"`
}

type WorkDoneProgressReport

type WorkDoneProgressReport struct {

	// Controls enablement state of a cancel button. This property is only valid
	// if a cancel button got requested in the `WorkDoneProgressBegin` payload.
	//
	// Clients that don't support cancellation or don't support control the
	// button's enablement state are allowed to ignore the setting.
	Cancellable bool `json:"cancellable,omitempty"`

	// Optional, more detailed associated progress message. Contains
	// complementary information to the `title`.
	//
	// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
	// If unset, the previous progress message (if any) is still valid.
	Message string `json:"message,omitempty"`

	// Optional progress percentage to display (value 100 is considered 100%).
	// If not provided infinite progress is assumed and clients are allowed
	// to ignore the `percentage` value in subsequent in report notifications.
	//
	// The value should be steadily rising. Clients are free to ignore values
	// that are not following this rule. The value range is [0, 100]
	Percentage *float64 `json:"percentage,omitempty"`
}

func (WorkDoneProgressReport) MarshalJSON

func (p WorkDoneProgressReport) MarshalJSON() ([]byte, error)

func (WorkDoneProgressReport) String

func (p WorkDoneProgressReport) String() string

func (*WorkDoneProgressReport) UnmarshalJSON

func (p *WorkDoneProgressReport) UnmarshalJSON(data []byte) error

type WorkspaceEdit

type WorkspaceEdit struct {

	// changes?: { [uri: DocumentUri]: TextEdit[]; };
	Changes map[DocumentURI][]TextEdit `json:"changes,omitempty"`

	// A map of change annotations that can be referenced in
	// `AnnotatedTextEdit`s or create, rename and delete file / folder
	// operations.
	//
	// Whether clients honor this property depends on the client capability
	// `workspace.changeAnnotationSupport`.
	//
	// @since 3.16.0
	//
	// changeAnnotations?: {
	// 	[id: string /* ChangeAnnotationIdentifier */]: ChangeAnnotation;
	// };
	ChangeAnnotations map[string]ChangeAnnotation `json:"changeAnnotations,omitempty"`
}

type WorkspaceEditClientCapabilities

type WorkspaceEditClientCapabilities struct {

	// The client supports versioned document changes in `WorkspaceEdit`s
	DocumentChanges bool `json:"documentChanges,omitempty"`

	// The resource operations the client supports. Clients should at least
	// support 'create', 'rename' and 'delete' files and folders.
	//
	// @since 3.13.0
	ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"`

	// The failure handling strategy of a client if applying the workspace edit
	// fails.
	//
	// @since 3.13.0
	FailureHandling *FailureHandlingKind `json:"failureHandling,omitempty"`

	// Whether the client normalizes line endings to the client specific
	// setting.
	// If set to `true` the client will normalize line ending characters
	// in a workspace edit to the client specific new line character(s).
	//
	// @since 3.16.0
	NormalizesLineEndings bool `json:"normalizesLineEndings,omitempty"`

	// Whether the client in general supports change annotations on text edits,
	// create file, rename file and delete file changes.
	//
	// @since 3.16.0
	ChangeAnnotationSupport *struct {
		// Whether the client groups edits with equal labels into tree nodes,
		// for instance all edits labelled with "Changes in Strings" would
		// be a tree node.
		GroupsOnLabel bool `json:"groupsOnLabel,omitempty"`
	} `json:"changeAnnotationSupport,omitempty"`
}

type WorkspaceFolder

type WorkspaceFolder struct {
	// The associated URI for this workspace folder.
	URI DocumentURI `json:"uri,required"`

	// The name of the workspace folder. Used to refer to this
	// workspace folder in the user interface.
	Name string `json:"name,required"`
}

type WorkspaceFoldersChangeEvent

type WorkspaceFoldersChangeEvent struct {
	// The array of added workspace folders
	Added []WorkspaceFolder `json:"added,required"`

	// The array of the removed workspace folders
	Eemoved []WorkspaceFolder `json:"removed,required"`
}

WorkspaceFoldersChangeEvent The workspace folder change event.

type WorkspaceFoldersServerCapabilities

type WorkspaceFoldersServerCapabilities struct {
	// The server has support for workspace folders
	Supported bool `json:"supported,omitempty"`

	// Whether the server wants to receive workspace folder
	// change notifications.
	//
	// If a string is provided, the string is treated as an ID
	// under which the notification is registered on the client
	// side. The ID can be used to unregister for these events
	// using the `client/unregisterCapability` request.
	ChangeNotifications json.RawMessage `json:"changeNotifications,omitempty"`
}

type WorkspaceSymbolClientCapabilities

type WorkspaceSymbolClientCapabilities struct {
	// Symbol request supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

	// Specific capabilities for the `SymbolKind` in the `workspace/symbol`
	// request.
	SymbolKind *struct {
		// The symbol kind values the client supports. When this
		// property exists the client also guarantees that it will
		// handle values outside its set gracefully and falls back
		// to a default value when unknown.
		//
		// If this property is not present the client only supports
		// the symbol kinds from `File` to `Array` as defined in
		// the initial version of the protocol.
		ValueSet *[]SymbolKind `json:"valueSet,omitempty"`
	} `json:"symbolKind,omitempty"`

	// The client supports tags on `SymbolInformation`.
	// Clients supporting tags have to handle unknown tags gracefully.
	//
	// @since 3.16.0
	TagSupport *struct {
		// The tags supported by the client.
		ValueSet []SymbolTag `json:"valueSet,omitempty"`
	} `json:"tagSupport,omitempty"`
}

type WorkspaceSymbolOptions

type WorkspaceSymbolOptions struct {
	*WorkDoneProgressOptions
}

func (*WorkspaceSymbolOptions) UnmarshalJSON

func (s *WorkspaceSymbolOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON boolean | WorkspaceSymbolOptions where WorkspaceSymbolOptions is defined as follows:

type WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	*WorkDoneProgressParams
	*PartialResultParams

	// A query string to filter symbols by. Clients may send an empty
	// string here to request all symbols.
	Query string `json:"query,required"`
}

WorkspaceSymbolParams The parameters of a Workspace Symbol Request.

type WorkspaceSymbolRegistrationOptions

type WorkspaceSymbolRegistrationOptions struct {
	*WorkspaceSymbolOptions
}

Directories

Path Synopsis
Package jsonrpc is an implementation of a Language Server Protocol JSON-RPC protocol.
Package jsonrpc is an implementation of a Language Server Protocol JSON-RPC protocol.

Jump to

Keyboard shortcuts

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