protocol

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: BSD-3-Clause Imports: 12 Imported by: 102

README

protocol

CircleCI pkg.go.dev Go module codecov.io GA

Package protocol implements Language Server Protocol specification in Go.

Documentation

Overview

Package protocol implements Language Server Protocol specification in Go.

This package contains the structs that map directly to the wire format of the Language Server Protocol.

It is a literal transcription, with unmodified comments, and only the changes required to make it Go code.

- Names are uppercased to export them.

- All fields have JSON tags added to correct the names.

- Fields marked with a ? are also marked as "omitempty".

- Fields that are "|| null" are made pointers.

- Fields that are string or number are left as string.

- Fields that are type "number" are made float64.

Index

Constants

View Source
const (
	// MethodProgress method name of "$/progress".
	MethodProgress = "$/progress"

	// MethodWorkDoneProgressCreate method name of "window/workDoneProgress/create".
	MethodWorkDoneProgressCreate = "window/workDoneProgress/create"

	// MethodWindowShowMessage method name of "window/showMessage".
	MethodWindowShowMessage = "window/showMessage"

	// MethodWindowShowMessageRequest method name of "window/showMessageRequest.
	MethodWindowShowMessageRequest = "window/showMessageRequest"

	// MethodWindowLogMessage method name of "window/logMessage.
	MethodWindowLogMessage = "window/logMessage"

	// MethodTelemetryEvent method name of "telemetry/event.
	MethodTelemetryEvent = "telemetry/event"

	// MethodClientRegisterCapability method name of "client/registerCapability.
	MethodClientRegisterCapability = "client/registerCapability"

	// MethodClientUnregisterCapability method name of "client/unregisterCapability.
	MethodClientUnregisterCapability = "client/unregisterCapability"

	// MethodTextDocumentPublishDiagnostics method name of "textDocument/publishDiagnostics.
	MethodTextDocumentPublishDiagnostics = "textDocument/publishDiagnostics"

	// MethodWorkspaceApplyEdit method name of "workspace/applyEdit.
	MethodWorkspaceApplyEdit = "workspace/applyEdit"

	// MethodWorkspaceConfiguration method name of "workspace/configuration.
	MethodWorkspaceConfiguration = "workspace/configuration"

	// MethodWorkspaceWorkspaceFolders method name of "workspace/workspaceFolders".
	MethodWorkspaceWorkspaceFolders = "workspace/workspaceFolders"
)

list of client methods.

View Source
const (
	// LSPReservedErrorRangeStart is the start range of LSP reserved error codes.
	//
	// It doesn't denote a real error code.
	//
	// @since 3.16.0.
	LSPReservedErrorRangeStart jsonrpc2.Code = -32899

	// ContentModified is the state change that invalidates the result of a request in execution.
	//
	// Defined by the protocol.
	CodeContentModified jsonrpc2.Code = -32801

	// RequestCancelled is the cancellation error.
	//
	// Defined by the protocol.
	CodeRequestCancelled jsonrpc2.Code = -32800

	// LSPReservedErrorRangeEnd is the end range of LSP reserved error codes.
	//
	// It doesn't denote a real error code.
	//
	// @since 3.16.0.
	LSPReservedErrorRangeEnd jsonrpc2.Code = -32800
)
View Source
const (
	// MethodCancelRequest method name of "$/cancelRequest".
	MethodCancelRequest = "$/cancelRequest"

	// MethodInitialize method name of "initialize".
	MethodInitialize = "initialize"

	// MethodInitialized method name of "initialized".
	MethodInitialized = "initialized"

	// MethodShutdown method name of "shutdown".
	MethodShutdown = "shutdown"

	// MethodExit method name of "exit".
	MethodExit = "exit"

	// MethodWorkDoneProgressCancel method name of "window/workDoneProgress/cancel".
	MethodWorkDoneProgressCancel = "window/workDoneProgress/cancel"

	// MethodLogTrace method name of "$/logTrace".
	MethodLogTrace = "$/logTrace"

	// MethodSetTrace method name of "$/setTrace".
	MethodSetTrace = "$/setTrace"

	// MethodTextDocumentCodeAction method name of "textDocument/codeAction".
	MethodTextDocumentCodeAction = "textDocument/codeAction"

	// MethodTextDocumentCodeLens method name of "textDocument/codeLens".
	MethodTextDocumentCodeLens = "textDocument/codeLens"

	// MethodCodeLensResolve method name of "codeLens/resolve".
	MethodCodeLensResolve = "codeLens/resolve"

	// MethodTextDocumentColorPresentation method name of "textDocument/colorPresentation".
	MethodTextDocumentColorPresentation = "textDocument/colorPresentation"

	// MethodTextDocumentCompletion method name of "textDocument/completion".
	MethodTextDocumentCompletion = "textDocument/completion"

	// MethodCompletionItemResolve method name of "completionItem/resolve".
	MethodCompletionItemResolve = "completionItem/resolve"

	// MethodTextDocumentDeclaration method name of "textDocument/declaration".
	MethodTextDocumentDeclaration = "textDocument/declaration"

	// MethodTextDocumentDefinition method name of "textDocument/definition".
	MethodTextDocumentDefinition = "textDocument/definition"

	// MethodTextDocumentDidChange method name of "textDocument/didChange".
	MethodTextDocumentDidChange = "textDocument/didChange"

	// MethodWorkspaceDidChangeConfiguration method name of "workspace/didChangeConfiguration".
	MethodWorkspaceDidChangeConfiguration = "workspace/didChangeConfiguration"

	// MethodWorkspaceDidChangeWatchedFiles method name of "workspace/didChangeWatchedFiles".
	MethodWorkspaceDidChangeWatchedFiles = "workspace/didChangeWatchedFiles"

	// MethodWorkspaceDidChangeWorkspaceFolders method name of "workspace/didChangeWorkspaceFolders".
	MethodWorkspaceDidChangeWorkspaceFolders = "workspace/didChangeWorkspaceFolders"

	// MethodTextDocumentDidClose method name of "textDocument/didClose".
	MethodTextDocumentDidClose = "textDocument/didClose"

	// MethodTextDocumentDidOpen method name of "textDocument/didOpen".
	MethodTextDocumentDidOpen = "textDocument/didOpen"

	// MethodTextDocumentDidSave method name of "textDocument/didSave".
	MethodTextDocumentDidSave = "textDocument/didSave"

	// MethodTextDocumentDocumentColor method name of"textDocument/documentColor".
	MethodTextDocumentDocumentColor = "textDocument/documentColor"

	// MethodTextDocumentDocumentHighlight method name of "textDocument/documentHighlight".
	MethodTextDocumentDocumentHighlight = "textDocument/documentHighlight"

	// MethodTextDocumentDocumentLink method name of "textDocument/documentLink".
	MethodTextDocumentDocumentLink = "textDocument/documentLink"

	// MethodDocumentLinkResolve method name of "documentLink/resolve".
	MethodDocumentLinkResolve = "documentLink/resolve"

	// MethodTextDocumentDocumentSymbol method name of "textDocument/documentSymbol".
	MethodTextDocumentDocumentSymbol = "textDocument/documentSymbol"

	// MethodWorkspaceExecuteCommand method name of "workspace/executeCommand".
	MethodWorkspaceExecuteCommand = "workspace/executeCommand"

	// MethodTextDocumentFoldingRange method name of "textDocument/foldingRange".
	MethodTextDocumentFoldingRange = "textDocument/foldingRange"

	// MethodTextDocumentFormatting method name of "textDocument/formatting".
	MethodTextDocumentFormatting = "textDocument/formatting"

	// MethodTextDocumentHover method name of "textDocument/hover".
	MethodTextDocumentHover = "textDocument/hover"

	// MethodTextDocumentImplementation method name of "textDocument/implementation".
	MethodTextDocumentImplementation = "textDocument/implementation"

	// MethodTextDocumentOnTypeFormatting method name of "textDocument/onTypeFormatting".
	MethodTextDocumentOnTypeFormatting = "textDocument/onTypeFormatting"

	// MethodTextDocumentPrepareRename method name of "textDocument/prepareRename".
	MethodTextDocumentPrepareRename = "textDocument/prepareRename"

	// MethodTextDocumentRangeFormatting method name of "textDocument/rangeFormatting".
	MethodTextDocumentRangeFormatting = "textDocument/rangeFormatting"

	// MethodTextDocumentReferences method name of "textDocument/references".
	MethodTextDocumentReferences = "textDocument/references"

	// MethodTextDocumentRename method name of "textDocument/rename".
	MethodTextDocumentRename = "textDocument/rename"

	// MethodTextDocumentSignatureHelp method name of "textDocument/signatureHelp".
	MethodTextDocumentSignatureHelp = "textDocument/signatureHelp"

	// MethodWorkspaceSymbol method name of "workspace/symbol".
	MethodWorkspaceSymbol = "workspace/symbol"

	// MethodTextDocumentTypeDefinition method name of "textDocument/typeDefinition".
	MethodTextDocumentTypeDefinition = "textDocument/typeDefinition"

	// MethodTextDocumentWillSave method name of "textDocument/willSave".
	MethodTextDocumentWillSave = "textDocument/willSave"

	// MethodTextDocumentWillSaveWaitUntil method name of "textDocument/willSaveWaitUntil".
	MethodTextDocumentWillSaveWaitUntil = "textDocument/willSaveWaitUntil"

	// MethodShowDocument method name of "window/showDocument".
	MethodShowDocument = "window/showDocument"

	// MethodWillCreateFiles method name of "workspace/willCreateFiles".
	MethodWillCreateFiles = "workspace/willCreateFiles"

	// MethodDidCreateFiles method name of "workspace/didCreateFiles".
	MethodDidCreateFiles = "workspace/didCreateFiles"

	// MethodWillRenameFiles method name of "workspace/willRenameFiles".
	MethodWillRenameFiles = "workspace/willRenameFiles"

	// MethodDidRenameFiles method name of "workspace/didRenameFiles".
	MethodDidRenameFiles = "workspace/didRenameFiles"

	// MethodWillDeleteFiles method name of "workspace/willDeleteFiles".
	MethodWillDeleteFiles = "workspace/willDeleteFiles"

	// MethodDidDeleteFiles method name of "workspace/didDeleteFiles".
	MethodDidDeleteFiles = "workspace/didDeleteFiles"

	// MethodCodeLensRefresh method name of "workspace/codeLens/refresh".
	MethodCodeLensRefresh = "workspace/codeLens/refresh"

	// MethodTextDocumentPrepareCallHierarchy method name of "textDocument/prepareCallHierarchy".
	MethodTextDocumentPrepareCallHierarchy = "textDocument/prepareCallHierarchy"

	// MethodCallHierarchyIncomingCalls method name of "callHierarchy/incomingCalls".
	MethodCallHierarchyIncomingCalls = "callHierarchy/incomingCalls"

	// MethodCallHierarchyOutgoingCalls method name of "callHierarchy/outgoingCalls".
	MethodCallHierarchyOutgoingCalls = "callHierarchy/outgoingCalls"

	// MethodSemanticTokensFull method name of "textDocument/semanticTokens/full".
	MethodSemanticTokensFull = "textDocument/semanticTokens/full"

	// MethodSemanticTokensFullDelta method name of "textDocument/semanticTokens/full/delta".
	MethodSemanticTokensFullDelta = "textDocument/semanticTokens/full/delta"

	// MethodSemanticTokensRange method name of "textDocument/semanticTokens/range".
	MethodSemanticTokensRange = "textDocument/semanticTokens/range"

	// MethodSemanticTokensRefresh method name of "workspace/semanticTokens/refresh".
	MethodSemanticTokensRefresh = "workspace/semanticTokens/refresh"

	// MethodLinkedEditingRange method name of "textDocument/linkedEditingRange".
	MethodLinkedEditingRange = "textDocument/linkedEditingRange"

	// MethodMoniker method name of "textDocument/moniker".
	MethodMoniker = "textDocument/moniker"
)

list of server methods.

Abort alias of FailureHandlingKindAbort.

Deprecated: Use FailureHandlingKindAbort instead.

TextOnlyTransactional alias of FailureHandlingKindTextOnlyTransactional.

Deprecated: Use FailureHandlingKindTextOnlyTransactional instead.

Transactional alias of FailureHandlingKindTransactional.

Deprecated: Use FailureHandlingKindTransactional instead.

Undo alias of FailureHandlingKindUndo.

Deprecated: Use FailureHandlingKindUndo instead.

View Source
const Version = "3.15.3"

Version is the version of the language-server-protocol specification being implemented.

Variables

View Source
var (
	// ErrContentModified should be used when a request is canceled early.
	ErrContentModified = jsonrpc2.NewError(CodeContentModified, "cancelled JSON-RPC")

	// ErrRequestCancelled should be used when a request is canceled early.
	ErrRequestCancelled = jsonrpc2.NewError(CodeRequestCancelled, "cancelled JSON-RPC")
)
View Source
var EOL = []string{"\n", "\r\n", "\r"}

EOL denotes represents the character offset.

Functions

func Call added in v0.9.0

func Call(ctx context.Context, conn jsonrpc2.Conn, method string, params, result interface{}) error

Call calls method to params and result.

func CancelHandler added in v0.9.0

func CancelHandler(handler jsonrpc2.Handler) jsonrpc2.Handler

CancelHandler handler of cancelling.

func ClientHandler added in v0.9.0

func ClientHandler(client Client, handler jsonrpc2.Handler) jsonrpc2.Handler

ClientHandler handler of LSP client.

func Handlers added in v0.9.0

func Handlers(handler jsonrpc2.Handler) jsonrpc2.Handler

Handlers default jsonrpc2.Handler.

func LoggerFromContext

func LoggerFromContext(ctx context.Context) *zap.Logger

LoggerFromContext extracts zap.Logger from context.

func LoggingStream added in v0.9.0

func LoggingStream(stream jsonrpc2.Stream, w io.Writer) jsonrpc2.Stream

LoggingStream returns a stream that does LSP protocol logging.

func NewVersion added in v0.10.0

func NewVersion(i int32) *int32

NewVersion returns the int32 pointer converted i.

func ServerHandler added in v0.9.0

func ServerHandler(server Server, handler jsonrpc2.Handler) jsonrpc2.Handler

ServerHandler jsonrpc2.Handler of Language Server Prococol Server.

func WithClient

func WithClient(ctx context.Context, client Client) context.Context

WithClient returns the context with Client value.

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

WithLogger returns the context with zap.Logger value.

Types

type AnnotatedTextEdit added in v0.11.0

type AnnotatedTextEdit struct {
	TextEdit

	// AnnotationID is the actual annotation identifier.
	AnnotationID ChangeAnnotationIdentifier `json:"annotationId"`
}

AnnotatedTextEdit is a special text edit with an additional change annotation.

@since 3.16.0.

type ApplyWorkspaceEditParams

type ApplyWorkspaceEditParams struct {
	// Label 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,omitempty"`

	// Edit is the edits to apply.
	Edit WorkspaceEdit `json:"edit"`
}

ApplyWorkspaceEditParams params of Applies a WorkspaceEdit.

type ApplyWorkspaceEditResponse

type ApplyWorkspaceEditResponse struct {
	// Applied indicates whether the edit was applied or not.
	Applied bool `json:"applied"`

	// FailureReason 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.
	//
	// @since 3.16.0.
	FailureReason string `json:"failureReason,omitempty"`

	// FailedChange 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 "failureHandlingStrategy"
	// in its client capabilities.
	//
	// @since 3.16.0.
	FailedChange uint32 `json:"failedChange,omitempty"`
}

ApplyWorkspaceEditResponse response of Applies a WorkspaceEdit.

type CallHierarchy added in v0.11.0

type CallHierarchy struct {
	// DynamicRegistration 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"`
}

CallHierarchy capabilities specific to the "textDocument/callHierarchy".

@since 3.16.0.

type CallHierarchyClientCapabilities added in v0.11.1

type CallHierarchyClientCapabilities struct {
	// DynamicRegistration 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"`
}

CallHierarchyClientCapabilities capabilities specific to "textDocument/callHierarchy" requests.

@since 3.16.0.

type CallHierarchyIncomingCall added in v0.11.0

type CallHierarchyIncomingCall struct {
	// From is the item that makes the call.
	From CallHierarchyItem `json:"from"`

	// FromRanges is the ranges at which the calls appear. This is relative to the caller
	// denoted by From.
	FromRanges []Range `json:"fromRanges"`
}

CallHierarchyIncomingCall is the result of a "callHierarchy/incomingCalls" request.

@since 3.16.0.

type CallHierarchyIncomingCallsParams added in v0.11.0

type CallHierarchyIncomingCallsParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// Item is the IncomingCalls item.
	Item CallHierarchyItem `json:"item"`
}

CallHierarchyIncomingCallsParams params of CallHierarchyIncomingCalls.

@since 3.16.0.

type CallHierarchyItem added in v0.11.0

type CallHierarchyItem struct {
	// name is the name of this item.
	Name string `json:"name"`

	// Kind is the kind of this item.
	Kind SymbolKind `json:"kind"`

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

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

	// URI is the resource identifier of this item.
	URI DocumentURI `json:"uri"`

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

	// SelectionRange is 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"`

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

CallHierarchyItem is the result of a "textDocument/prepareCallHierarchy" request.

@since 3.16.0.

type CallHierarchyOptions added in v0.11.0

type CallHierarchyOptions struct {
	WorkDoneProgressOptions
}

CallHierarchyOptions option of CallHierarchy.

@since 3.16.0.

type CallHierarchyOutgoingCall added in v0.11.0

type CallHierarchyOutgoingCall struct {
	// To is the item that is called.
	To CallHierarchyItem `json:"to"`

	// FromRanges is 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"`
}

CallHierarchyOutgoingCall is the result of a "callHierarchy/outgoingCalls" request.

@since 3.16.0.

type CallHierarchyOutgoingCallsParams added in v0.11.0

type CallHierarchyOutgoingCallsParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// Item is the OutgoingCalls item.
	Item CallHierarchyItem `json:"item"`
}

CallHierarchyOutgoingCallsParams params of CallHierarchyOutgoingCalls.

@since 3.16.0.

type CallHierarchyPrepareParams added in v0.11.0

type CallHierarchyPrepareParams struct {
	TextDocumentPositionParams
	WorkDoneProgressParams
}

CallHierarchyPrepareParams params of CallHierarchyPrepare.

@since 3.16.0.

type CallHierarchyRegistrationOptions added in v0.11.0

type CallHierarchyRegistrationOptions struct {
	TextDocumentRegistrationOptions
	CallHierarchyOptions
	StaticRegistrationOptions
}

CallHierarchyRegistrationOptions registration options of CallHierarchy.

@since 3.16.0.

type CancelParams

type CancelParams struct {
	// ID is the request id to cancel.
	ID interface{} `json:"id"` // int32 | string
}

CancelParams params of cancelRequest.

type ChangeAnnotation added in v0.11.0

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

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

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

ChangeAnnotation is the additional information that describes document changes.

@since 3.16.0.

type ChangeAnnotationIdentifier added in v0.11.0

type ChangeAnnotationIdentifier string

ChangeAnnotationIdentifier an identifier referring to a change annotation managed by a workspace edit.

@since 3.16.0.

type Client added in v0.9.0

type Client interface {
	Progress(ctx context.Context, params *ProgressParams) (err error)
	WorkDoneProgressCreate(ctx context.Context, params *WorkDoneProgressCreateParams) (err error)
	LogMessage(ctx context.Context, params *LogMessageParams) (err error)
	PublishDiagnostics(ctx context.Context, params *PublishDiagnosticsParams) (err error)
	ShowMessage(ctx context.Context, params *ShowMessageParams) (err error)
	ShowMessageRequest(ctx context.Context, params *ShowMessageRequestParams) (result *MessageActionItem, err error)
	Telemetry(ctx context.Context, params interface{}) (err error)
	RegisterCapability(ctx context.Context, params *RegistrationParams) (err error)
	UnregisterCapability(ctx context.Context, params *UnregistrationParams) (err error)
	ApplyEdit(ctx context.Context, params *ApplyWorkspaceEditParams) (result bool, err error)
	Configuration(ctx context.Context, params *ConfigurationParams) (result []interface{}, err error)
	WorkspaceFolders(ctx context.Context) (result []WorkspaceFolder, err error)
}

Client represents a Language Server Protocol client.

func ClientDispatcher added in v0.9.0

func ClientDispatcher(conn jsonrpc2.Conn, logger *zap.Logger) Client

ClientDispatcher returns a Client that dispatches LSP requests across the given jsonrpc2 connection.

func NewServer

func NewServer(ctx context.Context, server Server, stream jsonrpc2.Stream, logger *zap.Logger) (context.Context, jsonrpc2.Conn, Client)

NewServer returns the context in which client is embedded, jsonrpc2.Conn, and the Client.

type ClientCapabilities

type ClientCapabilities struct {
	// Workspace specific client capabilities.
	Workspace *WorkspaceClientCapabilities `json:"workspace,omitempty"`

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

	// Window specific client capabilities.
	Window *WindowClientCapabilities `json:"window,omitempty"`

	// General client capabilities.
	//
	// @since 3.16.0.
	General *GeneralClientCapabilities `json:"general,omitempty"`

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

ClientCapabilities now define capabilities for dynamic registration, workspace and text document features the client supports.

The experimental can be used to pass experimental capabilities under development.

For future compatibility a ClientCapabilities object literal can have more properties set than currently defined. Servers receiving a ClientCapabilities object literal with unknown properties should ignore these properties.

A missing property should be interpreted as an absence of the capability. If a missing property normally defines sub properties, all missing sub properties should be interpreted as an absence of the corresponding capability.

type ClientCapabilitiesShowDocument deprecated added in v0.11.0

type ClientCapabilitiesShowDocument = ShowDocumentClientCapabilities

ClientCapabilitiesShowDocument alias of ShowDocumentClientCapabilities.

Deprecated: Use ShowDocumentClientCapabilities instead.

type ClientCapabilitiesShowMessageRequest deprecated added in v0.11.0

type ClientCapabilitiesShowMessageRequest = ShowMessageRequestClientCapabilities

ClientCapabilitiesShowMessageRequest alias of ShowMessageRequestClientCapabilities.

Deprecated: Use ShowMessageRequestClientCapabilities instead.

type ClientCapabilitiesShowMessageRequestMessageActionItem deprecated added in v0.11.0

type ClientCapabilitiesShowMessageRequestMessageActionItem = ShowMessageRequestClientCapabilitiesMessageActionItem

ClientCapabilitiesShowMessageRequestMessageActionItem alias of ShowMessageRequestClientCapabilitiesMessageActionItem.

Deprecated: Use ShowMessageRequestClientCapabilitiesMessageActionItem instead.

type ClientInfo added in v0.10.0

type ClientInfo struct {
	// Name is the name of the client as defined by the client.
	Name string `json:"name"`

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

ClientInfo information about the client.

@since 3.15.0.

type CodeAction

type CodeAction struct {
	// Title is a short, human-readable, title for this code action.
	Title string `json:"title"`

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

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

	// IsPreferred 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"`

	// Disabled 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 *CodeActionDisable `json:"disabled,omitempty"`

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

	// Command is 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"`

	// Data is 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 interface{} `json:"data,omitempty"`
}

CodeAction capabilities specific to the `textDocument/codeAction`.

type CodeActionClientCapabilities added in v0.11.1

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

	// CodeActionLiteralSupport is the client support code action literals as a valid
	// response of the "textDocument/codeAction" request.
	//
	// @since 3.8.0
	CodeActionLiteralSupport *CodeActionClientCapabilitiesLiteralSupport `json:"codeActionLiteralSupport,omitempty"`

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

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

	// DataSupport 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"`

	// ResolveSupport whether the client supports resolving additional code action
	// properties via a separate `codeAction/resolve` request.
	//
	// @since 3.16.0.
	ResolveSupport *CodeActionClientCapabilitiesResolveSupport `json:"resolveSupport,omitempty"`

	// HonorsChangeAnnotations 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"`
}

CodeActionClientCapabilities capabilities specific to the "textDocument/codeAction".

type CodeActionClientCapabilitiesKind added in v0.11.1

type CodeActionClientCapabilitiesKind struct {
	// ValueSet is 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"`
}

CodeActionClientCapabilitiesKind is the code action kind is support with the following value set.

type CodeActionClientCapabilitiesLiteralSupport added in v0.11.1

type CodeActionClientCapabilitiesLiteralSupport struct {
	// CodeActionKind is the code action kind is support with the following value
	// set.
	CodeActionKind *CodeActionClientCapabilitiesKind `json:"codeActionKind"`
}

CodeActionClientCapabilitiesLiteralSupport is the client support code action literals as a valid response of the "textDocument/codeAction" request.

type CodeActionClientCapabilitiesResolveSupport added in v0.11.1

type CodeActionClientCapabilitiesResolveSupport struct {
	// Properties is the properties that a client can resolve lazily.
	Properties []string `json:"properties"`
}

CodeActionClientCapabilitiesResolveSupport ResolveSupport in the CodeActionClientCapabilities.

@since 3.16.0.

type CodeActionContext

type CodeActionContext struct {
	// Diagnostics is an array of diagnostics.
	Diagnostics []Diagnostic `json:"diagnostics"`

	// Only 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 CodeActionDisable added in v0.11.0

type CodeActionDisable struct {
	// Reason human readable description of why the code action is currently
	// disabled.
	//
	// This is displayed in the code actions UI.
	Reason string `json:"reason"`
}

CodeActionDisable Disable in CodeAction.

@since 3.16.0.

type CodeActionKind

type CodeActionKind string

CodeActionKind is 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.

const (
	// QuickFix base kind for quickfix actions: 'quickfix'.
	QuickFix CodeActionKind = "quickfix"

	// Refactor base kind for refactoring actions: 'refactor'.
	Refactor CodeActionKind = "refactor"

	// RefactorExtract base kind for refactoring extraction actions: 'refactor.extract'
	//
	// Example extract actions:
	//
	// - Extract method
	// - Extract function
	// - Extract variable
	// - Extract interface from class
	// - ...
	RefactorExtract CodeActionKind = "refactor.extract"

	// RefactorInline base kind for refactoring inline actions: 'refactor.inline'
	//
	// Example inline actions:
	//
	// - Inline function
	// - Inline variable
	// - Inline constant
	// - ...
	RefactorInline CodeActionKind = "refactor.inline"

	// RefactorRewrite 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
	// - ...
	RefactorRewrite CodeActionKind = "refactor.rewrite"

	// Source base kind for source actions: `source`
	//
	// Source code actions apply to the entire file.
	Source CodeActionKind = "source"

	// SourceOrganizeImports base kind for an organize imports source action: `source.organizeImports`.
	SourceOrganizeImports CodeActionKind = "source.organizeImports"
)

A set of predefined code action kinds.

type CodeActionOptions

type CodeActionOptions struct {
	// 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"`

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

CodeActionOptions CodeAction options.

type CodeActionParams

type CodeActionParams struct {
	WorkDoneProgressParams
	PartialResultParams

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

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

	// Range is the range for which the command was invoked.
	Range Range `json:"range"`
}

CodeActionParams params for the CodeActionRequest.

type CodeActionRegistrationOptions

type CodeActionRegistrationOptions struct {
	TextDocumentRegistrationOptions

	CodeActionOptions
}

CodeActionRegistrationOptions CodeAction Registrationi options.

type CodeDescription added in v0.11.0

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

CodeDescription is the structure to capture a description for an error code.

@since 3.16.0.

type CodeLens

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

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

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

CodeLens is 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 added in v0.11.1

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

CodeLensClientCapabilities capabilities specific to the "textDocument/codeLens".

type CodeLensOptions

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

CodeLensOptions CodeLens options.

type CodeLensParams

type CodeLensParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the document to request code lens for.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

CodeLensParams params of Code Lens request.

type CodeLensRegistrationOptions

type CodeLensRegistrationOptions struct {
	TextDocumentRegistrationOptions

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

CodeLensRegistrationOptions CodeLens Registration options.

type CodeLensWorkspaceClientCapabilities added in v0.11.1

type CodeLensWorkspaceClientCapabilities struct {
	// RefreshSupport 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"`
}

CodeLensWorkspaceClientCapabilities capabilities specific to the "workspace/codeLens" request.

@since 3.16.0.

type Color

type Color struct {
	// Alpha is the alpha component of this color in the range [0-1].
	Alpha float64 `json:"alpha"`

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

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

	// Red is the red component of this color in the range [0-1].
	Red float64 `json:"red"`
}

Color represents a color in RGBA space.

type ColorInformation

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

	// Color is the actual color value for this color range.
	Color Color `json:"color"`
}

ColorInformation response of Document Color request.

type ColorPresentation

type ColorPresentation struct {
	// Label is 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"`

	// TextEdit an edit which is applied to a document when selecting
	// this presentation for the color.  When `falsy` the label is used.
	TextEdit *TextEdit `json:"textEdit,omitempty"`

	// AdditionalTextEdits 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"`
}

ColorPresentation response of Color Presentation request.

type ColorPresentationParams

type ColorPresentationParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// Color is the color information to request presentations for.
	Color Color `json:"color"`

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

ColorPresentationParams params of Color Presentation request.

type Command

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

	// Command is the identifier of the actual command handler.
	Command string `json:"command"`

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

Command represents a reference to a command. Provides a title which will be used to represent a command in the UI.

Commands are identified by a string identifier. The recommended way to handle commands is to implement their execution on the server side if the client and server provides the corresponding capabilities.

Alternatively the tool extension code could handle the command. The protocol currently doesn't specify a set of well-known commands.

type CompletionContext

type CompletionContext struct {
	// TriggerCharacter is the trigger character (a single character) that has trigger code complete.
	// Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
	TriggerCharacter string `json:"triggerCharacter,omitempty"`

	// TriggerKind how the completion was triggered.
	TriggerKind CompletionTriggerKind `json:"triggerKind"`
}

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

type CompletionItem

type CompletionItem struct {
	// AdditionalTextEdits 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"`

	// Command 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"`

	// CommitCharacters 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"`

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

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

	// Deprecated indicates if this item is deprecated.
	Deprecated bool `json:"deprecated,omitempty"`

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

	// Documentation a human-readable string that represents a doc-comment.
	Documentation interface{} `json:"documentation,omitempty"`

	// FilterText a string that should be used when filtering a set of
	// completion items. When `falsy` the label is used.
	FilterText string `json:"filterText,omitempty"`

	// InsertText a string that should be inserted into a document when selecting
	// this completion. When `falsy` the label is used.
	//
	// 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"`

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

	// InsertTextMode 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.
	InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`

	// Kind is the kind of this completion item. Based of the kind
	// an icon is chosen by the editor.
	Kind CompletionItemKind `json:"kind,omitempty"`

	// Label is the label of this completion item. By default
	// also the text that is inserted when selecting
	// this completion.
	Label string `json:"label"`

	// Preselect 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"`

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

	// TextEdit 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 `InsertReplaceEdits` via the
	// "textDocument.completion.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".
	TextEdit *TextEdit `json:"textEdit,omitempty"` // *TextEdit | *InsertReplaceEdit
}

CompletionItem item of CompletionList.

type CompletionItemKind

type CompletionItemKind float64

CompletionItemKind is 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.

const (
	// CompletionItemKindText text completion kind.
	CompletionItemKindText CompletionItemKind = 1
	// CompletionItemKindMethod method completion kind.
	CompletionItemKindMethod CompletionItemKind = 2
	// CompletionItemKindFunction function completion kind.
	CompletionItemKindFunction CompletionItemKind = 3
	// CompletionItemKindConstructor constructor completion kind.
	CompletionItemKindConstructor CompletionItemKind = 4
	// CompletionItemKindField field completion kind.
	CompletionItemKindField CompletionItemKind = 5
	// CompletionItemKindVariable variable completion kind.
	CompletionItemKindVariable CompletionItemKind = 6
	// CompletionItemKindClass class completion kind.
	CompletionItemKindClass CompletionItemKind = 7
	// CompletionItemKindInterface interface completion kind.
	CompletionItemKindInterface CompletionItemKind = 8
	// CompletionItemKindModule module completion kind.
	CompletionItemKindModule CompletionItemKind = 9
	// CompletionItemKindProperty property completion kind.
	CompletionItemKindProperty CompletionItemKind = 10
	// CompletionItemKindUnit unit completion kind.
	CompletionItemKindUnit CompletionItemKind = 11
	// CompletionItemKindValue value completion kind.
	CompletionItemKindValue CompletionItemKind = 12
	// CompletionItemKindEnum enum completion kind.
	CompletionItemKindEnum CompletionItemKind = 13
	// CompletionItemKindKeyword keyword completion kind.
	CompletionItemKindKeyword CompletionItemKind = 14
	// CompletionItemKindSnippet snippet completion kind.
	CompletionItemKindSnippet CompletionItemKind = 15
	// CompletionItemKindColor color completion kind.
	CompletionItemKindColor CompletionItemKind = 16
	// CompletionItemKindFile file completion kind.
	CompletionItemKindFile CompletionItemKind = 17
	// CompletionItemKindReference reference completion kind.
	CompletionItemKindReference CompletionItemKind = 18
	// CompletionItemKindFolder folder completion kind.
	CompletionItemKindFolder CompletionItemKind = 19
	// CompletionItemKindEnumMember enum member completion kind.
	CompletionItemKindEnumMember CompletionItemKind = 20
	// CompletionItemKindConstant constant completion kind.
	CompletionItemKindConstant CompletionItemKind = 21
	// CompletionItemKindStruct struct completion kind.
	CompletionItemKindStruct CompletionItemKind = 22
	// CompletionItemKindEvent event completion kind.
	CompletionItemKindEvent CompletionItemKind = 23
	// CompletionItemKindOperator operator completion kind.
	CompletionItemKindOperator CompletionItemKind = 24
	// CompletionItemKindTypeParameter type parameter completion kind.
	CompletionItemKindTypeParameter CompletionItemKind = 25
)

func (CompletionItemKind) String

func (k CompletionItemKind) String() string

String implements fmt.Stringer.

type CompletionItemTag added in v0.10.0

type CompletionItemTag float64

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

@since 3.15.0.

const (
	// CompletionItemTagDeprecated is the render a completion as obsolete, usually using a strike-out.
	CompletionItemTagDeprecated CompletionItemTag = 1
)

list of CompletionItemTag.

func (CompletionItemTag) String added in v0.10.0

func (c CompletionItemTag) String() string

String returns a string representation of the type.

type CompletionList

type CompletionList struct {
	// IsIncomplete this list it not complete. Further typing should result in recomputing
	// this list.
	IsIncomplete bool `json:"isIncomplete"`

	// Items is the completion items.
	Items []CompletionItem `json:"items"`
}

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

type CompletionOptions

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

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

CompletionOptions Completion options.

type CompletionParams

type CompletionParams struct {
	TextDocumentPositionParams
	WorkDoneProgressParams
	PartialResultParams

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

CompletionParams params of Completion request.

type CompletionRegistrationOptions

type CompletionRegistrationOptions struct {
	TextDocumentRegistrationOptions

	// TriggerCharacters 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"`

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

CompletionRegistrationOptions CompletionRegistration options.

type CompletionTextDocumentClientCapabilities added in v0.11.1

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

	// The client supports the following `CompletionItem` specific
	// capabilities.
	CompletionItem *CompletionTextDocumentClientCapabilitiesItem `json:"completionItem,omitempty"`

	CompletionItemKind *CompletionTextDocumentClientCapabilitiesItemKind `json:"completionItemKind,omitempty"`

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

CompletionTextDocumentClientCapabilities Capabilities specific to the "textDocument/completion".

type CompletionTextDocumentClientCapabilitiesItem added in v0.11.1

type CompletionTextDocumentClientCapabilitiesItem struct {
	// SnippetSupport 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"`

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

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

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

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

	// TagSupport is the 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 *CompletionTextDocumentClientCapabilitiesItemTagSupport `json:"tagSupport,omitempty"`

	// InsertReplaceSupport 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"`

	// ResolveSupport indicates which properties a client can resolve lazily on a
	// completion item. Before version 3.16.0 only the predefined properties
	// `documentation` and `details` could be resolved lazily.
	//
	// @since 3.16.0.
	ResolveSupport *CompletionTextDocumentClientCapabilitiesItemResolveSupport `json:"resolveSupport,omitempty"`

	// InsertTextModeSupport is 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 *CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport `json:"insertTextModeSupport,omitempty"`
}

CompletionTextDocumentClientCapabilitiesItem is the client supports the following "CompletionItem" specific capabilities.

type CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport added in v0.11.1

type CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport struct {
	// ValueSet is the tags supported by the client.
	//
	// @since 3.16.0.
	ValueSet []InsertTextMode `json:"valueSet,omitempty"`
}

CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport specific capabilities for the InsertTextModeSupport in the CompletionTextDocumentClientCapabilitiesItem.

@since 3.16.0.

type CompletionTextDocumentClientCapabilitiesItemKind added in v0.11.1

type CompletionTextDocumentClientCapabilitiesItemKind 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"`
}

CompletionTextDocumentClientCapabilitiesItemKind specific capabilities for the "CompletionItemKind" in the "textDocument/completion" request.

type CompletionTextDocumentClientCapabilitiesItemResolveSupport added in v0.11.1

type CompletionTextDocumentClientCapabilitiesItemResolveSupport struct {
	// Properties is the properties that a client can resolve lazily.
	Properties []string `json:"properties"`
}

CompletionTextDocumentClientCapabilitiesItemResolveSupport specific capabilities for the ResolveSupport in the CompletionTextDocumentClientCapabilitiesItem.

@since 3.16.0.

type CompletionTextDocumentClientCapabilitiesItemTagSupport added in v0.11.1

type CompletionTextDocumentClientCapabilitiesItemTagSupport struct {
	// ValueSet is the tags supported by the client.
	//
	// @since 3.15.0.
	ValueSet []CompletionItemTag `json:"valueSet,omitempty"`
}

CompletionTextDocumentClientCapabilitiesItemTagSupport specific capabilities for the "TagSupport" in the "textDocument/completion" request.

@since 3.15.0.

type CompletionTriggerKind

type CompletionTriggerKind float64

CompletionTriggerKind how a completion was triggered.

const (
	// CompletionTriggerKindInvoked completion was triggered by typing an identifier (24x7 code
	// complete), manual invocation (e.g Ctrl+Space) or via API.
	CompletionTriggerKindInvoked CompletionTriggerKind = 1

	// CompletionTriggerKindTriggerCharacter completion was triggered by a trigger character specified by
	// the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
	CompletionTriggerKindTriggerCharacter CompletionTriggerKind = 2

	// CompletionTriggerKindTriggerForIncompleteCompletions completion was re-triggered as the current completion list is incomplete.
	CompletionTriggerKindTriggerForIncompleteCompletions CompletionTriggerKind = 3
)

func (CompletionTriggerKind) String

func (k CompletionTriggerKind) String() string

String implements fmt.Stringer.

type ConfigurationItem

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

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

ConfigurationItem a ConfigurationItem consists of the configuration section to ask for and an additional scope URI. The configuration section ask for is defined by the server and doesn’t necessarily need to correspond to the configuration store used be the client. So a server might ask for a configuration cpp.formatterOptions but the client stores the configuration in a XML store layout differently. It is up to the client to do the necessary conversion. If a scope URI is provided the client should return the setting scoped to the provided resource. If the client for example uses EditorConfig to manage its settings the configuration should be returned for the passed resource URI. If the client can’t provide a configuration setting for a given scope then null need to be present in the returned array.

type ConfigurationParams

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

ConfigurationParams params of Configuration request.

type CreateFile

type CreateFile struct {
	// Kind a create.
	Kind ResourceOperationKind `json:"kind"` // should be `create`

	// URI is the resource to create.
	URI DocumentURI `json:"uri"`

	// Options additional options.
	Options *CreateFileOptions `json:"options,omitempty"`

	// AnnotationID an optional annotation identifier describing the operation.
	//
	// @since 3.16.0.
	AnnotationID ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
}

CreateFile represents a create file operation.

type CreateFileOptions

type CreateFileOptions struct {
	// Overwrite existing file. Overwrite wins over `ignoreIfExists`.
	Overwrite bool `json:"overwrite,omitempty"`

	// IgnoreIfExists ignore if exists.
	IgnoreIfExists bool `json:"ignoreIfExists,omitempty"`
}

CreateFileOptions represents an options to create a file.

type CreateFilesParams added in v0.11.0

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

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

@since 3.16.0.

type DeclarationOptions added in v0.10.0

type DeclarationOptions struct {
	WorkDoneProgressOptions
}

DeclarationOptions registration option of Declaration server capability.

@since 3.15.0.

type DeclarationParams added in v0.10.0

DeclarationParams params of Declaration request.

@since 3.15.0.

type DeclarationRegistrationOptions added in v0.10.0

type DeclarationRegistrationOptions struct {
	DeclarationOptions
	TextDocumentRegistrationOptions
	StaticRegistrationOptions
}

DeclarationRegistrationOptions registration option of Declaration server capability.

@since 3.15.0.

type DeclarationTextDocumentClientCapabilities added in v0.11.1

type DeclarationTextDocumentClientCapabilities struct {
	// DynamicRegistration whether declaration 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"`

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

DeclarationTextDocumentClientCapabilities capabilities specific to the "textDocument/declaration".

type DefinitionOptions added in v0.10.0

type DefinitionOptions struct {
	WorkDoneProgressOptions
}

DefinitionOptions registration option of Definition server capability.

@since 3.15.0.

type DefinitionParams added in v0.10.0

DefinitionParams params of Definition request.

@since 3.15.0.

type DefinitionTextDocumentClientCapabilities added in v0.11.1

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

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

DefinitionTextDocumentClientCapabilities capabilities specific to the "textDocument/definition".

@since 3.14.0.

type DeleteFile

type DeleteFile struct {
	// Kind is a delete.
	Kind ResourceOperationKind `json:"kind"` // should be `delete`

	// URI is the file to delete.
	URI DocumentURI `json:"uri"`

	// Options delete options.
	Options *DeleteFileOptions `json:"options,omitempty"`

	// AnnotationID an optional annotation identifier describing the operation.
	//
	// @since 3.16.0.
	AnnotationID ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
}

DeleteFile represents a delete file operation.

type DeleteFileOptions

type DeleteFileOptions struct {
	// Recursive delete the content recursively if a folder is denoted.
	Recursive bool `json:"recursive,omitempty"`

	// IgnoreIfNotExists ignore the operation if the file doesn't exist.
	IgnoreIfNotExists bool `json:"ignoreIfNotExists,omitempty"`
}

DeleteFileOptions represents a delete file options.

type DeleteFilesParams added in v0.11.0

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

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

@since 3.16.0.

type Diagnostic

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

	// Severity is 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"`

	// Code is the diagnostic's code, which might appear in the user interface.
	Code interface{} `json:"code,omitempty"` // int32 | string;

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

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

	// Message is the diagnostic's message.
	Message string `json:"message"`

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

	// RelatedInformation 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"`

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

Diagnostic represents a diagnostic, such as a compiler error or warning.

Diagnostic objects are only valid in the scope of a resource.

type DiagnosticRelatedInformation

type DiagnosticRelatedInformation struct {
	// Location is the location of this related diagnostic information.
	Location Location `json:"location"`

	// Message is the message of this related diagnostic information.
	Message string `json:"message"`
}

DiagnosticRelatedInformation represents a related message and source code location for a diagnostic.

This should be used to point to code locations that cause or related to a diagnostics, e.g when duplicating a symbol in a scope.

type DiagnosticSeverity

type DiagnosticSeverity float64

DiagnosticSeverity indicates the severity of a Diagnostic message.

const (
	// DiagnosticSeverityError reports an error.
	DiagnosticSeverityError DiagnosticSeverity = 1

	// DiagnosticSeverityWarning reports a warning.
	DiagnosticSeverityWarning DiagnosticSeverity = 2

	// DiagnosticSeverityInformation reports an information.
	DiagnosticSeverityInformation DiagnosticSeverity = 3

	// DiagnosticSeverityHint reports a hint.
	DiagnosticSeverityHint DiagnosticSeverity = 4
)

func (DiagnosticSeverity) String

func (d DiagnosticSeverity) String() string

String implements fmt.Stringer.

type DiagnosticTag added in v0.10.0

type DiagnosticTag float64

DiagnosticTag is the diagnostic tags.

@since 3.15.0.

const (
	// DiagnosticTagUnnecessary unused or unnecessary code.
	//
	// Clients are allowed to render diagnostics with this tag faded out instead of having
	// an error squiggle.
	DiagnosticTagUnnecessary DiagnosticTag = 1

	// DiagnosticTagDeprecated deprecated or obsolete code.
	//
	// Clients are allowed to rendered diagnostics with this tag strike through.
	DiagnosticTagDeprecated DiagnosticTag = 2
)

list of DiagnosticTag.

func (DiagnosticTag) String added in v0.10.0

func (d DiagnosticTag) String() string

String implements fmt.Stringer.

type DidChangeConfigurationParams

type DidChangeConfigurationParams struct {
	// Settings is the actual changed settings
	Settings interface{} `json:"settings,omitempty"`
}

DidChangeConfigurationParams params of DidChangeConfiguration notification.

type DidChangeConfigurationWorkspaceClientCapabilities added in v0.11.1

type DidChangeConfigurationWorkspaceClientCapabilities struct {
	// DynamicRegistration whether the did change configuration notification supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

DidChangeConfigurationWorkspaceClientCapabilities capabilities specific to the "workspace/didChangeConfiguration" notification.

@since 3.16.0.

type DidChangeTextDocumentParams

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

	// ContentChanges is the actual content changes. The content changes describe single state changes
	// to the document. So if there are two content changes c1 and c2 for a document
	// in state S then c1 move the document to S' and c2 to S”.
	ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"` // []TextDocumentContentChangeEvent | text
}

DidChangeTextDocumentParams params of DidChangeTextDocument notification.

type DidChangeWatchedFilesParams

type DidChangeWatchedFilesParams struct {
	// Changes is the actual file events.
	Changes []*FileEvent `json:"changes,omitempty"`
}

DidChangeWatchedFilesParams params of DidChangeWatchedFiles notification.

type DidChangeWatchedFilesRegistrationOptions

type DidChangeWatchedFilesRegistrationOptions struct {
	// Watchers is the watchers to register.
	Watchers []FileSystemWatcher `json:"watchers"`
}

DidChangeWatchedFilesRegistrationOptions describe options to be used when registering for file system change events.

type DidChangeWatchedFilesWorkspaceClientCapabilities added in v0.11.1

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

DidChangeWatchedFilesWorkspaceClientCapabilities capabilities specific to the "workspace/didChangeWatchedFiles" notification.

@since 3.16.0.

type DidChangeWorkspaceFoldersParams

type DidChangeWorkspaceFoldersParams struct {
	// Event is the actual workspace folder change event.
	Event WorkspaceFoldersChangeEvent `json:"event"`
}

DidChangeWorkspaceFoldersParams params of DidChangeWorkspaceFolders notification.

type DidCloseTextDocumentParams

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

DidCloseTextDocumentParams params of DidCloseTextDocument notification.

type DidOpenTextDocumentParams

type DidOpenTextDocumentParams struct {
	// TextDocument is the document that was opened.
	TextDocument TextDocumentItem `json:"textDocument"`
}

DidOpenTextDocumentParams params of DidOpenTextDocument notification.

type DidSaveTextDocumentParams

type DidSaveTextDocumentParams struct {
	// Text optional the content when saved. Depends on the includeText value
	// when the save notification was requested.
	Text string `json:"text,omitempty"`

	// TextDocument is the document that was saved.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

DidSaveTextDocumentParams params of DidSaveTextDocument notification.

type DocumentColorClientCapabilities added in v0.11.1

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

DocumentColorClientCapabilities capabilities specific to the "textDocument/documentColor" and the "textDocument/colorPresentation" request.

@since 3.6.0.

type DocumentColorOptions added in v0.10.0

type DocumentColorOptions struct {
	WorkDoneProgressOptions
}

DocumentColorOptions registration option of DocumentColor server capability.

@since 3.15.0.

type DocumentColorParams

type DocumentColorParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the document to format.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

DocumentColorParams params of Document Color request.

type DocumentColorRegistrationOptions added in v0.10.0

type DocumentColorRegistrationOptions struct {
	TextDocumentRegistrationOptions
	StaticRegistrationOptions
	DocumentColorOptions
}

DocumentColorRegistrationOptions registration option of DocumentColor server capability.

@since 3.15.0.

type DocumentFilter

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

	// Scheme a URI scheme, like `file` or `untitled`.
	Scheme string `json:"scheme,omitempty"`

	// Pattern 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 conditions (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"`
}

DocumentFilter is a document filter denotes a document through properties like language, scheme or pattern.

An example is a filter that applies to TypeScript files on disk.

type DocumentFormattingClientCapabilities added in v0.11.1

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

DocumentFormattingClientCapabilities capabilities specific to the "textDocument/formatting".

type DocumentFormattingOptions added in v0.10.0

type DocumentFormattingOptions struct {
	WorkDoneProgressOptions
}

DocumentFormattingOptions registration option of DocumentFormatting server capability.

@since 3.15.0.

type DocumentFormattingParams

type DocumentFormattingParams struct {
	WorkDoneProgressParams

	// Options is the format options.
	Options FormattingOptions `json:"options"`

	// TextDocument is the document to format.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

DocumentFormattingParams params of Document Formatting request.

type DocumentHighlight

type DocumentHighlight struct {
	// Range is the range this highlight applies to.
	Range Range `json:"range"`

	// Kind is 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 added in v0.11.1

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

DocumentHighlightClientCapabilities capabilities specific to the "textDocument/documentHighlight".

type DocumentHighlightKind

type DocumentHighlightKind float64

DocumentHighlightKind a document highlight kind.

const (
	// DocumentHighlightKindText a textual occurrence.
	DocumentHighlightKindText DocumentHighlightKind = 1

	// DocumentHighlightKindRead read-access of a symbol, like reading a variable.
	DocumentHighlightKindRead DocumentHighlightKind = 2

	// DocumentHighlightKindWrite write-access of a symbol, like writing to a variable.
	DocumentHighlightKindWrite DocumentHighlightKind = 3
)

func (DocumentHighlightKind) String

func (k DocumentHighlightKind) String() string

String implements fmt.Stringer.

type DocumentHighlightOptions added in v0.10.0

type DocumentHighlightOptions struct {
	WorkDoneProgressOptions
}

DocumentHighlightOptions registration option of DocumentHighlight server capability.

@since 3.15.0.

type DocumentHighlightParams added in v0.10.0

DocumentHighlightParams params of DocumentHighlight request.

@since 3.15.0.

type DocumentLink struct {
	// Range is the range this link applies to.
	Range Range `json:"range"`

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

	// Tooltip is 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"`

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

DocumentLink is 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 added in v0.11.1

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

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

DocumentLinkClientCapabilities capabilities specific to the "textDocument/documentLink".

type DocumentLinkOptions

type DocumentLinkOptions struct {
	// ResolveProvider document links have a resolve provider as well.
	ResolveProvider bool `json:"resolveProvider,omitempty"`
}

DocumentLinkOptions document link options.

type DocumentLinkParams

type DocumentLinkParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the document to provide document links for.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

DocumentLinkParams params of Document Link request.

type DocumentLinkRegistrationOptions

type DocumentLinkRegistrationOptions struct {
	TextDocumentRegistrationOptions

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

DocumentLinkRegistrationOptions DocumentLinkRegistration options.

type DocumentOnTypeFormattingClientCapabilities added in v0.11.1

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

DocumentOnTypeFormattingClientCapabilities capabilities specific to the "textDocument/onTypeFormatting".

type DocumentOnTypeFormattingOptions

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

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

DocumentOnTypeFormattingOptions format document on type options.

type DocumentOnTypeFormattingParams

type DocumentOnTypeFormattingParams struct {
	// TextDocument is the document to format.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// Position is the position at which this request was sent.
	Position Position `json:"position"`

	// Ch is the character that has been typed.
	Ch string `json:"ch"`

	// Options is the format options.
	Options FormattingOptions `json:"options"`
}

DocumentOnTypeFormattingParams params of Document on Type Formatting request.

type DocumentOnTypeFormattingRegistrationOptions

type DocumentOnTypeFormattingRegistrationOptions struct {
	TextDocumentRegistrationOptions

	// FirstTriggerCharacter a character on which formatting should be triggered, like `}`.
	FirstTriggerCharacter string `json:"firstTriggerCharacter"`

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

DocumentOnTypeFormattingRegistrationOptions DocumentOnTypeFormatting Registration options.

type DocumentRangeFormattingClientCapabilities added in v0.11.1

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

DocumentRangeFormattingClientCapabilities capabilities specific to the "textDocument/rangeFormatting".

type DocumentRangeFormattingOptions added in v0.10.0

type DocumentRangeFormattingOptions struct {
	WorkDoneProgressOptions
}

DocumentRangeFormattingOptions registration option of DocumentRangeFormatting server capability.

@since 3.15.0.

type DocumentRangeFormattingParams

type DocumentRangeFormattingParams struct {
	WorkDoneProgressParams

	// TextDocument is the document to format.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// Range is the range to format
	Range Range `json:"range"`

	// Options is the format options.
	Options FormattingOptions `json:"options"`
}

DocumentRangeFormattingParams params of Document Range Formatting request.

type DocumentSelector

type DocumentSelector []*DocumentFilter

DocumentSelector is a document selector is the combination of one or more document filters.

type DocumentSymbol

type DocumentSymbol struct {
	// Name is 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"`

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

	// Kind is the kind of this symbol.
	Kind SymbolKind `json:"kind"`

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

	// Deprecated indicates if this symbol is deprecated.
	Deprecated bool `json:"deprecated,omitempty"`

	// Range is 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"`

	// SelectionRange is 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"`

	// Children 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 added in v0.11.1

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

	// SymbolKind specific capabilities for the "SymbolKindCapabilities".
	SymbolKind *SymbolKindCapabilities `json:"symbolKind,omitempty"`

	// HierarchicalDocumentSymbolSupport is the client support hierarchical document symbols.
	HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`

	// TagSupport is 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 *DocumentSymbolClientCapabilitiesTagSupport `json:"tagSupport,omitempty"`

	// LabelSupport is 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"`
}

DocumentSymbolClientCapabilities capabilities specific to the "textDocument/documentSymbol".

type DocumentSymbolClientCapabilitiesTagSupport added in v0.11.1

type DocumentSymbolClientCapabilitiesTagSupport struct {
	// ValueSet is the tags supported by the client.
	ValueSet []SymbolTag `json:"valueSet"`
}

DocumentSymbolClientCapabilitiesTagSupport TagSupport in the DocumentSymbolClientCapabilities.

@since 3.16.0.

type DocumentSymbolOptions added in v0.10.0

type DocumentSymbolOptions struct {
	WorkDoneProgressOptions

	// Label 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 registration option of DocumentSymbol server capability.

@since 3.15.0.

type DocumentSymbolParams

type DocumentSymbolParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

DocumentSymbolParams params of Document Symbols request.

type DocumentURI

type DocumentURI = uri.URI

DocumentURI represents the URI of a document.

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.

type EnableSelectionRange added in v0.10.0

type EnableSelectionRange bool

EnableSelectionRange is the whether the selection range.

func (EnableSelectionRange) Value added in v0.10.0

func (v EnableSelectionRange) Value() interface{}

Value implements SelectionRangeProviderOptions interface.

type ExecuteCommandClientCapabilities added in v0.11.1

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

ExecuteCommandClientCapabilities capabilities specific to the "workspace/executeCommand" request.

type ExecuteCommandOptions

type ExecuteCommandOptions struct {
	// Commands is the commands to be executed on the server
	Commands []string `json:"commands"`
}

ExecuteCommandOptions execute command options.

type ExecuteCommandParams

type ExecuteCommandParams struct {
	WorkDoneProgressParams

	// Command is the identifier of the actual command handler.
	Command string `json:"command"`

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

ExecuteCommandParams params of Execute a command.

type ExecuteCommandRegistrationOptions

type ExecuteCommandRegistrationOptions struct {
	// Commands is the commands to be executed on the server
	Commands []string `json:"commands"`
}

ExecuteCommandRegistrationOptions execute command registration options.

type FailureHandlingKind

type FailureHandlingKind string

FailureHandlingKind is the kind of failure handling .

const (
	// FailureHandlingKindAbort applying the workspace change is simply aborted if one of the changes provided
	// fails. All operations executed before the failing operation stay executed.
	FailureHandlingKindAbort FailureHandlingKind = "abort"

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

	// 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.
	FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"

	// FailureHandlingKindUndo the client tries to undo the operations already executed. But there is no
	// guarantee that this is succeeding.
	FailureHandlingKindUndo FailureHandlingKind = "undo"
)

type FileChangeType

type FileChangeType float64

FileChangeType is the file event type.

const (
	// FileChangeTypeCreated is the file got created.
	FileChangeTypeCreated FileChangeType = 1
	// FileChangeTypeChanged is the file got changed.
	FileChangeTypeChanged FileChangeType = 2
	// FileChangeTypeDeleted is the file got deleted.
	FileChangeTypeDeleted FileChangeType = 3
)

func (FileChangeType) String

func (t FileChangeType) String() string

String implements fmt.Stringer.

type FileCreate added in v0.11.0

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

FileCreate nepresents information on a file/folder create.

@since 3.16.0.

type FileDelete added in v0.11.0

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

FileDelete represents information on a file/folder delete.

@since 3.16.0.

type FileEvent

type FileEvent struct {
	// Type is the change type.
	Type FileChangeType `json:"type"`

	// URI is the file's URI.
	URI uri.URI `json:"uri"`
}

FileEvent an event describing a file change.

type FileOperationFilter added in v0.11.0

type FileOperationFilter struct {
	// Scheme is a URI like "file" or "untitled".
	Scheme string `json:"scheme,omitempty"`

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

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

@since 3.16.0.

type FileOperationPattern added in v0.11.0

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 conditions (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"`

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

	// Options 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 added in v0.11.0

type FileOperationPatternKind string

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

@since 3.16.0.

const (
	// FileOperationPatternKindFile is the pattern matches a file only.
	FileOperationPatternKindFile FileOperationPatternKind = "file"

	// FileOperationPatternKindFolder is the pattern matches a folder only.
	FileOperationPatternKindFolder FileOperationPatternKind = "folder"
)

list of FileOperationPatternKind.

type FileOperationPatternOptions added in v0.11.0

type FileOperationPatternOptions struct {
	// IgnoreCase is 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 added in v0.11.0

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

FileOperationRegistrationOptions is the options to register for file operations.

@since 3.16.0.

type FileRename added in v0.11.0

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

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

FileRename represents information on a file/folder rename.

@since 3.16.0.

type FileSystemWatcher

type FileSystemWatcher struct {
	// GlobPattern is the glob pattern to watch.
	//
	// 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 conditions (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`)
	GlobPattern string `json:"globPattern"`

	// Kind is the kind of events of interest. If omitted it defaults
	// to WatchKind.Create | WatchKind.Change | WatchKind.Delete
	// which is 7.
	Kind WatchKind `json:"kind,omitempty"`
}

FileSystemWatcher watchers of DidChangeWatchedFiles Registration options.

type FoldingRange

type FoldingRange struct {
	// StartLine is the zero-based line number from where the folded range starts.
	StartLine uint32 `json:"startLine"`

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

	// EndLine is the zero-based line number where the folded range ends.
	EndLine uint32 `json:"endLine"`

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

	// Kind 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 for an enumeration of standardized kinds.
	Kind FoldingRangeKind `json:"kind,omitempty"`
}

FoldingRange capabilities specific to `textDocument/foldingRange` requests.

@since 3.10.0.

type FoldingRangeClientCapabilities added in v0.11.1

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

	// RangeLimit is 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 uint32 `json:"rangeLimit,omitempty"`

	// LineFoldingOnly 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"`
}

FoldingRangeClientCapabilities capabilities specific to "textDocument/foldingRange" requests.

@since 3.10.0.

type FoldingRangeKind

type FoldingRangeKind string

FoldingRangeKind is the enum of known range kinds.

const (
	// CommentFoldingRange is the folding range for a comment.
	CommentFoldingRange FoldingRangeKind = "comment"

	// ImportsFoldingRange is the folding range for a imports or includes.
	ImportsFoldingRange FoldingRangeKind = "imports"

	// RegionFoldingRange is the folding range for a region (e.g. `#region`).
	RegionFoldingRange FoldingRangeKind = "region"
)

type FoldingRangeOptions added in v0.10.0

type FoldingRangeOptions struct {
	WorkDoneProgressOptions
}

FoldingRangeOptions registration option of FoldingRange server capability.

@since 3.15.0.

type FoldingRangeParams

type FoldingRangeParams struct {
	TextDocumentPositionParams
	PartialResultParams
}

FoldingRangeParams params of Folding Range request.

type FoldingRangeRegistrationOptions added in v0.10.0

type FoldingRangeRegistrationOptions struct {
	TextDocumentRegistrationOptions
	FoldingRangeOptions
	StaticRegistrationOptions
}

FoldingRangeRegistrationOptions registration option of FoldingRange server capability.

@since 3.15.0.

type FormattingOptions

type FormattingOptions struct {
	// InsertSpaces prefer spaces over tabs.
	InsertSpaces bool `json:"insertSpaces"`

	// TabSize size of a tab in spaces.
	TabSize uint32 `json:"tabSize"`

	// TrimTrailingWhitespace trim trailing whitespaces on a line.
	//
	// @since 3.15.0.
	TrimTrailingWhitespace bool `json:"trimTrailingWhitespace,omitempty"`

	// InsertFinalNewlines insert a newline character at the end of the file if one does not exist.
	//
	// @since 3.15.0.
	InsertFinalNewline bool `json:"insertFinalNewline,omitempty"`

	// TrimFinalNewlines trim all newlines after the final newline at the end of the file.
	//
	// @since 3.15.0.
	TrimFinalNewlines bool `json:"trimFinalNewlines,omitempty"`

	// Key is the signature for further properties.
	Key map[string]interface{} `json:"key,omitempty"` // bool | int32 | string
}

FormattingOptions value-object describing what options formatting should use.

type GeneralClientCapabilities added in v0.11.0

type GeneralClientCapabilities struct {
	// RegularExpressions is the client capabilities specific to regular expressions.
	//
	// @since 3.16.0.
	RegularExpressions *RegularExpressionsClientCapabilities `json:"regularExpressions,omitempty"`

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

GeneralClientCapabilities represents a General specific client capabilities.

@since 3.16.0.

type Hover

type Hover struct {
	// Contents is the hover's content
	Contents MarkupContent `json:"contents"`

	// Range 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 is the result of a hover request.

type HoverOptions added in v0.10.0

type HoverOptions struct {
	WorkDoneProgressOptions
}

HoverOptions option of hover provider server capabilities.

type HoverParams added in v0.10.0

HoverParams params of Hover request.

@since 3.15.0.

type HoverTextDocumentClientCapabilities added in v0.11.1

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

	// ContentFormat is the client supports the follow content formats for the content
	// property. The order describes the preferred format of the client.
	ContentFormat []MarkupKind `json:"contentFormat,omitempty"`
}

HoverTextDocumentClientCapabilities capabilities specific to the "textDocument/hover".

type ImplementationOptions added in v0.10.0

type ImplementationOptions struct {
	WorkDoneProgressOptions
}

ImplementationOptions registration option of Implementation server capability.

@since 3.15.0.

type ImplementationParams added in v0.10.0

ImplementationParams params of Implementation request.

@since 3.15.0.

type ImplementationRegistrationOptions added in v0.10.0

type ImplementationRegistrationOptions struct {
	TextDocumentRegistrationOptions
	ImplementationOptions
	StaticRegistrationOptions
}

ImplementationRegistrationOptions registration option of Implementation server capability.

@since 3.15.0.

type ImplementationTextDocumentClientCapabilities added in v0.11.1

type ImplementationTextDocumentClientCapabilities struct {
	// DynamicRegistration 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"`

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

ImplementationTextDocumentClientCapabilities capabilities specific to the "textDocument/implementation".

@since 3.6.0.

type InitializeError

type InitializeError struct {
	// Retry 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,omitempty"`
}

InitializeError known error codes for an "InitializeError".

type InitializeParams

type InitializeParams struct {
	WorkDoneProgressParams

	// ProcessID is 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 int32 `json:"processId"`

	// ClientInfo is the information about the client.
	//
	// @since 3.15.0
	ClientInfo *ClientInfo `json:"clientInfo,omitempty"`

	// Locale is 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"`

	// RootPath is the rootPath of the workspace. Is null
	// if no folder is open.
	//
	// Deprecated: Use RootURI instead.
	RootPath string `json:"rootPath,omitempty"`

	// RootURI is the rootUri of the workspace. Is null if no
	// folder is open. If both `rootPath` and "rootUri" are set
	// "rootUri" wins.
	//
	// Deprecated: Use WorkspaceFolders instead.
	RootURI DocumentURI `json:"rootUri,omitempty"`

	// InitializationOptions user provided initialization options.
	InitializationOptions interface{} `json:"initializationOptions,omitempty"`

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

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

	// WorkspaceFolders is 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,omitempty"`
}

InitializeParams params of Initialize request.

type InitializeResult

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

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

InitializeResult result of ClientCapabilities.

type InitializedParams

type InitializedParams struct{}

InitializedParams params of Initialized notification.

type InsertReplaceEdit added in v0.11.0

type InsertReplaceEdit struct {
	// NewText is the string to be inserted.
	NewText string `json:"newText"`

	// Insert is the range if the insert is requested.
	Insert Range `json:"insert"`

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

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

@since 3.16.0.

type InsertTextFormat

type InsertTextFormat float64

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

const (
	// InsertTextFormatPlainText is the primary text to be inserted is treated as a plain string.
	InsertTextFormatPlainText InsertTextFormat = 1

	// InsertTextFormatSnippet is 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.
	InsertTextFormatSnippet InsertTextFormat = 2
)

func (InsertTextFormat) String

func (tf InsertTextFormat) String() string

String implements fmt.Stringer.

type InsertTextMode added in v0.11.0

type InsertTextMode float64

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

@since 3.16.0.

const (
	// AsIs is 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.
	InsertTextModeAsIs InsertTextMode = 1

	// AdjustIndentation is 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.
	InsertTextModeAdjustIndentation InsertTextMode = 2
)

func (InsertTextMode) String added in v0.11.0

func (k InsertTextMode) String() string

String returns a string representation of the InsertTextMode.

type LanguageIdentifier

type LanguageIdentifier string

LanguageIdentifier represent a text document's language identifier.

const (
	// ABAPLanguage ABAP Language.
	ABAPLanguage LanguageIdentifier = "abap"

	// BatLanguage Windows Bat Language.
	BatLanguage LanguageIdentifier = "bat"

	// BibtexLanguage BibTeX Language.
	BibtexLanguage LanguageIdentifier = "bibtex"

	// ClojureLanguage Clojure Language.
	ClojureLanguage LanguageIdentifier = "clojure"

	// CoffeescriptLanguage CoffeeScript Language.
	CoffeeScriptLanguage LanguageIdentifier = "coffeescript"

	// CLanguage C Language.
	CLanguage LanguageIdentifier = "c"

	// CppLanguage C++ Language.
	CppLanguage LanguageIdentifier = "cpp"

	// CsharpLanguage C# Language.
	CsharpLanguage LanguageIdentifier = "csharp"

	// CSSLanguage CSS Language.
	CSSLanguage LanguageIdentifier = "css"

	// DiffLanguage Diff Language.
	DiffLanguage LanguageIdentifier = "diff"

	// DartLanguage Dart Language.
	DartLanguage LanguageIdentifier = "dart"

	// DockerfileLanguage Dockerfile Language.
	DockerfileLanguage LanguageIdentifier = "dockerfile"

	// ElixirLanguage Elixir Language.
	ElixirLanguage LanguageIdentifier = "elixir"

	// ErlangLanguage Erlang Language.
	ErlangLanguage LanguageIdentifier = "erlang"

	// FsharpLanguage F# Language.
	FsharpLanguage LanguageIdentifier = "fsharp"

	// GitCommitLanguage Git Language.
	GitCommitLanguage LanguageIdentifier = "git-commit"

	// GitRebaseLanguage Git Language.
	GitRebaseLanguage LanguageIdentifier = "git-rebase"

	// GoLanguage Go Language.
	GoLanguage LanguageIdentifier = "go"

	// GroovyLanguage Groovy Language.
	GroovyLanguage LanguageIdentifier = "groovy"

	// HandlebarsLanguage Handlebars Language.
	HandlebarsLanguage LanguageIdentifier = "handlebars"

	// HTMLLanguage HTML Language.
	HTMLLanguage LanguageIdentifier = "html"

	// IniLanguage Ini Language.
	IniLanguage LanguageIdentifier = "ini"

	// JavaLanguage Java Language.
	JavaLanguage LanguageIdentifier = "java"

	// JavaScriptLanguage JavaScript Language.
	JavaScriptLanguage LanguageIdentifier = "javascript"

	// JavaScriptReactLanguage JavaScript React Language.
	JavaScriptReactLanguage LanguageIdentifier = "javascriptreact"

	// JSONLanguage JSON Language.
	JSONLanguage LanguageIdentifier = "json"

	// LatexLanguage LaTeX Language.
	LatexLanguage LanguageIdentifier = "latex"

	// LessLanguage Less Language.
	LessLanguage LanguageIdentifier = "less"

	// LuaLanguage Lua Language.
	LuaLanguage LanguageIdentifier = "lua"

	// MakefileLanguage Makefile Language.
	MakefileLanguage LanguageIdentifier = "makefile"

	// MarkdownLanguage Markdown Language.
	MarkdownLanguage LanguageIdentifier = "markdown"

	// ObjectiveCLanguage Objective-C Language.
	ObjectiveCLanguage LanguageIdentifier = "objective-c"

	// ObjectiveCppLanguage Objective-C++ Language.
	ObjectiveCppLanguage LanguageIdentifier = "objective-cpp"

	// PerlLanguage Perl Language.
	PerlLanguage LanguageIdentifier = "perl"

	// Perl6Language Perl Language.
	Perl6Language LanguageIdentifier = "perl6"

	// PHPLanguage PHP Language.
	PHPLanguage LanguageIdentifier = "php"

	// PowershellLanguage Powershell Language.
	PowershellLanguage LanguageIdentifier = "powershell"

	// JadeLanguage Pug Language.
	JadeLanguage LanguageIdentifier = "jade"

	// PythonLanguage Python Language.
	PythonLanguage LanguageIdentifier = "python"

	// RLanguage R Language.
	RLanguage LanguageIdentifier = "r"

	// RazorLanguage Razor(cshtml) Language.
	RazorLanguage LanguageIdentifier = "razor"

	// RubyLanguage Ruby Language.
	RubyLanguage LanguageIdentifier = "ruby"

	// RustLanguage Rust Language.
	RustLanguage LanguageIdentifier = "rust"

	// SCSSLanguage SCSS Languages syntax using curly brackets.
	SCSSLanguage LanguageIdentifier = "scss"

	// SASSLanguage SCSS Languages indented syntax.
	SASSLanguage LanguageIdentifier = "sass"

	// ScalaLanguage Scala Language.
	ScalaLanguage LanguageIdentifier = "scala"

	// ShaderlabLanguage ShaderLab Language.
	ShaderlabLanguage LanguageIdentifier = "shaderlab"

	// ShellscriptLanguage Shell Script (Bash) Language.
	ShellscriptLanguage LanguageIdentifier = "shellscript"

	// SQLLanguage SQL Language.
	SQLLanguage LanguageIdentifier = "sql"

	// SwiftLanguage Swift Language.
	SwiftLanguage LanguageIdentifier = "swift"

	// TypeScriptLanguage TypeScript Language.
	TypeScriptLanguage LanguageIdentifier = "typescript"

	// TypeScriptReactLanguage TypeScript React Language.
	TypeScriptReactLanguage LanguageIdentifier = "typescriptreact"

	// TeXLanguage TeX Language.
	TeXLanguage LanguageIdentifier = "tex"

	// VBLanguage Visual Basic Language.
	VBLanguage LanguageIdentifier = "vb"

	// XMLLanguage XML Language.
	XMLLanguage LanguageIdentifier = "xml"

	// XslLanguage XSL Language.
	XslLanguage LanguageIdentifier = "xsl"

	// YamlLanguage YAML Language.
	YamlLanguage LanguageIdentifier = "yaml"
)

func ToLanguageIdentifier

func ToLanguageIdentifier(ft string) LanguageIdentifier

ToLanguageIdentifier converts ft to LanguageIdentifier.

type LinkedEditingRangeClientCapabilities added in v0.11.1

type LinkedEditingRangeClientCapabilities struct {
	// DynamicRegistration 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"`
}

LinkedEditingRangeClientCapabilities capabilities specific to "textDocument/linkedEditingRange" requests.

@since 3.16.0.

type LinkedEditingRangeOptions added in v0.11.0

type LinkedEditingRangeOptions struct {
	WorkDoneProgressOptions
}

LinkedEditingRangeOptions option of linked editing range provider server capabilities.

@since 3.16.0.

type LinkedEditingRangeParams added in v0.11.0

type LinkedEditingRangeParams struct {
	TextDocumentPositionParams
	WorkDoneProgressParams
}

LinkedEditingRangeParams params for the LinkedEditingRange request.

@since 3.16.0.

type LinkedEditingRangeRegistrationOptions added in v0.11.0

type LinkedEditingRangeRegistrationOptions struct {
	TextDocumentRegistrationOptions
	LinkedEditingRangeOptions
	StaticRegistrationOptions
}

LinkedEditingRangeRegistrationOptions registration option of linked editing range provider server capabilities.

@since 3.16.0.

type LinkedEditingRanges added in v0.11.0

type LinkedEditingRanges struct {
	// Ranges 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"`

	// WordPattern 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"`
}

LinkedEditingRanges result of LinkedEditingRange request.

@since 3.16.0.

type Location

type Location struct {
	URI   DocumentURI `json:"uri"`
	Range Range       `json:"range"`
}

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

type LocationLink struct {
	// OriginSelectionRange 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"`

	// TargetURI is the target resource identifier of this link.
	TargetURI DocumentURI `json:"targetUri"`

	// TargetRange is 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"`

	// TargetSelectionRange is 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"`
}

LocationLink represents a link between a source and a target location.

type LogMessageParams

type LogMessageParams struct {
	// Message is the actual message
	Message string `json:"message"`

	// Type is the message type. See {@link MessageType}
	Type MessageType `json:"type"`
}

LogMessageParams params of LogMessage notification.

type LogTraceParams added in v0.11.0

type LogTraceParams struct {
	// Message is the message to be logged.
	Message string `json:"message"`

	// Verbose is the additional information that can be computed if the "trace" configuration
	// is set to "verbose".
	Verbose TraceValue `json:"verbose,omitempty"`
}

LogTraceParams params of LogTrace notification.

@since 3.16.0.

type MarkdownClientCapabilities added in v0.11.0

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

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

MarkdownClientCapabilities represents a client capabilities specific to the used markdown parser.

@since 3.16.0.

type MarkupContent

type MarkupContent struct {
	// Kind is the type of the Markup
	Kind MarkupKind `json:"kind"`

	// Value is the content itself
	Value string `json:"value"`
}

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. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting

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

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

NOTE: 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

MarkupKind describes the content type that a client supports in various result literals like `Hover`, `ParameterInfo` or `CompletionItem`.

Please note that `MarkupKinds` must not start with a `$`. This kinds are reserved for internal usage.

const (
	// PlainText is supported as a content format.
	PlainText MarkupKind = "plaintext"

	// Markdown is supported as a content format.
	Markdown MarkupKind = "markdown"
)

type MessageActionItem

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

MessageActionItem item of ShowMessageRequestParams action.

type MessageType

type MessageType float64

MessageType type of ShowMessageParams type.

const (
	// MessageTypeError an error message.
	MessageTypeError MessageType = 1
	// MessageTypeWarning a warning message.
	MessageTypeWarning MessageType = 2
	// MessageTypeInfo an information message.
	MessageTypeInfo MessageType = 3
	// MessageTypeLog a log message.
	MessageTypeLog MessageType = 4
)

func ToMessageType

func ToMessageType(level string) MessageType

ToMessageType converts level to the MessageType.

func (MessageType) Enabled

func (m MessageType) Enabled(level MessageType) bool

Enabled reports whether the level is enabled.

func (MessageType) String

func (m MessageType) String() string

String implements fmt.Stringer.

type Moniker added in v0.11.0

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

	// Identifier is 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"`

	// Unique is the scope in which the moniker is unique.
	Unique UniquenessLevel `json:"unique"`

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

Moniker definition to match LSIF 0.5 moniker definition.

@since 3.16.0.

type MonikerClientCapabilities added in v0.11.1

type MonikerClientCapabilities struct {
	// DynamicRegistration 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 whether implementation supports dynamic registration. If this is set to
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

MonikerClientCapabilities capabilities specific to the "textDocument/moniker" request.

@since 3.16.0.

type MonikerKind added in v0.11.0

type MonikerKind string

MonikerKind is the moniker kind.

@since 3.16.0.

const (
	// MonikerKindImport is the moniker represent a symbol that is imported into a project.
	MonikerKindImport MonikerKind = "import"

	// MonikerKindExport is the moniker represents a symbol that is exported from a project.
	MonikerKindExport MonikerKind = "export"

	// MonikerKindLocal is 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, ...).
	MonikerKindLocal MonikerKind = "local"
)

list of MonikerKind.

type MonikerOptions added in v0.11.0

type MonikerOptions struct {
	WorkDoneProgressOptions
}

MonikerOptions option of moniker provider server capabilities.

@since 3.16.0.

type MonikerParams added in v0.11.0

MonikerParams params for the Moniker request.

@since 3.16.0.

type MonikerRegistrationOptions added in v0.11.0

type MonikerRegistrationOptions struct {
	TextDocumentRegistrationOptions
	MonikerOptions
}

MonikerRegistrationOptions registration option of moniker provider server capabilities.

@since 3.16.0.

type OptionalVersionedTextDocumentIdentifier added in v0.11.0

type OptionalVersionedTextDocumentIdentifier struct {
	TextDocumentIdentifier

	// Version is the version number of this document. If an optional versioned text document
	// identifier is sent from the server to the client and the file is not
	// open in the editor (the server has not received an open notification
	// before) the server can send `null` to indicate that the version is
	// known and the content on disk is the master (as specified with document
	// content ownership).
	//
	// The version number of a document will increase after each change,
	// including undo/redo. The number doesn't need to be consecutive.
	Version *int32 `json:"version"` // int32 | null
}

OptionalVersionedTextDocumentIdentifier represents an identifier which optionally denotes a specific version of a text document.

This information usually flows from the server to the client.

@since 3.16.0.

type ParameterInformation

type ParameterInformation struct {
	// Label is 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 string `json:"label"` // string | [uint32, uint32]

	// Documentation is the human-readable doc-comment of this parameter. Will be shown
	// in the UI but can be omitted.
	Documentation interface{} `json:"documentation,omitempty"` // string | MarkupContent
}

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

type PartialResultParams added in v0.10.0

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

PartialResultParams is the parameter literal used to pass a partial result token.

@since 3.15.0.

type Position

type Position struct {
	// Line position in a document (zero-based).
	//
	// If a line number is greater than the number of lines in a document, it defaults back to the number of lines in
	// the document.
	// If a line number is negative, it defaults to 0.
	Line uint32 `json:"line"`

	// Character offset on a line in a document (zero-based).
	//
	// Assuming that the line is represented as a string, the Character value represents the gap between the
	// "character" and "character + 1".
	//
	// If the character value is greater than the line length it defaults back to the line length.
	// If a line number is negative, it defaults to 0.
	Character uint32 `json:"character"`
}

Position represents a text document expressed as zero-based line and zero-based character offset.

The offsets are based on a UTF-16 string representation. So a string of the form "a𐐀b" the character offset of the character "a" is 0, the character offset of "𐐀" is 1 and the character offset of "b" is 3 since 𐐀 is represented using two code units in UTF-16.

Positions are line end character agnostic. So you can not specify a position that denotes "\r|\n" or "\n|" where "|" represents the character offset.

Position is between two characters like an "insert" cursor in a editor. Special values like for example "-1" to denote the end of a line are not supported.

type PrepareRenameParams added in v0.10.0

type PrepareRenameParams struct {
	TextDocumentPositionParams
}

PrepareRenameParams params of PrepareRenameParams request.

@since 3.15.0.

type PrepareSupportDefaultBehavior added in v0.11.0

type PrepareSupportDefaultBehavior float64

PrepareSupportDefaultBehavior default behavior of PrepareSupport.

@since 3.16.0.

const (
	// PrepareSupportDefaultBehaviorIdentifier is the client's default behavior is to select the identifier
	// according the to language's syntax rule.
	PrepareSupportDefaultBehaviorIdentifier PrepareSupportDefaultBehavior = 1
)

list of PrepareSupportDefaultBehavior.

func (PrepareSupportDefaultBehavior) String added in v0.11.0

String returns a string representation of the PrepareSupportDefaultBehavior.

type ProgressParams added in v0.10.0

type ProgressParams struct {
	// Token is the progress token provided by the client or server.
	Token ProgressToken `json:"token"`

	// Value is the progress data.
	Value interface{} `json:"value"`
}

ProgressParams params of Progress netification.

@since 3.15.0.

type ProgressToken added in v0.10.0

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

ProgressToken is the progress token provided by the client or server.

@since 3.15.0.

func NewNumberProgressToken added in v0.10.0

func NewNumberProgressToken(n int32) *ProgressToken

NewNumberProgressToken returns a new number ProgressToken.

func NewProgressToken added in v0.10.0

func NewProgressToken(s string) *ProgressToken

NewProgressToken returns a new ProgressToken.

func (ProgressToken) Format added in v0.10.0

func (v ProgressToken) Format(f fmt.State, r rune)

Format writes the ProgressToken to the formatter.

If the rune is q the representation is non ambiguous, string forms are quoted.

func (*ProgressToken) MarshalJSON added in v0.10.0

func (v *ProgressToken) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (ProgressToken) String added in v0.10.0

func (v ProgressToken) String() string

String returns a string representation of the ProgressToken.

func (*ProgressToken) UnmarshalJSON added in v0.10.0

func (v *ProgressToken) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type PublishDiagnosticsClientCapabilities added in v0.11.1

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

	// TagSupport clients supporting tags have to handle unknown tags gracefully.
	//
	// @since 3.15.0.
	TagSupport *PublishDiagnosticsClientCapabilitiesTagSupport `json:"tagSupport,omitempty"`

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

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

	// DataSupport 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"`
}

PublishDiagnosticsClientCapabilities capabilities specific to "textDocument/publishDiagnostics".

type PublishDiagnosticsClientCapabilitiesTagSupport added in v0.11.1

type PublishDiagnosticsClientCapabilitiesTagSupport struct {
	// ValueSet is the tags supported by the client.
	ValueSet []DiagnosticTag `json:"valueSet"`
}

PublishDiagnosticsClientCapabilitiesTagSupport is the client capacity of TagSupport.

@since 3.15.0.

type PublishDiagnosticsParams

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

	// Version optional the version number of the document the diagnostics are published for.
	//
	// @since 3.15
	Version uint32 `json:"version,omitempty"`

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

PublishDiagnosticsParams represents a params of PublishDiagnostics notification.

type Range

type Range struct {
	// Start is the range's start position.
	Start Position `json:"start"`

	// End is the range's end position.
	End Position `json:"end"`
}

Range represents a text document expressed as (zero-based) start and end positions.

A range is comparable to a selection in an editor. Therefore the end position is exclusive. If you want to specify a range that contains a line including the line ending character(s) then use an end position denoting the start of the next line.

type ReferenceContext

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

ReferenceContext context of ReferenceParams.

type ReferenceOptions added in v0.11.1

type ReferenceOptions struct {
	WorkDoneProgressOptions
}

ReferenceOptions registration option of Reference server capability.

type ReferenceParams

type ReferenceParams struct {
	TextDocumentPositionParams
	WorkDoneProgressParams
	PartialResultParams

	// Context is the ReferenceParams context.
	Context ReferenceContext `json:"context"`
}

ReferenceParams params of References request.

@since 3.15.0.

type ReferencesOptions added in v0.10.0

type ReferencesOptions struct {
	WorkDoneProgressOptions
}

ReferencesOptions ReferencesProvider options.

@since 3.15.0.

type ReferencesParams deprecated added in v0.10.0

type ReferencesParams = ReferenceParams

ReferencesParams alias of ReferenceParams.

Deprecated: Use ReferenceParams instead.

type ReferencesTextDocumentClientCapabilities added in v0.11.1

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

ReferencesTextDocumentClientCapabilities capabilities specific to the "textDocument/references".

type Registration

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

	// Method is the method / capability to register for.
	Method string `json:"method"`

	// RegisterOptions options necessary for the registration.
	RegisterOptions interface{} `json:"registerOptions,omitempty"`
}

Registration general parameters to register for a capability.

type RegistrationParams

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

RegistrationParams params of Register Capability.

type RegularExpressionsClientCapabilities added in v0.11.0

type RegularExpressionsClientCapabilities struct {
	// Engine is the engine's name.
	//
	// Well known engine name is "ECMAScript".
	//  https://tc39.es/ecma262/#sec-regexp-regular-expression-objects
	//  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
	Engine string `json:"engine"`

	// Version is the engine's version.
	//
	// Well known engine version is "ES2020".
	//  https://tc39.es/ecma262/#sec-regexp-regular-expression-objects
	//  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
	Version string `json:"version,omitempty"`
}

RegularExpressionsClientCapabilities represents a client capabilities specific to regular expressions.

The following features from the ECMAScript 2020 regular expression specification are NOT mandatory for a client:

Assertions

Lookahead assertion, Negative lookahead assertion, lookbehind assertion, negative lookbehind assertion.

Character classes

Matching control characters using caret notation (e.g. "\cX") and matching UTF-16 code units (e.g. "\uhhhh").

Group and ranges

Named capturing groups.

Unicode property escapes

None of the features needs to be supported.

The only regular expression flag that a client needs to support is "i" to specify a case insensitive search.

@since 3.16.0.

type RenameClientCapabilities added in v0.11.1

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

	// PrepareSupport is the client supports testing for validity of rename operations
	// before execution.
	PrepareSupport bool `json:"prepareSupport,omitempty"`

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

	// HonorsChangeAnnotations 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"`
}

RenameClientCapabilities capabilities specific to the "textDocument/rename".

type RenameFile

type RenameFile struct {
	// Kind a rename.
	Kind ResourceOperationKind `json:"kind"` // should be `rename`

	// OldURI is the old (existing) location.
	OldURI DocumentURI `json:"oldUri"`

	// NewURI is the new location.
	NewURI DocumentURI `json:"newUri"`

	// Options rename options.
	Options *RenameFileOptions `json:"options,omitempty"`

	// AnnotationID an optional annotation identifier describing the operation.
	//
	// @since 3.16.0.
	AnnotationID ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
}

RenameFile represents a rename file operation.

type RenameFileOptions

type RenameFileOptions struct {
	// Overwrite target if existing. Overwrite wins over `ignoreIfExists`.
	Overwrite bool `json:"overwrite,omitempty"`

	// IgnoreIfExists ignores if target exists.
	IgnoreIfExists bool `json:"ignoreIfExists,omitempty"`
}

RenameFileOptions represents a rename file options.

type RenameFilesParams added in v0.11.0

type RenameFilesParams struct {
	// Files 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"`
}

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

@since 3.16.0.

type RenameOptions

type RenameOptions struct {
	// PrepareProvider renames should be checked and tested before being executed.
	PrepareProvider bool `json:"prepareProvider,omitempty"`
}

RenameOptions rename options.

type RenameParams

type RenameParams struct {
	TextDocumentPositionParams
	PartialResultParams

	// NewName is 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"`
}

RenameParams params of Rename request.

type RenameRegistrationOptions

type RenameRegistrationOptions struct {
	TextDocumentRegistrationOptions

	// PrepareProvider is the renames should be checked and tested for validity before being executed.
	PrepareProvider bool `json:"prepareProvider,omitempty"`
}

RenameRegistrationOptions Rename Registration options.

type ResourceOperationKind

type ResourceOperationKind string

ResourceOperationKind is the file event type.

const (
	// CreateResourceOperation supports creating new files and folders.
	CreateResourceOperation ResourceOperationKind = "create"

	// RenameResourceOperation supports renaming existing files and folders.
	RenameResourceOperation ResourceOperationKind = "rename"

	// DeleteResourceOperation supports deleting existing files and folders.
	DeleteResourceOperation ResourceOperationKind = "delete"
)

type SaveOptions

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

SaveOptions save options.

type SelectionRange added in v0.10.0

type SelectionRange struct {
	// Range is the Range of this selection range.
	Range Range `json:"range"`

	// Parent is the parent selection range containing this range. Therefore `parent.range` must contain this Range.
	Parent *SelectionRange `json:"parent,omitempty"`
}

SelectionRange represents a selection range represents a part of a selection hierarchy.

A selection range may have a parent selection range that contains it.

@since 3.15.0.

type SelectionRangeClientCapabilities added in v0.11.1

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

SelectionRangeClientCapabilities capabilities specific to "textDocument/selectionRange" requests.

@since 3.16.0.

type SelectionRangeOptions added in v0.10.0

type SelectionRangeOptions struct {
	WorkDoneProgressOptions
}

SelectionRangeOptions is the server capability of selection range.

func (*SelectionRangeOptions) Value added in v0.10.0

func (v *SelectionRangeOptions) Value() interface{}

Value implements SelectionRangeProviderOptions interface.

type SelectionRangeParams added in v0.10.0

type SelectionRangeParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

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

SelectionRangeParams represents a parameter literal used in selection range requests.

@since 3.15.0.

type SelectionRangeProviderOptions added in v0.10.0

type SelectionRangeProviderOptions interface{}

SelectionRangeProviderOptions selection range provider options interface.

func NewEnableSelectionRange added in v0.10.0

func NewEnableSelectionRange(enable bool) SelectionRangeProviderOptions

NewEnableSelectionRange returns the new EnableSelectionRange underlying types SelectionRangeProviderOptions.

func NewSelectionRangeOptions added in v0.10.0

func NewSelectionRangeOptions(enableWorkDoneProgress bool) SelectionRangeProviderOptions

NewSelectionRangeOptions returns the new SelectionRangeOptions underlying types SelectionRangeProviderOptions.

func NewSelectionRangeRegistrationOptions added in v0.10.0

func NewSelectionRangeRegistrationOptions(enableWorkDoneProgress bool, selector DocumentSelector, id string) SelectionRangeProviderOptions

NewSelectionRangeRegistrationOptions returns the new SelectionRangeRegistrationOptions underlying types SelectionRangeProviderOptions.

type SelectionRangeRegistrationOptions added in v0.10.0

type SelectionRangeRegistrationOptions struct {
	SelectionRangeOptions
	TextDocumentRegistrationOptions
	StaticRegistrationOptions
}

SelectionRangeRegistrationOptions is the server capability of selection range registration.

func (*SelectionRangeRegistrationOptions) Value added in v0.10.0

func (v *SelectionRangeRegistrationOptions) Value() interface{}

Value implements SelectionRangeProviderOptions interface.

type SemanticTokenModifiers added in v0.11.0

type SemanticTokenModifiers string

SemanticTokenModifiers represents a modifiers of semantic token.

@since 3.16.0.

const (
	SemanticTokenModifierDeclaration    SemanticTokenModifiers = "declaration"
	SemanticTokenModifierDefinition     SemanticTokenModifiers = "definition"
	SemanticTokenModifierReadonly       SemanticTokenModifiers = "readonly"
	SemanticTokenModifierStatic         SemanticTokenModifiers = "static"
	SemanticTokenModifierDeprecated     SemanticTokenModifiers = "deprecated"
	SemanticTokenModifierAbstract       SemanticTokenModifiers = "abstract"
	SemanticTokenModifierAsync          SemanticTokenModifiers = "async"
	SemanticTokenModifierModification   SemanticTokenModifiers = "modification"
	SemanticTokenModifierDocumentation  SemanticTokenModifiers = "documentation"
	SemanticTokenModifierDefaultLibrary SemanticTokenModifiers = "defaultLibrary"
)

list of SemanticTokenModifiers.

type SemanticTokenTypes added in v0.11.0

type SemanticTokenTypes string

SemanticTokenTypes represents a type of semantic token.

@since 3.16.0.

const (
	SemanticTokenNamespace SemanticTokenTypes = "namespace"

	// Represents a generic type. Acts as a fallback for types which
	// can't be mapped to a specific type like class or enum.
	SemanticTokenType          SemanticTokenTypes = "type"
	SemanticTokenClass         SemanticTokenTypes = "class"
	SemanticTokenEnum          SemanticTokenTypes = "enum"
	SemanticTokenInterface     SemanticTokenTypes = "interface"
	SemanticTokenStruct        SemanticTokenTypes = "struct"
	SemanticTokenTypeParameter SemanticTokenTypes = "typeParameter"
	SemanticTokenParameter     SemanticTokenTypes = "parameter"
	SemanticTokenVariable      SemanticTokenTypes = "variable"
	SemanticTokenProperty      SemanticTokenTypes = "property"
	SemanticTokenEnumMember    SemanticTokenTypes = "enumMember"
	SemanticTokenEvent         SemanticTokenTypes = "event"
	SemanticTokenFunction      SemanticTokenTypes = "function"
	SemanticTokenMethod        SemanticTokenTypes = "method"
	SemanticTokenMacro         SemanticTokenTypes = "macro"
	SemanticTokenKeyword       SemanticTokenTypes = "keyword"
	SemanticTokenModifier      SemanticTokenTypes = "modifier"
	SemanticTokenComment       SemanticTokenTypes = "comment"
	SemanticTokenString        SemanticTokenTypes = "string"
	SemanticTokenNumber        SemanticTokenTypes = "number"
	SemanticTokenRegexp        SemanticTokenTypes = "regexp"
	SemanticTokenOperator      SemanticTokenTypes = "operator"
)

list of SemanticTokenTypes.

type SemanticTokens added in v0.11.0

type SemanticTokens struct {
	// ResultID 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"`

	// Data is the actual tokens.
	Data []uint32 `json:"data"`
}

SemanticTokens is the result of SemanticTokensFull request.

@since 3.16.0.

type SemanticTokensClientCapabilities added in v0.11.1

type SemanticTokensClientCapabilities struct {
	// DynamicRegistration 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"`

	// Requests 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 SemanticTokensWorkspaceClientCapabilitiesRequests `json:"requests"`

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

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

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

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

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

SemanticTokensClientCapabilities capabilities specific to the "textDocument.semanticTokens" request.

@since 3.16.0.

type SemanticTokensDelta added in v0.11.0

type SemanticTokensDelta struct {
	// ResultID is the result id.
	//
	// This field is readonly.
	ResultID string `json:"resultId,omitempty"`

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

SemanticTokensDelta result of SemanticTokensFullDelta request.

@since 3.16.0.

type SemanticTokensDeltaParams added in v0.11.0

type SemanticTokensDeltaParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// PreviousResultID is 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"`
}

SemanticTokensDeltaParams params for the SemanticTokensFullDelta request.

@since 3.16.0.

type SemanticTokensDeltaPartialResult added in v0.11.0

type SemanticTokensDeltaPartialResult struct {
	Edits []SemanticTokensEdit `json:"edits"`
}

SemanticTokensDeltaPartialResult is the partial result of SemanticTokensFullDelta request.

@since 3.16.0.

type SemanticTokensEdit added in v0.11.0

type SemanticTokensEdit struct {
	// Start is the start offset of the edit.
	Start uint32 `json:"start"`

	// DeleteCount is the count of elements to remove.
	DeleteCount uint32 `json:"deleteCount"`

	// Data is the elements to insert.
	Data []uint32 `json:"data,omitempty"`
}

SemanticTokensEdit is the semantic token edit.

@since 3.16.0.

type SemanticTokensLegend added in v0.11.0

type SemanticTokensLegend struct {
	// TokenTypes is the token types a server uses.
	TokenTypes []SemanticTokenTypes `json:"tokenTypes"`

	// TokenModifiers is the token modifiers a server uses.
	TokenModifiers []SemanticTokenModifiers `json:"tokenModifiers"`
}

SemanticTokensLegend is the on the capability level types and modifiers are defined using strings.

However the real encoding happens using numbers.

The server therefore needs to let the client know which numbers it is using for which types and modifiers.

@since 3.16.0.

type SemanticTokensOptions added in v0.11.0

type SemanticTokensOptions struct {
	WorkDoneProgressOptions
}

SemanticTokensOptions option of semantic tokens provider server capabilities.

@since 3.16.0.

type SemanticTokensParams added in v0.11.0

type SemanticTokensParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

SemanticTokensParams params for the SemanticTokensFull request.

@since 3.16.0.

type SemanticTokensPartialResult added in v0.11.0

type SemanticTokensPartialResult struct {
	// Data is the actual tokens.
	Data []uint32 `json:"data"`
}

SemanticTokensPartialResult is the partial result of SemanticTokensFull request.

@since 3.16.0.

type SemanticTokensRangeParams added in v0.11.0

type SemanticTokensRangeParams struct {
	WorkDoneProgressParams
	PartialResultParams

	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// Range is the range the semantic tokens are requested for.
	Range Range `json:"range"`
}

SemanticTokensRangeParams params for the SemanticTokensRange request.

@since 3.16.0.

type SemanticTokensRegistrationOptions added in v0.11.0

type SemanticTokensRegistrationOptions struct {
	TextDocumentRegistrationOptions
	SemanticTokensOptions
	StaticRegistrationOptions
}

SemanticTokensRegistrationOptions registration option of semantic tokens provider server capabilities.

@since 3.16.0.

type SemanticTokensWorkspaceClientCapabilities added in v0.11.1

type SemanticTokensWorkspaceClientCapabilities struct {
	// RefreshSupport 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"`
}

SemanticTokensWorkspaceClientCapabilities capabilities specific to the "workspace/semanticToken" request.

@since 3.16.0.

type SemanticTokensWorkspaceClientCapabilitiesRequests added in v0.11.1

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

	// Full is the client will send the "textDocument/semanticTokens/full" request
	// if the server provides a corresponding handler. The client will send the
	// `textDocument/semanticTokens/full/delta` request if the server provides a
	// corresponding handler.
	Full interface{} `json:"full,omitempty"`
}

SemanticTokensWorkspaceClientCapabilitiesRequests capabilities specific to the "textDocument/semanticTokens/xxx" request.

@since 3.16.0.

type Server added in v0.9.0

type Server interface {
	Initialize(ctx context.Context, params *InitializeParams) (result *InitializeResult, err error)
	Initialized(ctx context.Context, params *InitializedParams) (err error)
	Shutdown(ctx context.Context) (err error)
	Exit(ctx context.Context) (err error)
	WorkDoneProgressCancel(ctx context.Context, params *WorkDoneProgressCancelParams) (err error)
	LogTrace(ctx context.Context, params *LogTraceParams) (err error)
	SetTrace(ctx context.Context, params *SetTraceParams) (err error)
	CodeAction(ctx context.Context, params *CodeActionParams) (result []CodeAction, err error)
	CodeLens(ctx context.Context, params *CodeLensParams) (result []CodeLens, err error)
	CodeLensResolve(ctx context.Context, params *CodeLens) (result *CodeLens, err error)
	ColorPresentation(ctx context.Context, params *ColorPresentationParams) (result []ColorPresentation, err error)
	Completion(ctx context.Context, params *CompletionParams) (result *CompletionList, err error)
	CompletionResolve(ctx context.Context, params *CompletionItem) (result *CompletionItem, err error)
	Declaration(ctx context.Context, params *DeclarationParams) (result []Location, err error)
	Definition(ctx context.Context, params *DefinitionParams) (result []Location, err error)
	DidChange(ctx context.Context, params *DidChangeTextDocumentParams) (err error)
	DidChangeConfiguration(ctx context.Context, params *DidChangeConfigurationParams) (err error)
	DidChangeWatchedFiles(ctx context.Context, params *DidChangeWatchedFilesParams) (err error)
	DidChangeWorkspaceFolders(ctx context.Context, params *DidChangeWorkspaceFoldersParams) (err error)
	DidClose(ctx context.Context, params *DidCloseTextDocumentParams) (err error)
	DidOpen(ctx context.Context, params *DidOpenTextDocumentParams) (err error)
	DidSave(ctx context.Context, params *DidSaveTextDocumentParams) (err error)
	DocumentColor(ctx context.Context, params *DocumentColorParams) (result []ColorInformation, err error)
	DocumentHighlight(ctx context.Context, params *DocumentHighlightParams) (result []DocumentHighlight, err error)
	DocumentLink(ctx context.Context, params *DocumentLinkParams) (result []DocumentLink, err error)
	DocumentLinkResolve(ctx context.Context, params *DocumentLink) (result *DocumentLink, err error)
	DocumentSymbol(ctx context.Context, params *DocumentSymbolParams) (result []interface{}, err error)
	ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (result interface{}, err error)
	FoldingRanges(ctx context.Context, params *FoldingRangeParams) (result []FoldingRange, err error)
	Formatting(ctx context.Context, params *DocumentFormattingParams) (result []TextEdit, err error)
	Hover(ctx context.Context, params *HoverParams) (result *Hover, err error)
	Implementation(ctx context.Context, params *ImplementationParams) (result []Location, err error)
	OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) (result []TextEdit, err error)
	PrepareRename(ctx context.Context, params *PrepareRenameParams) (result *Range, err error)
	RangeFormatting(ctx context.Context, params *DocumentRangeFormattingParams) (result []TextEdit, err error)
	References(ctx context.Context, params *ReferenceParams) (result []Location, err error)
	Rename(ctx context.Context, params *RenameParams) (result *WorkspaceEdit, err error)
	SignatureHelp(ctx context.Context, params *SignatureHelpParams) (result *SignatureHelp, err error)
	Symbols(ctx context.Context, params *WorkspaceSymbolParams) (result []SymbolInformation, err error)
	TypeDefinition(ctx context.Context, params *TypeDefinitionParams) (result []Location, err error)
	WillSave(ctx context.Context, params *WillSaveTextDocumentParams) (err error)
	WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) (result []TextEdit, err error)
	ShowDocument(ctx context.Context, params *ShowDocumentParams) (result *ShowDocumentResult, err error)
	WillCreateFiles(ctx context.Context, params *CreateFilesParams) (result *WorkspaceEdit, err error)
	DidCreateFiles(ctx context.Context, params *CreateFilesParams) (err error)
	WillRenameFiles(ctx context.Context, params *RenameFilesParams) (result *WorkspaceEdit, err error)
	DidRenameFiles(ctx context.Context, params *RenameFilesParams) (err error)
	WillDeleteFiles(ctx context.Context, params *DeleteFilesParams) (result *WorkspaceEdit, err error)
	DidDeleteFiles(ctx context.Context, params *DeleteFilesParams) (err error)
	CodeLensRefresh(ctx context.Context) (err error)
	PrepareCallHierarchy(ctx context.Context, params *CallHierarchyPrepareParams) (result []CallHierarchyItem, err error)
	IncomingCalls(ctx context.Context, params *CallHierarchyIncomingCallsParams) (result []CallHierarchyIncomingCall, err error)
	OutgoingCalls(ctx context.Context, params *CallHierarchyOutgoingCallsParams) (result []CallHierarchyOutgoingCall, err error)
	SemanticTokensFull(ctx context.Context, params *SemanticTokensParams) (result *SemanticTokens, err error)
	SemanticTokensFullDelta(ctx context.Context, params *SemanticTokensDeltaParams) (result interface{}, err error)
	SemanticTokensRange(ctx context.Context, params *SemanticTokensRangeParams) (result *SemanticTokens, err error)
	SemanticTokensRefresh(ctx context.Context) (err error)
	LinkedEditingRange(ctx context.Context, params *LinkedEditingRangeParams) (result *LinkedEditingRanges, err error)
	Moniker(ctx context.Context, params *MonikerParams) (result []Moniker, err error)
	Request(ctx context.Context, method string, params interface{}) (result interface{}, err error)
}

Server represents a Language Server Protocol server.

func NewClient

func NewClient(ctx context.Context, client Client, stream jsonrpc2.Stream, logger *zap.Logger) (context.Context, jsonrpc2.Conn, Server)

NewClient returns the context in which Client is embedded, jsonrpc2.Conn, and the Server.

func ServerDispatcher added in v0.9.0

func ServerDispatcher(conn jsonrpc2.Conn, logger *zap.Logger) Server

ServerDispatcher returns a Server that dispatches LSP requests across the given jsonrpc2 connection.

type ServerCapabilities

type ServerCapabilities struct {
	// TextDocumentSync 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 interface{} `json:"textDocumentSync,omitempty"` // *TextDocumentSyncOptions | TextDocumentSyncKind

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

	// HoverProvider is the server provides hover support.
	HoverProvider interface{} `json:"hoverProvider,omitempty"` // TODO(zchee): bool | *HoverOptions

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

	// DeclarationProvider is the server provides Goto Declaration support.
	//
	// @since 3.14.0.
	DeclarationProvider interface{} `json:"declarationProvider,omitempty"` // TODO(zchee): bool | *DeclarationOptions | *DeclarationRegistrationOptions

	// DefinitionProvider is the server provides Goto definition support.
	DefinitionProvider interface{} `json:"definitionProvider,omitempty"` // TODO(zchee): bool | *DefinitionOptions

	// TypeDefinitionProvider is the provides Goto Type Definition support.
	//
	// @since 3.6.0.
	TypeDefinitionProvider interface{} `json:"typeDefinitionProvider,omitempty"` // TODO(zchee): bool | *TypeDefinitionOptions | *TypeDefinitionRegistrationOptions

	// ImplementationProvider is the provides Goto Implementation support.
	//
	// @since 3.6.0.
	ImplementationProvider interface{} `json:"implementationProvider,omitempty"` // TODO(zchee): bool | *ImplementationOptions | *ImplementationRegistrationOptions

	// ReferencesProvider is the server provides find references support.
	ReferencesProvider interface{} `json:"referencesProvider,omitempty"` // TODO(zchee): bool | *ReferenceOptions

	// DocumentHighlightProvider is the server provides document highlight support.
	DocumentHighlightProvider interface{} `json:"documentHighlightProvider,omitempty"` // TODO(zchee): bool | *DocumentHighlightOptions

	// DocumentSymbolProvider is the server provides document symbol support.
	DocumentSymbolProvider interface{} `json:"documentSymbolProvider,omitempty"` // TODO(zchee): bool | *DocumentSymbolOptions

	// CodeActionProvider is the server provides code actions.
	//
	// CodeActionOptions may only be specified if the client states that it supports CodeActionLiteralSupport in its
	// initial Initialize request.
	CodeActionProvider interface{} `json:"codeActionProvider,omitempty"` // TODO(zchee): bool | *CodeActionOptions

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

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

	// ColorProvider is the server provides color provider support.
	//
	// @since 3.6.0.
	ColorProvider interface{} `json:"colorProvider,omitempty"` // TODO(zchee): bool | *DocumentColorOptions | *DocumentColorRegistrationOptions

	// WorkspaceSymbolProvider is the server provides workspace symbol support.
	WorkspaceSymbolProvider interface{} `json:"workspaceSymbolProvider,omitempty"` // TODO(zchee): bool | *WorkspaceSymbolOptions

	// DocumentFormattingProvider is the server provides document formatting.
	DocumentFormattingProvider interface{} `json:"documentFormattingProvider,omitempty"` // TODO(zchee): bool | *DocumentFormattingOptions

	// DocumentRangeFormattingProvider is the server provides document range formatting.
	DocumentRangeFormattingProvider interface{} `json:"documentRangeFormattingProvider,omitempty"` // TODO(zchee): bool | *DocumentRangeFormattingOptions

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

	// RenameProvider is the server provides rename support.
	//
	// RenameOptions may only be specified if the client states that it supports PrepareSupport in its
	// initial Initialize request.
	RenameProvider interface{} `json:"renameProvider,omitempty"` // TODO(zchee): bool | *RenameOptions

	// FoldingRangeProvider is the server provides folding provider support.
	//
	// @since 3.10.0.
	FoldingRangeProvider interface{} `json:"foldingRangeProvider,omitempty"` // TODO(zchee): bool | *FoldingRangeOptions | *FoldingRangeRegistrationOptions

	// SelectionRangeProvider is the server provides selection range support.
	//
	// @since 3.15.0.
	SelectionRangeProvider interface{} `json:"selectionRangeProvider,omitempty"` // TODO(zchee): bool | *SelectionRangeOptions | *SelectionRangeRegistrationOptions

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

	// CallHierarchyProvider is the server provides call hierarchy support.
	//
	// @since 3.16.0.
	CallHierarchyProvider interface{} `json:"callHierarchyProvider,omitempty"` // TODO(zchee): bool | *CallHierarchyOptions | *CallHierarchyRegistrationOptions

	// LinkedEditingRangeProvider is the server provides linked editing range support.
	//
	// @since 3.16.0.
	LinkedEditingRangeProvider interface{} `json:"linkedEditingRangeProvider,omitempty"` // TODO(zchee): bool | *LinkedEditingRangeOptions | *LinkedEditingRangeRegistrationOptions

	// SemanticTokensProvider is the server provides semantic tokens support.
	//
	// @since 3.16.0.
	SemanticTokensProvider interface{} `json:"semanticTokensProvider,omitempty"` // TODO(zchee): *SemanticTokensOptions | *SemanticTokensRegistrationOptions

	// Workspace is the window specific server capabilities.
	Workspace *ServerCapabilitiesWorkspace `json:"workspace,omitempty"`

	// MonikerProvider is the server provides moniker support.
	//
	// @since 3.16.0.
	MonikerProvider interface{} `json:"monikerProvider,omitempty"` // TODO(zchee): bool | *MonikerOptions | *MonikerRegistrationOptions

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

ServerCapabilities efines the capabilities provided by a language server.

type ServerCapabilitiesWorkspace

type ServerCapabilitiesWorkspace struct {
	// WorkspaceFolders is the server supports workspace folder.
	//
	// @since 3.6.0.
	WorkspaceFolders *ServerCapabilitiesWorkspaceFolders `json:"workspaceFolders,omitempty"`

	// FileOperations is the server is interested in file notifications/requests.
	//
	// @since 3.16.0.
	FileOperations *ServerCapabilitiesWorkspaceFileOperations `json:"fileOperations,omitempty"`
}

ServerCapabilitiesWorkspace specific server capabilities.

type ServerCapabilitiesWorkspaceFileOperations added in v0.11.0

type ServerCapabilitiesWorkspaceFileOperations struct {
	// DidCreate is the server is interested in receiving didCreateFiles
	// notifications.
	DidCreate *FileOperationRegistrationOptions `json:"didCreate,omitempty"`

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

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

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

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

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

ServerCapabilitiesWorkspaceFileOperations is the server is interested in file notifications/requests.

@since 3.16.0.

type ServerCapabilitiesWorkspaceFolders

type ServerCapabilitiesWorkspaceFolders struct {
	// Supported is the server has support for workspace folders
	Supported bool `json:"supported,omitempty"`

	// ChangeNotifications whether the server wants to receive workspace folder
	// change notifications.
	//
	// If a strings is provided the string is treated as a 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 interface{} `json:"changeNotifications,omitempty"` // string | boolean
}

ServerCapabilitiesWorkspaceFolders is the server supports workspace folder.

@since 3.6.0.

type ServerInfo added in v0.10.0

type ServerInfo struct {
	// Name is the name of the server as defined by the server.
	Name string `json:"name"`

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

ServerInfo Information about the server.

@since 3.15.0.

type SetTraceParams added in v0.11.0

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

SetTraceParams params of SetTrace notification.

@since 3.16.0.

type ShowDocumentClientCapabilities added in v0.11.1

type ShowDocumentClientCapabilities struct {
	// Support is 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 added in v0.11.0

type ShowDocumentParams struct {
	// URI is the document uri to show.
	URI URI `json:"uri"`

	// External 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"`

	// TakeFocus 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"`

	// Selection 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 added in v0.11.0

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

ShowDocumentResult is the result of an show document request.

@since 3.16.0.

type ShowMessageParams

type ShowMessageParams struct {
	// Message is the actual message.
	Message string `json:"message"`

	// Type is the message type.
	Type MessageType `json:"type"`
}

ShowMessageParams params of ShowMessage notification.

type ShowMessageRequestClientCapabilities added in v0.11.1

type ShowMessageRequestClientCapabilities struct {
	// MessageActionItem capabilities specific to the "MessageActionItem" type.
	MessageActionItem *ShowMessageRequestClientCapabilitiesMessageActionItem `json:"messageActionItem,omitempty"`
}

ShowMessageRequestClientCapabilities show message request client capabilities.

@since 3.16.0.

type ShowMessageRequestClientCapabilitiesMessageActionItem added in v0.11.1

type ShowMessageRequestClientCapabilitiesMessageActionItem struct {
	// AdditionalPropertiesSupport 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"`
}

ShowMessageRequestClientCapabilitiesMessageActionItem capabilities specific to the "MessageActionItem" type.

@since 3.16.0.

type ShowMessageRequestParams

type ShowMessageRequestParams struct {
	// Actions is the message action items to present.
	Actions []MessageActionItem `json:"actions"`

	// Message is the actual message
	Message string `json:"message"`

	// Type is the message type. See {@link MessageType}
	Type MessageType `json:"type"`
}

ShowMessageRequestParams params of ShowMessage request.

type SignatureHelp

type SignatureHelp struct {
	// Signatures one or more signatures.
	Signatures []SignatureInformation `json:"signatures"`

	// ActiveParameter is 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 uint32 `json:"activeParameter,omitempty"`

	// ActiveSignature is the active signature. If omitted or the value lies outside the
	// range of `signatures` the value defaults to zero or is ignored if
	// `signatures.length === 0`. 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 uint32 `json:"activeSignature,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 SignatureHelpContext added in v0.10.0

type SignatureHelpContext struct {
	// TriggerKind is the action that caused signature help to be triggered.
	TriggerKind SignatureHelpTriggerKind `json:"triggerKind"`

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

	// IsRetrigger is the `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"`

	// ActiveSignatureHelp is 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 is the additional information about the context in which a signature help request was triggered.

@since 3.15.0.

type SignatureHelpOptions

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

	// RetriggerCharacters is the slist 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"`
}

SignatureHelpOptions SignatureHelp options.

type SignatureHelpParams added in v0.10.0

type SignatureHelpParams struct {
	TextDocumentPositionParams
	WorkDoneProgressParams

	// context is 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"`
}

SignatureHelpParams params of SignatureHelp request.

@since 3.15.0.

type SignatureHelpRegistrationOptions

type SignatureHelpRegistrationOptions struct {
	TextDocumentRegistrationOptions

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

SignatureHelpRegistrationOptions SignatureHelp Registration options.

type SignatureHelpTextDocumentClientCapabilities added in v0.11.1

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

	// SignatureInformation is the client supports the following "SignatureInformation"
	// specific properties.
	SignatureInformation *TextDocumentClientCapabilitiesSignatureInformation `json:"signatureInformation,omitempty"`

	// ContextSupport is 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"`
}

SignatureHelpTextDocumentClientCapabilities capabilities specific to the "textDocument/signatureHelp".

type SignatureHelpTriggerKind added in v0.10.0

type SignatureHelpTriggerKind float64

SignatureHelpTriggerKind is the how a signature help was triggered.

@since 3.15.0.

const (
	// SignatureHelpTriggerKindInvoked is the signature help was invoked manually by the user or by a command.
	SignatureHelpTriggerKindInvoked SignatureHelpTriggerKind = 1

	// SignatureHelpTriggerKindTriggerCharacter is the signature help was triggered by a trigger character.
	SignatureHelpTriggerKindTriggerCharacter SignatureHelpTriggerKind = 2

	// SignatureHelpTriggerKindContentChange is the signature help was triggered by the cursor moving or
	// by the document content changing.
	SignatureHelpTriggerKindContentChange SignatureHelpTriggerKind = 3
)

list of SignatureHelpTriggerKind.

func (SignatureHelpTriggerKind) String added in v0.10.0

func (s SignatureHelpTriggerKind) String() string

String returns a string representation of the type.

type SignatureInformation

type SignatureInformation struct {
	// Label is the label of this signature. Will be shown in
	// the UI.
	//
	// @since 3.16.0.
	Label string `json:"label"`

	// Documentation is the human-readable doc-comment of this signature. Will be shown
	// in the UI but can be omitted.
	//
	// @since 3.16.0.
	Documentation interface{} `json:"documentation,omitempty"` // string | *MarkupContent

	// Parameters is the parameters of this signature.
	//
	// @since 3.16.0.
	Parameters []ParameterInformation `json:"parameters,omitempty"`

	// ActiveParameterSupport is the client supports the `activeParameter` property on
	// `SignatureInformation` literal.
	//
	// @since 3.16.0.
	ActiveParameter uint32 `json:"activeParameter,omitempty"`
}

SignatureInformation is the client supports the following `SignatureInformation` specific properties.

type StaticRegistrationOptions

type StaticRegistrationOptions struct {
	// ID is 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 staticRegistration options to be returned in the initialize request.

type SymbolInformation

type SymbolInformation struct {
	// Name is the name of this symbol.
	Name string `json:"name"`

	// Kind is the kind of this symbol.
	Kind SymbolKind `json:"kind"`

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

	// Deprecated indicates if this symbol is deprecated.
	Deprecated bool `json:"deprecated,omitempty"`

	// Location is 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"`

	// ContainerName is 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 float64

SymbolKind specific capabilities for the `SymbolKind`. 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.

const (
	// SymbolKindFile symbol of file.
	SymbolKindFile SymbolKind = 1
	// SymbolKindModule symbol of module.
	SymbolKindModule SymbolKind = 2
	// SymbolKindNamespace symbol of namespace.
	SymbolKindNamespace SymbolKind = 3
	// SymbolKindPackage symbol of package.
	SymbolKindPackage SymbolKind = 4
	// SymbolKindClass symbol of class.
	SymbolKindClass SymbolKind = 5
	// SymbolKindMethod symbol of method.
	SymbolKindMethod SymbolKind = 6
	// SymbolKindProperty symbol of property.
	SymbolKindProperty SymbolKind = 7
	// SymbolKindField symbol of field.
	SymbolKindField SymbolKind = 8
	// SymbolKindConstructor symbol of constructor.
	SymbolKindConstructor SymbolKind = 9
	// SymbolKindEnum symbol of enum.
	SymbolKindEnum SymbolKind = 10
	// SymbolKindInterface symbol of interface.
	SymbolKindInterface SymbolKind = 11
	// SymbolKindFunction symbol of function.
	SymbolKindFunction SymbolKind = 12
	// SymbolKindVariable symbol of variable.
	SymbolKindVariable SymbolKind = 13
	// SymbolKindConstant symbol of constant.
	SymbolKindConstant SymbolKind = 14
	// SymbolKindString symbol of string.
	SymbolKindString SymbolKind = 15
	// SymbolKindNumber symbol of number.
	SymbolKindNumber SymbolKind = 16
	// SymbolKindBoolean symbol of boolean.
	SymbolKindBoolean SymbolKind = 17
	// SymbolKindArray symbol of array.
	SymbolKindArray SymbolKind = 18
	// SymbolKindObject symbol of object.
	SymbolKindObject SymbolKind = 19
	// SymbolKindKey symbol of key.
	SymbolKindKey SymbolKind = 20
	// SymbolKindNull symbol of null.
	SymbolKindNull SymbolKind = 21
	// SymbolKindEnumMember symbol of enum member.
	SymbolKindEnumMember SymbolKind = 22
	// SymbolKindStruct symbol of struct.
	SymbolKindStruct SymbolKind = 23
	// SymbolKindEvent symbol of event.
	SymbolKindEvent SymbolKind = 24
	// SymbolKindOperator symbol of operator.
	SymbolKindOperator SymbolKind = 25
	// SymbolKindTypeParameter symbol of type parameter.
	SymbolKindTypeParameter SymbolKind = 26
)

func (SymbolKind) String

func (k SymbolKind) String() string

String implements fmt.Stringer.

type SymbolKindCapabilities added in v0.11.1

type SymbolKindCapabilities struct {
	// ValueSet is 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"`
}

type SymbolTag added in v0.11.0

type SymbolTag float64

SymbolTag symbol tags are extra annotations that tweak the rendering of a symbol.

@since 3.16.0.

const (
	// SymbolTagDeprecated render a symbol as obsolete, usually using a strike-out.
	SymbolTagDeprecated SymbolTag = 1
)

list of SymbolTag.

func (SymbolTag) String added in v0.11.0

func (k SymbolTag) String() string

String returns a string representation of the SymbolTag.

type TagSupportCapabilities added in v0.11.1

type TagSupportCapabilities struct {
	// ValueSet is the tags supported by the client.
	ValueSet []SymbolTag `json:"valueSet,omitempty"`
}

type TextDocumentChangeRegistrationOptions

type TextDocumentChangeRegistrationOptions struct {
	TextDocumentRegistrationOptions

	// SyncKind how documents are synced to the server. See TextDocumentSyncKind.Full
	// and TextDocumentSyncKind.Incremental.
	SyncKind TextDocumentSyncKind `json:"syncKind"`
}

TextDocumentChangeRegistrationOptions describe options to be used when registering for text document change events.

type TextDocumentClientCapabilities

type TextDocumentClientCapabilities struct {
	// Synchronization defines which synchronization capabilities the client supports.
	Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"`

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

	// Hover capabilities specific to the "textDocument/hover".
	Hover *HoverTextDocumentClientCapabilities `json:"hover,omitempty"`

	// SignatureHelp capabilities specific to the "textDocument/signatureHelp".
	SignatureHelp *SignatureHelpTextDocumentClientCapabilities `json:"signatureHelp,omitempty"`

	// Declaration capabilities specific to the "textDocument/declaration".
	Declaration *DeclarationTextDocumentClientCapabilities `json:"declaration,omitempty"`

	// Definition capabilities specific to the "textDocument/definition".
	//
	// @since 3.14.0.
	Definition *DefinitionTextDocumentClientCapabilities `json:"definition,omitempty"`

	// TypeDefinition capabilities specific to the "textDocument/typeDefinition".
	//
	// @since 3.6.0.
	TypeDefinition *TypeDefinitionTextDocumentClientCapabilities `json:"typeDefinition,omitempty"`

	// Implementation capabilities specific to the "textDocument/implementation".
	//
	// @since 3.6.0.
	Implementation *ImplementationTextDocumentClientCapabilities `json:"implementation,omitempty"`

	// References capabilities specific to the "textDocument/references".
	References *ReferencesTextDocumentClientCapabilities `json:"references,omitempty"`

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

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

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

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

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

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

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

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

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

	// PublishDiagnostics capabilities specific to "textDocument/publishDiagnostics".
	PublishDiagnostics *PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"`

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

	// FoldingRange capabilities specific to "textDocument/foldingRange" requests.
	//
	// @since 3.10.0.
	FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitempty"`

	// SelectionRange capabilities specific to "textDocument/selectionRange" requests.
	//
	// @since 3.15.0.
	SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitempty"`

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

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

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

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

TextDocumentClientCapabilities Text document specific client capabilities.

type TextDocumentClientCapabilitiesCallHierarchy deprecated added in v0.11.0

type TextDocumentClientCapabilitiesCallHierarchy = CallHierarchyClientCapabilities

TextDocumentClientCapabilitiesCallHierarchy alias of CallHierarchyClientCapabilities.

Deprecated: Use CallHierarchyClientCapabilities instead.

type TextDocumentClientCapabilitiesCodeAction deprecated

type TextDocumentClientCapabilitiesCodeAction = CodeActionClientCapabilities

TextDocumentClientCapabilitiesCodeAction alias of CodeActionClientCapabilities.

Deprecated: Use CodeActionClientCapabilities instead.

type TextDocumentClientCapabilitiesCodeActionKind deprecated

type TextDocumentClientCapabilitiesCodeActionKind = CodeActionClientCapabilitiesKind

TextDocumentClientCapabilitiesCodeActionKind alias of CodeActionClientCapabilitiesKind.

Deprecated: Use CodeActionClientCapabilitiesKind instead.

type TextDocumentClientCapabilitiesCodeActionLiteralSupport deprecated

type TextDocumentClientCapabilitiesCodeActionLiteralSupport = CodeActionClientCapabilitiesLiteralSupport

TextDocumentClientCapabilitiesCodeActionLiteralSupport alias of CodeActionClientCapabilitiesLiteralSupport.

Deprecated: Use CodeActionClientCapabilitiesLiteralSupport instead.

type TextDocumentClientCapabilitiesCodeActionResolveSupport deprecated added in v0.11.0

type TextDocumentClientCapabilitiesCodeActionResolveSupport = CodeActionClientCapabilitiesResolveSupport

TextDocumentClientCapabilitiesCodeActionResolveSupport alias of CodeActionClientCapabilitiesResolveSupport.

Deprecated: Use CodeActionClientCapabilitiesResolveSupport instead.

type TextDocumentClientCapabilitiesCodeLens deprecated

type TextDocumentClientCapabilitiesCodeLens = CodeLensClientCapabilities

TextDocumentClientCapabilitiesCodeLens alias of CodeLensClientCapabilities.

Deprecated: Use CodeLensClientCapabilities instead.

type TextDocumentClientCapabilitiesColorProvider deprecated

type TextDocumentClientCapabilitiesColorProvider = DocumentColorClientCapabilities

TextDocumentClientCapabilitiesColorProvider alias of DocumentColorClientCapabilities.

Deprecated: Use DocumentColorClientCapabilities instead.

type TextDocumentClientCapabilitiesCompletion deprecated

type TextDocumentClientCapabilitiesCompletion = CompletionTextDocumentClientCapabilities

TextDocumentClientCapabilitiesCompletion alias of CompletionTextDocumentClientCapabilities.

Deprecated: Use CompletionTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesCompletionItem deprecated

type TextDocumentClientCapabilitiesCompletionItem = CompletionTextDocumentClientCapabilitiesItem

TextDocumentClientCapabilitiesCompletionItem alias of CompletionTextDocumentClientCapabilitiesItem.

Deprecated: Use CompletionTextDocumentClientCapabilitiesItem instead.

type TextDocumentClientCapabilitiesCompletionItemInsertTextModeSupport deprecated added in v0.11.0

type TextDocumentClientCapabilitiesCompletionItemInsertTextModeSupport = CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport

TextDocumentClientCapabilitiesCompletionItemInsertTextModeSupport alias of CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport.

Deprecated: Use CompletionTextDocumentClientCapabilitiesItemInsertTextModeSupport instead.

type TextDocumentClientCapabilitiesCompletionItemKind deprecated

type TextDocumentClientCapabilitiesCompletionItemKind = CompletionTextDocumentClientCapabilitiesItemKind

TextDocumentClientCapabilitiesCompletionItemKind alias of CompletionTextDocumentClientCapabilitiesItemKind.

Deprecated: Use CompletionTextDocumentClientCapabilitiesItemKind instead.

type TextDocumentClientCapabilitiesCompletionItemResolveSupport deprecated added in v0.11.0

type TextDocumentClientCapabilitiesCompletionItemResolveSupport = CompletionTextDocumentClientCapabilitiesItemResolveSupport

TextDocumentClientCapabilitiesCompletionItemResolveSupport alias of CompletionTextDocumentClientCapabilitiesItemResolveSupport.

Deprecated: Use CompletionTextDocumentClientCapabilitiesItemResolveSupport instead.

type TextDocumentClientCapabilitiesCompletionItemTagSupport deprecated added in v0.10.0

type TextDocumentClientCapabilitiesCompletionItemTagSupport = CompletionTextDocumentClientCapabilitiesItemTagSupport

TextDocumentClientCapabilitiesCompletionItemTagSupport alias of CompletionTextDocumentClientCapabilitiesItemTagSupport.

Deprecated: Use CompletionTextDocumentClientCapabilitiesItemTagSupport instead.

type TextDocumentClientCapabilitiesDeclaration deprecated

type TextDocumentClientCapabilitiesDeclaration = DeclarationTextDocumentClientCapabilities

TextDocumentClientCapabilitiesDeclaration alias of DeclarationTextDocumentClientCapabilities.

Deprecated: Use DeclarationTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesDefinition deprecated

type TextDocumentClientCapabilitiesDefinition = DefinitionTextDocumentClientCapabilities

TextDocumentClientCapabilitiesDefinition alias of DefinitionTextDocumentClientCapabilities.

Deprecated: Use DefinitionTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesDocumentHighlight deprecated

type TextDocumentClientCapabilitiesDocumentHighlight = DocumentHighlightClientCapabilities

TextDocumentClientCapabilitiesDocumentHighlight alias of DocumentHighlightClientCapabilities.

Deprecated: Use DocumentHighlightClientCapabilities instead.

type TextDocumentClientCapabilitiesDocumentLink = DocumentLinkClientCapabilities

TextDocumentClientCapabilitiesDocumentLink alias of DocumentLinkClientCapabilities.

Deprecated: Use DocumentLinkClientCapabilities instead.

type TextDocumentClientCapabilitiesDocumentSymbol deprecated

type TextDocumentClientCapabilitiesDocumentSymbol = DocumentSymbolClientCapabilities

TextDocumentClientCapabilitiesDocumentSymbol alias of DocumentSymbolClientCapabilities.

Deprecated: Use DocumentSymbolClientCapabilities instead.

type TextDocumentClientCapabilitiesDocumentSymbolTagSupport deprecated added in v0.11.0

type TextDocumentClientCapabilitiesDocumentSymbolTagSupport = DocumentSymbolClientCapabilitiesTagSupport

TextDocumentClientCapabilitiesDocumentSymbolTagSupport alias of DocumentSymbolClientCapabilitiesTagSupport.

Deprecated: Use DocumentSymbolClientCapabilitiesTagSupport instead.

type TextDocumentClientCapabilitiesFoldingRange deprecated

type TextDocumentClientCapabilitiesFoldingRange = FoldingRangeClientCapabilities

TextDocumentClientCapabilitiesFoldingRange alias of FoldingRangeClientCapabilities.

Deprecated: Use FoldingRangeClientCapabilities instead.

type TextDocumentClientCapabilitiesFormatting deprecated

type TextDocumentClientCapabilitiesFormatting = DocumentFormattingClientCapabilities

TextDocumentClientCapabilitiesFormatting alias of DocumentFormattingClientCapabilities.

Deprecated: Use DocumentFormattingClientCapabilities instead.

type TextDocumentClientCapabilitiesHover deprecated

type TextDocumentClientCapabilitiesHover = HoverTextDocumentClientCapabilities

TextDocumentClientCapabilitiesHover alias of HoverTextDocumentClientCapabilities.

Deprecated: Use HoverTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesImplementation deprecated

type TextDocumentClientCapabilitiesImplementation = ImplementationTextDocumentClientCapabilities

TextDocumentClientCapabilitiesImplementation alias of ImplementationTextDocumentClientCapabilities.

Deprecated: Use ImplementationTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesLinkedEditingRange deprecated added in v0.11.0

type TextDocumentClientCapabilitiesLinkedEditingRange = LinkedEditingRangeClientCapabilities

TextDocumentClientCapabilitiesLinkedEditingRange alias of LinkedEditingRangeClientCapabilities.

Deprecated: Use LinkedEditingRangeClientCapabilities instead.

type TextDocumentClientCapabilitiesMoniker deprecated added in v0.11.0

type TextDocumentClientCapabilitiesMoniker = MonikerClientCapabilities

TextDocumentClientCapabilitiesMoniker of MonikerClientCapabilities.

Deprecated: Use MonikerClientCapabilities instead.

type TextDocumentClientCapabilitiesOnTypeFormatting deprecated

type TextDocumentClientCapabilitiesOnTypeFormatting = DocumentOnTypeFormattingClientCapabilities

TextDocumentClientCapabilitiesOnTypeFormatting of DocumentOnTypeFormattingClientCapabilities.

Deprecated: Use DocumentOnTypeFormattingClientCapabilities instead.

type TextDocumentClientCapabilitiesParameterInformation

type TextDocumentClientCapabilitiesParameterInformation struct {
	// LabelOffsetSupport is the client supports processing label offsets instead of a
	// simple label string.
	//
	// @since 3.14.0.
	LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
}

TextDocumentClientCapabilitiesParameterInformation is the client capabilities specific to parameter information.

type TextDocumentClientCapabilitiesPublishDiagnostics deprecated

type TextDocumentClientCapabilitiesPublishDiagnostics = PublishDiagnosticsClientCapabilities

TextDocumentClientCapabilitiesPublishDiagnostics of PublishDiagnosticsClientCapabilities.

Deprecated: Use PublishDiagnosticsClientCapabilities instead.

type TextDocumentClientCapabilitiesPublishDiagnosticsTagSupport deprecated added in v0.10.0

type TextDocumentClientCapabilitiesPublishDiagnosticsTagSupport = PublishDiagnosticsClientCapabilitiesTagSupport

TextDocumentClientCapabilitiesPublishDiagnosticsTagSupport of PublishDiagnosticsClientCapabilitiesTagSupport.

Deprecated: Use PublishDiagnosticsClientCapabilitiesTagSupport instead.

type TextDocumentClientCapabilitiesRangeFormatting deprecated

type TextDocumentClientCapabilitiesRangeFormatting = DocumentRangeFormattingClientCapabilities

TextDocumentClientCapabilitiesRangeFormatting of DocumentRangeFormattingClientCapabilities.

Deprecated: Use DocumentRangeFormattingClientCapabilities instead.

type TextDocumentClientCapabilitiesReferences deprecated

type TextDocumentClientCapabilitiesReferences = ReferencesTextDocumentClientCapabilities

TextDocumentClientCapabilitiesReferences of ReferencesTextDocumentClientCapabilities.

Deprecated: Use ReferencesTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesRename deprecated

type TextDocumentClientCapabilitiesRename = RenameClientCapabilities

TextDocumentClientCapabilitiesRename of RenameClientCapabilities.

Deprecated: Use RenameClientCapabilities instead.

type TextDocumentClientCapabilitiesSelectionRange deprecated

type TextDocumentClientCapabilitiesSelectionRange = SelectionRangeClientCapabilities

TextDocumentClientCapabilitiesSelectionRange of SelectionRangeClientCapabilities.

Deprecated: Use SelectionRangeClientCapabilities instead.

type TextDocumentClientCapabilitiesSemanticTokens deprecated added in v0.11.0

type TextDocumentClientCapabilitiesSemanticTokens = SemanticTokensClientCapabilities

TextDocumentClientCapabilitiesSemanticTokens of SemanticTokensClientCapabilities.

Deprecated: Use SemanticTokensClientCapabilities instead.

type TextDocumentClientCapabilitiesSignatureHelp deprecated

type TextDocumentClientCapabilitiesSignatureHelp = SignatureHelpTextDocumentClientCapabilities

TextDocumentClientCapabilitiesSignatureHelp of SignatureHelpTextDocumentClientCapabilities.

Deprecated: Use SignatureHelpTextDocumentClientCapabilities instead.

type TextDocumentClientCapabilitiesSignatureInformation

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

	// ParameterInformation is the Client capabilities specific to parameter information.
	ParameterInformation *TextDocumentClientCapabilitiesParameterInformation `json:"parameterInformation,omitempty"`

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

TextDocumentClientCapabilitiesSignatureInformation is the client supports the following "SignatureInformation" specific properties.

type TextDocumentClientCapabilitiesSynchronization deprecated

type TextDocumentClientCapabilitiesSynchronization = TextDocumentSyncClientCapabilities

TextDocumentClientCapabilitiesSynchronization of TextDocumentSyncClientCapabilities.

Deprecated: Use TextDocumentSyncClientCapabilities instead.

type TextDocumentClientCapabilitiesTypeDefinition deprecated

type TextDocumentClientCapabilitiesTypeDefinition = TypeDefinitionTextDocumentClientCapabilities

TextDocumentClientCapabilitiesTypeDefinition of TypeDefinitionTextDocumentClientCapabilities.

Deprecated: Use TypeDefinitionTextDocumentClientCapabilities instead.

type TextDocumentContentChangeEvent

type TextDocumentContentChangeEvent struct {
	// Range is the range of the document that changed.
	Range Range `json:"range"`

	// RangeLength is the length of the range that got replaced.
	RangeLength uint32 `json:"rangeLength,omitempty"`

	// Text is the new text of the document.
	Text string `json:"text"`
}

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.

type TextDocumentEdit

type TextDocumentEdit struct {
	// TextDocument is the text document to change.
	TextDocument OptionalVersionedTextDocumentIdentifier `json:"textDocument"`

	// Edits is the edits to be applied.
	//
	// @since 3.16.0 - support for AnnotatedTextEdit.
	// This is guarded by the client capability Workspace.WorkspaceEdit.ChangeAnnotationSupport.
	Edits []TextEdit `json:"edits"` // []TextEdit | []AnnotatedTextEdit
}

TextDocumentEdit describes textual changes on a single text document.

The TextDocument is referred to as a OptionalVersionedTextDocumentIdentifier to allow clients to check the text document version before an edit is applied.

TextDocumentEdit describes all changes on a version "Si" and after they are applied move the document to version "Si+1". So the creator of a TextDocumentEdit doesn't need to sort the array or do any kind of ordering. However the edits must be non overlapping.

type TextDocumentIdentifier

type TextDocumentIdentifier struct {
	// URI is the text document's URI.
	URI DocumentURI `json:"uri"`
}

TextDocumentIdentifier indicates the using a URI. On the protocol level, URIs are passed as strings.

type TextDocumentItem

type TextDocumentItem struct {
	// URI is the text document's URI.
	URI DocumentURI `json:"uri"`

	// LanguageID is the text document's language identifier.
	LanguageID LanguageIdentifier `json:"languageId"`

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

	// Text is the content of the opened text document.
	Text string `json:"text"`
}

TextDocumentItem represent an item to transfer a text document from the client to the server.

type TextDocumentPositionParams

type TextDocumentPositionParams struct {
	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// Position is the position inside the text document.
	Position Position `json:"position"`
}

TextDocumentPositionParams is a parameter literal used in requests to pass a text document and a position inside that document.

It is up to the client to decide how a selection is converted into a position when issuing a request for a text document.

The client can for example honor or ignore the selection direction to make LSP request consistent with features implemented internally.

type TextDocumentRegistrationOptions

type TextDocumentRegistrationOptions struct {
	// DocumentSelector 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"`
}

TextDocumentRegistrationOptions TextDocumentRegistration options.

type TextDocumentSaveReason

type TextDocumentSaveReason float64

TextDocumentSaveReason represents reasons why a text document is saved.

const (
	// TextDocumentSaveReasonManual is the manually triggered, e.g. by the user pressing save, by starting debugging,
	// or by an API call.
	TextDocumentSaveReasonManual TextDocumentSaveReason = 1

	// TextDocumentSaveReasonAfterDelay is the automatic after a delay.
	TextDocumentSaveReasonAfterDelay TextDocumentSaveReason = 2

	// TextDocumentSaveReasonFocusOut when the editor lost focus.
	TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3
)

func (TextDocumentSaveReason) String

func (t TextDocumentSaveReason) String() string

String implements fmt.Stringer.

type TextDocumentSaveRegistrationOptions

type TextDocumentSaveRegistrationOptions struct {
	TextDocumentRegistrationOptions

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

TextDocumentSaveRegistrationOptions TextDocumentSave Registration options.

type TextDocumentSyncClientCapabilities added in v0.11.1

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

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

	// WillSaveWaitUntil is 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"`

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

TextDocumentSyncClientCapabilities defines which synchronization capabilities the client supports.

type TextDocumentSyncKind

type TextDocumentSyncKind float64

TextDocumentSyncKind defines how the host (editor) should sync document changes to the language server.

const (
	// TextDocumentSyncKindNone documents should not be synced at all.
	TextDocumentSyncKindNone TextDocumentSyncKind = 0

	// TextDocumentSyncKindFull documents are synced by always sending the full content
	// of the document.
	TextDocumentSyncKindFull TextDocumentSyncKind = 1

	// TextDocumentSyncKindIncremental documents are synced by sending the full content on open.
	// After that only incremental updates to the document are
	// send.
	TextDocumentSyncKindIncremental TextDocumentSyncKind = 2
)

func (TextDocumentSyncKind) String

func (k TextDocumentSyncKind) String() string

String implements fmt.Stringer.

type TextDocumentSyncOptions

type TextDocumentSyncOptions struct {
	// OpenClose open and close notifications are sent to the server.
	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"`

	// WillSave notifications are sent to the server.
	WillSave bool `json:"willSave,omitempty"`

	// WillSaveWaitUntil will save wait until requests are sent to the server.
	WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`

	// Save notifications are sent to the server.
	Save *SaveOptions `json:"save,omitempty"`
}

TextDocumentSyncOptions TextDocumentSync options.

type TextEdit

type TextEdit struct {
	// Range is 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"`

	// NewText is the string to be inserted. For delete operations use an
	// empty string.
	NewText string `json:"newText"`
}

TextEdit is a textual edit applicable to a text document.

type TokenFormat added in v0.11.0

type TokenFormat string

TokenFormat is an additional token format capability to allow future extensions of the format.

@since 3.16.0.

const TokenFormatRelative TokenFormat = "relative"

TokenFormatRelative described using relative positions.

type TraceValue added in v0.11.0

type TraceValue string

TraceValue represents a InitializeParams Trace mode.

const (
	// TraceOff disable tracing.
	TraceOff TraceValue = "off"

	// TraceMessage normal tracing mode.
	TraceMessage TraceValue = "message"

	// TraceVerbose verbose tracing mode.
	TraceVerbose TraceValue = "verbose"
)

list of TraceValue.

type TypeDefinitionOptions added in v0.10.0

type TypeDefinitionOptions struct {
	WorkDoneProgressOptions
}

TypeDefinitionOptions registration option of TypeDefinition server capability.

@since 3.15.0.

type TypeDefinitionParams added in v0.10.0

TypeDefinitionParams params of TypeDefinition request.

@since 3.15.0.

type TypeDefinitionRegistrationOptions added in v0.10.0

type TypeDefinitionRegistrationOptions struct {
	TextDocumentRegistrationOptions
	TypeDefinitionOptions
	StaticRegistrationOptions
}

TypeDefinitionRegistrationOptions registration option of TypeDefinition server capability.

@since 3.15.0.

type TypeDefinitionTextDocumentClientCapabilities added in v0.11.1

type TypeDefinitionTextDocumentClientCapabilities struct {
	// DynamicRegistration whether typeDefinition 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"`

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

TypeDefinitionTextDocumentClientCapabilities capabilities specific to the "textDocument/typeDefinition".

@since 3.6.0.

type URI added in v0.11.0

type URI = uri.URI

URI a tagging interface for normal non document URIs.

@since 3.16.0.

type UniquenessLevel added in v0.11.0

type UniquenessLevel string

UniquenessLevel is the Moniker uniqueness level to define scope of the moniker.

@since 3.16.0.

const (
	// UniquenessLevelDocument is the moniker is only unique inside a document.
	UniquenessLevelDocument UniquenessLevel = "document"

	// UniquenessLevelProject is the moniker is unique inside a project for which a dump got created.
	UniquenessLevelProject UniquenessLevel = "project"

	// UniquenessLevelGroup is the moniker is unique inside the group to which a project belongs.
	UniquenessLevelGroup UniquenessLevel = "group"

	// UniquenessLevelScheme is the moniker is unique inside the moniker scheme.
	UniquenessLevelScheme UniquenessLevel = "scheme"

	// UniquenessLevelGlobal is the moniker is globally unique.
	UniquenessLevelGlobal UniquenessLevel = "global"
)

list of UniquenessLevel.

type Unregistration

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

	// Method is the method / capability to unregister for.
	Method string `json:"method"`
}

Unregistration general parameters to unregister a capability.

type UnregistrationParams

type UnregistrationParams struct {
	Unregisterations []Unregistration `json:"unregisterations"`
}

UnregistrationParams params of Unregistration.

type VersionedTextDocumentIdentifier

type VersionedTextDocumentIdentifier struct {
	TextDocumentIdentifier

	// Version is 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 int32 `json:"version"`
}

VersionedTextDocumentIdentifier represents an identifier to denote a specific version of a text document.

This information usually flows from the client to the server.

type WatchKind

type WatchKind float64

WatchKind kind of FileSystemWatcher kind.

const (
	// WatchKindCreate interested in create events.
	WatchKindCreate WatchKind = 1

	// WatchKindChange interested in change events.
	WatchKindChange WatchKind = 2

	// WatchKindDelete interested in delete events.
	WatchKindDelete WatchKind = 4
)

func (WatchKind) String

func (k WatchKind) String() string

String implements fmt.Stringer.

type WillSaveTextDocumentParams

type WillSaveTextDocumentParams struct {
	// TextDocument is the document that will be saved.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

	// Reason is the 'TextDocumentSaveReason'.
	Reason TextDocumentSaveReason `json:"reason,omitempty"`
}

WillSaveTextDocumentParams is the parameters send in a will save text document notification.

type WindowClientCapabilities added in v0.10.0

type WindowClientCapabilities struct {
	// WorkDoneProgress 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"`

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

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

WindowClientCapabilities represents a WindowClientCapabilities specific client capabilities.

@since 3.15.0.

type WorkDoneProgressBegin added in v0.10.0

type WorkDoneProgressBegin struct {
	// Kind is the kind of WorkDoneProgressBegin.
	//
	// It must be WorkDoneProgressKindBegin.
	Kind WorkDoneProgressKind `json:"kind"`

	// Title 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"`

	// Cancellable 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"`

	// Message is 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"`

	// Percentage is 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.
	Percentage uint32 `json:"percentage,omitempty"`
}

WorkDoneProgressBegin is the to start progress reporting a "$/progress" notification.

@since 3.15.0.

type WorkDoneProgressCancelParams added in v0.10.0

type WorkDoneProgressCancelParams struct {
	// Token is the token to be used to report progress.
	Token ProgressToken `json:"token"`
}

WorkDoneProgressCreateParams params of WorkDoneProgressCancel request.

@since 3.15.0.

type WorkDoneProgressCreateParams added in v0.10.0

type WorkDoneProgressCreateParams struct {
	// Token is the token to be used to report progress.
	Token ProgressToken `json:"token"`
}

WorkDoneProgressCreateParams params of WorkDoneProgressCreate request.

@since 3.15.0.

type WorkDoneProgressEnd added in v0.10.0

type WorkDoneProgressEnd struct {
	// Kind is the kind of WorkDoneProgressEnd.
	//
	// It must be WorkDoneProgressKindEnd.
	Kind WorkDoneProgressKind `json:"kind"`

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

WorkDoneProgressEnd is the signaling the end of a progress reporting is done.

@since 3.15.0.

type WorkDoneProgressKind added in v0.10.0

type WorkDoneProgressKind string

WorkDoneProgressKind kind of WorkDoneProgress.

@since 3.15.0.

const (
	// WorkDoneProgressKindBegin kind of WorkDoneProgressBegin.
	WorkDoneProgressKindBegin WorkDoneProgressKind = "begin"

	// WorkDoneProgressKindReport kind of WorkDoneProgressReport.
	WorkDoneProgressKindReport WorkDoneProgressKind = "report"

	// WorkDoneProgressKindEnd kind of WorkDoneProgressEnd.
	WorkDoneProgressKindEnd WorkDoneProgressKind = "end"
)

list of WorkDoneProgressKind.

type WorkDoneProgressOptions added in v0.10.0

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

WorkDoneProgressOptions WorkDoneProgress options.

@since 3.15.0.

type WorkDoneProgressParams added in v0.10.0

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

WorkDoneProgressParams is a parameter property of report work done progress.

@since 3.15.0.

type WorkDoneProgressReport added in v0.10.0

type WorkDoneProgressReport struct {
	// Kind is the kind of WorkDoneProgressReport.
	//
	// It must be WorkDoneProgressKindReport.
	Kind WorkDoneProgressKind `json:"kind"`

	// Cancellable controls enablement state of a cancel button.
	//
	// Clients that don't support cancellation or don't support controlling the button's
	// enablement state are allowed to ignore the property.
	Cancellable bool `json:"cancellable,omitempty"`

	// Message is 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"`

	// Percentage is 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.
	Percentage uint32 `json:"percentage,omitempty"`
}

WorkDoneProgressReport is the reporting progress is done.

@since 3.15.0.

type WorkspaceClientCapabilities

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

	// WorkspaceEdit capabilities specific to `WorkspaceEdit`s.
	WorkspaceEdit *WorkspaceClientCapabilitiesWorkspaceEdit `json:"workspaceEdit,omitempty"`

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

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

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

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

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

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

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

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

	// FileOperations is the client has support for file requests/notifications.
	//
	// @since 3.16.0.
	FileOperations *WorkspaceClientCapabilitiesFileOperations `json:"fileOperations,omitempty"`
}

WorkspaceClientCapabilities Workspace specific client capabilities.

type WorkspaceClientCapabilitiesCodeLens deprecated added in v0.11.0

type WorkspaceClientCapabilitiesCodeLens = CodeLensWorkspaceClientCapabilities

WorkspaceClientCapabilitiesCodeLens alias of CodeLensWorkspaceClientCapabilities.

Deprecated: Use CodeLensWorkspaceClientCapabilities instead.

type WorkspaceClientCapabilitiesDidChangeConfiguration deprecated

type WorkspaceClientCapabilitiesDidChangeConfiguration = DidChangeConfigurationWorkspaceClientCapabilities

WorkspaceClientCapabilitiesDidChangeConfiguration alias of DidChangeConfigurationWorkspaceClientCapabilities.

Deprecated: Use DidChangeConfigurationWorkspaceClientCapabilities instead.

type WorkspaceClientCapabilitiesDidChangeWatchedFiles deprecated

type WorkspaceClientCapabilitiesDidChangeWatchedFiles = DidChangeWatchedFilesWorkspaceClientCapabilities

WorkspaceClientCapabilitiesDidChangeWatchedFiles alias of DidChangeWatchedFilesWorkspaceClientCapabilities.

Deprecated: Use DidChangeWatchedFilesWorkspaceClientCapabilities instead.

type WorkspaceClientCapabilitiesExecuteCommand deprecated

type WorkspaceClientCapabilitiesExecuteCommand = ExecuteCommandClientCapabilities

WorkspaceClientCapabilitiesExecuteCommand alias of ExecuteCommandClientCapabilities.

Deprecated: Use ExecuteCommandClientCapabilities instead.

type WorkspaceClientCapabilitiesFileOperations added in v0.11.0

type WorkspaceClientCapabilitiesFileOperations struct {
	// DynamicRegistration whether the client supports dynamic registration for file
	// requests/notifications.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`

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

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

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

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

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

	// WillDelete is the client has support for sending willDeleteFiles requests.
	WillDelete bool `json:"willDelete,omitempty"`
}

WorkspaceClientCapabilitiesFileOperations capabilities specific to the fileOperations.

@since 3.16.0.

type WorkspaceClientCapabilitiesSemanticTokens deprecated added in v0.11.0

type WorkspaceClientCapabilitiesSemanticTokens = SemanticTokensWorkspaceClientCapabilities

WorkspaceClientCapabilitiesSemanticTokens alias of SemanticTokensWorkspaceClientCapabilities.

Deprecated: Use SemanticTokensWorkspaceClientCapabilities instead.

type WorkspaceClientCapabilitiesSemanticTokensRequests deprecated added in v0.11.0

type WorkspaceClientCapabilitiesSemanticTokensRequests = SemanticTokensWorkspaceClientCapabilitiesRequests

WorkspaceClientCapabilitiesSemanticTokensRequests alias of SemanticTokensWorkspaceClientCapabilitiesRequests.

Deprecated: Use SemanticTokensWorkspaceClientCapabilitiesRequests instead.

type WorkspaceClientCapabilitiesSymbol deprecated

type WorkspaceClientCapabilitiesSymbol = WorkspaceSymbolClientCapabilities

WorkspaceClientCapabilitiesSymbol alias of WorkspaceSymbolClientCapabilities.

Deprecated: Use WorkspaceSymbolClientCapabilities instead.

type WorkspaceClientCapabilitiesSymbolKind deprecated

type WorkspaceClientCapabilitiesSymbolKind = SymbolKindCapabilities

WorkspaceClientCapabilitiesSymbolKind alias of SymbolKindCapabilities.

Deprecated: Use SymbolKindCapabilities instead.

type WorkspaceClientCapabilitiesWorkspaceEdit

type WorkspaceClientCapabilitiesWorkspaceEdit struct {
	// DocumentChanges is the client supports versioned document changes in `WorkspaceEdit`s
	DocumentChanges bool `json:"documentChanges,omitempty"`

	// FailureHandling is the failure handling strategy of a client if applying the workspace edit
	// fails.
	//
	// Mostly FailureHandlingKind.
	FailureHandling string `json:"failureHandling,omitempty"`

	// ResourceOperations is the resource operations the client supports. Clients should at least
	// support "create", "rename" and "delete" files and folders.
	ResourceOperations []string `json:"resourceOperations,omitempty"`

	// NormalizesLineEndings 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"`

	// ChangeAnnotationSupport whether the client in general supports change annotations on text edits,
	// create file, rename file and delete file changes.
	//
	// @since 3.16.0.
	ChangeAnnotationSupport *WorkspaceClientCapabilitiesWorkspaceEditChangeAnnotationSupport `json:"changeAnnotationSupport,omitempty"`
}

WorkspaceClientCapabilitiesWorkspaceEdit capabilities specific to "WorkspaceEdit"s.

type WorkspaceClientCapabilitiesWorkspaceEditChangeAnnotationSupport added in v0.11.0

type WorkspaceClientCapabilitiesWorkspaceEditChangeAnnotationSupport struct {
	// GroupsOnLabel whether the client groups edits with equal labels into tree nodes,
	// for instance all edits labeled with "Changes in Strings" would
	// be a tree node.
	GroupsOnLabel bool `json:"groupsOnLabel,omitempty"`
}

WorkspaceClientCapabilitiesWorkspaceEditChangeAnnotationSupport is the ChangeAnnotationSupport of WorkspaceClientCapabilitiesWorkspaceEdit.

@since 3.16.0.

type WorkspaceEdit

type WorkspaceEdit struct {
	// Changes holds changes to existing resources.
	Changes map[DocumentURI][]TextEdit `json:"changes,omitempty"`

	// DocumentChanges depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes
	// are either an array of `TextDocumentEdit`s to express changes to n different text documents
	// where each text document edit addresses a specific version of a text document. Or it can contain
	// above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
	//
	// Whether a client supports versioned document edits is expressed via
	// `workspace.workspaceEdit.documentChanges` client capability.
	//
	// If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then
	// only plain `TextEdit`s using the `changes` property are supported.
	DocumentChanges []TextDocumentEdit `json:"documentChanges,omitempty"`

	// ChangeAnnotations is 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 map[ChangeAnnotationIdentifier]ChangeAnnotation `json:"changeAnnotations,omitempty"`
}

WorkspaceEdit represent a changes to many resources managed in the workspace.

The edit should either provide changes or documentChanges. If the client can handle versioned document edits and if documentChanges are present, the latter are preferred over changes.

type WorkspaceFolder

type WorkspaceFolder struct {
	// URI is the associated URI for this workspace folder.
	URI string `json:"uri"`

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

WorkspaceFolder response of Workspace folders request.

type WorkspaceFolders

type WorkspaceFolders []WorkspaceFolder

WorkspaceFolders represents a slice of WorkspaceFolder.

type WorkspaceFoldersChangeEvent

type WorkspaceFoldersChangeEvent struct {
	// Added is the array of added workspace folders
	Added []WorkspaceFolder `json:"added"`

	// Removed is the array of the removed workspace folders
	Removed []WorkspaceFolder `json:"removed"`
}

WorkspaceFoldersChangeEvent is the workspace folder change event.

type WorkspaceSymbolClientCapabilities added in v0.11.1

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

	// SymbolKindCapabilities is the specific capabilities for the SymbolKindCapabilities in the "workspace/symbol" request.
	SymbolKind *SymbolKindCapabilities `json:"symbolKind,omitempty"`

	// TagSupport is the client supports tags on `SymbolInformation`.
	// Clients supporting tags have to handle unknown tags gracefully.
	//
	// @since 3.16.0
	TagSupport *TagSupportCapabilities `json:"tagSupport,omitempty"`
}

WorkspaceSymbolClientCapabilities capabilities specific to the `workspace/symbol` request.

WorkspaceSymbolClientCapabilities is the workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string.

type WorkspaceSymbolOptions added in v0.10.0

type WorkspaceSymbolOptions struct {
	WorkDoneProgressOptions
}

WorkspaceSymbolOptions registration option of WorkspaceSymbol server capability.

@since 3.15.0.

type WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	WorkDoneProgressParams
	PartialResultParams

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

WorkspaceSymbolParams is the parameters of a Workspace Symbol request.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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