protocol

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: BSD-3-Clause Imports: 12 Imported by: 90

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 (
	// 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"
)
View Source
const (
	// 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"

	// MethodCancelRequest method name of "$/cancelRequest".
	MethodCancelRequest = "$/cancelRequest"

	// 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"
)
View Source
const RequestCancelledCode jsonrpc2.Code = -32800

RequestCancelledCode cancel request code.

View Source
const Version = "3.15.0-next.6"

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

Variables

View Source
var EOL = []string{"\n", "\r\n", "\r"}

EOL denotes represents the character offset.

View Source
var ErrRequestCancelled = jsonrpc2.NewError(RequestCancelledCode, "cancelled JSON-RPC")

ErrRequestCancelled should be used when a request is canceled early.

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 ServerHandler added in v0.9.0

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

ServerHandler jsonrpc2.Handler of Language Server Prococol Server.

func ToURI

func ToURI(s string) uri.URI

ToURI returns the new DocumentURI from s.

func Uint64Ptr

func Uint64Ptr(i uint64) *uint64

Uint64Ptr converts i to uint64 pointer.

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

ApplyWorkspaceEditResponse response of Applies a WorkspaceEdit.

type CancelParams

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

CancelParams params of cancelRequest.

type Client added in v0.9.0

type Client interface {
	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)
	WorkspaceApplyEdit(ctx context.Context, params *ApplyWorkspaceEditParams) (result bool, err error)
	WorkspaceConfiguration(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"`

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

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

CodeAction capabilities specific to the `textDocument/codeAction`.

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

CodeActionOptions CodeAction options.

type CodeActionParams

type CodeActionParams struct {
	// 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 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 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 {
	// 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 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 {
	// 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 ColorProviderOptions

type ColorProviderOptions struct{}

ColorProviderOptions ColorProvider options.

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

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

	// 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.
	TextEdit *TextEdit `json:"textEdit,omitempty"`
}

CompletionItem item of CompletionList.

type CompletionItemKind

type CompletionItemKind int

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 (
	// TextCompletion text completion kind.
	TextCompletion CompletionItemKind = 1
	// MethodCompletion method completion kind.
	MethodCompletion CompletionItemKind = 2
	// FunctionCompletion function completion kind.
	FunctionCompletion CompletionItemKind = 3
	// ConstructorCompletion constructor completion kind.
	ConstructorCompletion CompletionItemKind = 4
	// FieldCompletion field completion kind.
	FieldCompletion CompletionItemKind = 5
	// VariableCompletion variable completion kind.
	VariableCompletion CompletionItemKind = 6
	// ClassCompletion class completion kind.
	ClassCompletion CompletionItemKind = 7
	// InterfaceCompletion interface completion kind.
	InterfaceCompletion CompletionItemKind = 8
	// ModuleCompletion module completion kind.
	ModuleCompletion CompletionItemKind = 9
	// PropertyCompletion property completion kind.
	PropertyCompletion CompletionItemKind = 10
	// UnitCompletion unit completion kind.
	UnitCompletion CompletionItemKind = 11
	// ValueCompletion value completion kind.
	ValueCompletion CompletionItemKind = 12
	// EnumCompletion enum completion kind.
	EnumCompletion CompletionItemKind = 13
	// KeywordCompletion keyword completion kind.
	KeywordCompletion CompletionItemKind = 14
	// SnippetCompletion snippet completion kind.
	SnippetCompletion CompletionItemKind = 15
	// ColorCompletion color completion kind.
	ColorCompletion CompletionItemKind = 16
	// FileCompletion file completion kind.
	FileCompletion CompletionItemKind = 17
	// ReferenceCompletion reference completion kind.
	ReferenceCompletion CompletionItemKind = 18
	// FolderCompletion folder completion kind.
	FolderCompletion CompletionItemKind = 19
	// EnumMemberCompletion enum member completion kind.
	EnumMemberCompletion CompletionItemKind = 20
	// ConstantCompletion constant completion kind.
	ConstantCompletion CompletionItemKind = 21
	// StructCompletion struct completion kind.
	StructCompletion CompletionItemKind = 22
	// EventCompletion event completion kind.
	EventCompletion CompletionItemKind = 23
	// OperatorCompletion operator completion kind.
	OperatorCompletion CompletionItemKind = 24
	// TypeParameterCompletion type parameter completion kind.
	TypeParameterCompletion CompletionItemKind = 25
)

func (CompletionItemKind) String

func (k CompletionItemKind) String() string

String implements fmt.Stringer.

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

	// 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 CompletionTriggerKind

type CompletionTriggerKind float64

CompletionTriggerKind how a completion was triggered.

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

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

	// TriggerForIncompleteCompletions completion was re-triggered as the current completion list is incomplete.
	TriggerForIncompleteCompletions 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 uri.URI `json:"uri"`

	// Options additional options.
	Options *CreateFileOptions `json:"options,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 DeleteFile

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

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

	// Options delete options.
	Options *DeleteFileOptions `json:"options,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 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"`

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

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

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 (
	// SeverityError reports an error.
	SeverityError DiagnosticSeverity = 1

	// SeverityWarning reports a warning.
	SeverityWarning DiagnosticSeverity = 2

	// SeverityInformation reports an information.
	SeverityInformation DiagnosticSeverity = 3

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

func (DiagnosticSeverity) String

func (d DiagnosticSeverity) 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 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"`
}

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 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 DocumentColorParams

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

DocumentColorParams params of Document Color Request.

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 DocumentFormattingParams

type DocumentFormattingParams struct {
	// 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 DocumentHighlightKind

type DocumentHighlightKind int

DocumentHighlightKind a document highlight kind.

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

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

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

func (DocumentHighlightKind) String

func (k DocumentHighlightKind) String() string

String implements fmt.Stringer.

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 uri.URI `json:"target,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 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 {
	// 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 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 DocumentRangeFormattingParams

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

	// 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 DocumentSymbolParams

type DocumentSymbolParams struct {
	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

DocumentSymbolParams params of Document Symbols Request.

type DocumentURI

type DocumentURI string

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 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 {
	// 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 (
	// Abort applying the workspace change is simply aborted if one of the changes provided
	// fails. All operations executed before the failing operation stay executed.
	Abort FailureHandlingKind = "abort"

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

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

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

type FileChangeType

type FileChangeType float64

FileChangeType is the file event type.

const (
	// Created is the file got created.
	Created FileChangeType = 1
	// Changed is the file got changed.
	Changed FileChangeType = 2
	// Deleted is the file got deleted.
	Deleted FileChangeType = 3
)

func (FileChangeType) String

func (t FileChangeType) String() string

String implements fmt.Stringer.

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 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 float64 `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 float64 `json:"startCharacter,omitempty"`

	// EndLine is the zero-based line number where the folded range ends.
	EndLine float64 `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 float64 `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 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 FoldingRangeParams

type FoldingRangeParams struct {
	// TextDocument is the text document.
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

FoldingRangeParams params of Folding Range Request.

type FoldingRangeProviderOptions

type FoldingRangeProviderOptions struct{}

FoldingRangeProviderOptions FoldingRangeProvider options.

type FormattingOptions

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

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

FormattingOptions value-object describing what options formatting should use.

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 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 {
	// 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 float64 `json:"processId"`

	// 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.
	RootURI uri.URI `json:"rootUri"`

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

InitializeResult result of ClientCapabilities.

type InitializedParams

type InitializedParams struct{}

InitializedParams params of Initialized Notification.

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 (
	// TextFormatPlainText is the primary text to be inserted is treated as a plain string.
	TextFormatPlainText InsertTextFormat = 1

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

func (InsertTextFormat) String

func (tf InsertTextFormat) String() string

String implements fmt.Stringer.

type LanguageIdentifier

type LanguageIdentifier string

LanguageIdentifier represent a text document's language identifier.

const (
	// 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"

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

	// 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 Sass Language.
	ScssLanguage LanguageIdentifier = "scss"

	// SassLanguage Sass Language.
	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"

	// 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 Location

type Location struct {
	URI   uri.URI `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 uri.URI `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 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: ```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 (
	// Error an error message.
	Error MessageType = 1
	// Warning a warning message.
	Warning MessageType = 2
	// Info an information message.
	Info MessageType = 3
	// Log a log message.
	Log 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 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"`

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

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

type Position

type Position struct {
	// Line position in a document (zero-based).
	Line float64 `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.
	Character float64 `json:"character"`
}

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

A position is between two characters like an "insert" cursor in a editor.

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 float64 `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 ReferenceParams

type ReferenceParams struct {
	TextDocumentPositionParams

	Context ReferenceContext `json:"context"`
}

ReferenceParams params of Find References Request.

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 RenameFile

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

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

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

	// Options rename options.
	Options *RenameFileOptions `json:"options,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 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 {
	// TextDocument is the document to rename.
	TextDocument TextDocumentIdentifier `json:"textDocument"`

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

	// 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 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)
	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 *TextDocumentPositionParams) (result []Location, err error)
	Definition(ctx context.Context, params *TextDocumentPositionParams) (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 *TextDocumentPositionParams) (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 []DocumentSymbol, 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 *TextDocumentPositionParams) (result *Hover, err error)
	Implementation(ctx context.Context, params *TextDocumentPositionParams) (result []Location, err error)
	OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) (result []TextEdit, err error)
	PrepareRename(ctx context.Context, params *TextDocumentPositionParams) (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 *TextDocumentPositionParams) (result *SignatureHelp, err error)
	Symbols(ctx context.Context, params *WorkspaceSymbolParams) (result []SymbolInformation, err error)
	TypeDefinition(ctx context.Context, params *TextDocumentPositionParams) (result []Location, err error)
	WillSave(ctx context.Context, params *WillSaveTextDocumentParams) (err error)
	WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) (result []TextEdit, err error)
	Request(ctx context.Context, method string, params interface{}) (interface{}, 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"`

	// HoverProvider is the server provides hover support.
	HoverProvider bool `json:"hoverProvider,omitempty"`

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

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

	// DefinitionProvider is the server provides goto definition support.
	DefinitionProvider bool `json:"definitionProvider,omitempty"`

	// TypeDefinitionProvider is the server provides Goto Type Definition support.
	//
	// Since 3.6.0
	TypeDefinitionProvider interface{} `json:"typeDefinitionProvider,omitempty"`

	// ImplementationProvider is the server provides Goto Implementation support.
	//
	// Since 3.6.0
	ImplementationProvider interface{} `json:"implementationProvider,omitempty"`

	// ReferencesProvider is the server provides find references support.
	ReferencesProvider bool `json:"referencesProvider,omitempty"`

	// DocumentHighlightProvider is the server provides document highlight support.
	DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"`

	// DocumentSymbolProvider is the server provides document symbol support.
	DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"`

	// WorkspaceSymbolProvider is the server provides workspace symbol support.
	WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"`

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

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

	// DocumentFormattingProvider is the server provides document formatting.
	DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"`

	// DocumentRangeFormattingProvider is the server provides document range formatting.
	DocumentRangeFormattingProvider bool `json:"documentRangeFormattingProvider,omitempty"`

	// 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"` // boolean | RenameOptions

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

	// FoldingRangeProvider is the server provides folding provider support.
	//
	// Since 3.10.0
	FoldingRangeProvider interface{} `json:"foldingRangeProvider,omitempty"`

	// SelectionRangeProvider is the server provides selection range support.
	SelectionRangeProvider interface{} `json:"selectionRangeProvider,omitempty"` // boolean || (TextDocumentRegistrationOptions || StaticRegistrationOptions || SelectionRangeProviderOptions)

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

	// Workspace specific server capabilities
	Workspace *ServerCapabilitiesWorkspace `json:"workspace,omitempty"`

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

ServerCapabilities server capabilities.

type ServerCapabilitiesWorkspace

type ServerCapabilitiesWorkspace struct {
	WorkspaceFolders *ServerCapabilitiesWorkspaceFolders `json:"workspaceFolders,omitempty"`
}

ServerCapabilitiesWorkspace specific server capabilities.

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 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 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 float64 `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 float64 `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 SignatureHelpOptions

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

SignatureHelpOptions SignatureHelp options.

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 SignatureInformation

type SignatureInformation 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 client capabilities specific to parameter information.
	ParameterInformation *ParameterInformation `json:"parameterInformation,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 float64 `json:"kind"`

	// 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 (
	// FileSymbol symbol of file.
	FileSymbol SymbolKind = 1
	// ModuleSymbol symbol of module.
	ModuleSymbol SymbolKind = 2
	// NamespaceSymbol symbol of namespace.
	NamespaceSymbol SymbolKind = 3
	// PackageSymbol symbol of package.
	PackageSymbol SymbolKind = 4
	// ClassSymbol symbol of class.
	ClassSymbol SymbolKind = 5
	// MethodSymbol symbol of method.
	MethodSymbol SymbolKind = 6
	// PropertySymbol symbol of property.
	PropertySymbol SymbolKind = 7
	// FieldSymbol symbol of field.
	FieldSymbol SymbolKind = 8
	// ConstructorSymbol symbol of constructor.
	ConstructorSymbol SymbolKind = 9
	// EnumSymbol symbol of enum.
	EnumSymbol SymbolKind = 10
	// InterfaceSymbol symbol of interface.
	InterfaceSymbol SymbolKind = 11
	// FunctionSymbol symbol of function.
	FunctionSymbol SymbolKind = 12
	// VariableSymbol symbol of variable.
	VariableSymbol SymbolKind = 13
	// ConstantSymbol symbol of constant.
	ConstantSymbol SymbolKind = 14
	// StringSymbol symbol of string.
	StringSymbol SymbolKind = 15
	// NumberSymbol symbol of number.
	NumberSymbol SymbolKind = 16
	// BooleanSymbol symbol of boolean.
	BooleanSymbol SymbolKind = 17
	// ArraySymbol symbol of array.
	ArraySymbol SymbolKind = 18
	// ObjectSymbol symbol of object.
	ObjectSymbol SymbolKind = 19
	// KeySymbol symbol of key.
	KeySymbol SymbolKind = 20
	// NullSymbol symbol of null.
	NullSymbol SymbolKind = 21
	// EnumMemberSymbol symbol of enum member.
	EnumMemberSymbol SymbolKind = 22
	// StructSymbol symbol of struct.
	StructSymbol SymbolKind = 23
	// EventSymbol symbol of event.
	EventSymbol SymbolKind = 24
	// OperatorSymbol symbol of operator.
	OperatorSymbol SymbolKind = 25
	// TypeParameterSymbol symbol of type parameter.
	TypeParameterSymbol SymbolKind = 26
)

func (SymbolKind) String

func (k SymbolKind) String() string

String implements fmt.Stringer.

type TextDocument

type TextDocument struct {
	// URI is the associated URI for this document. Most documents have the __file__-scheme, indicating that they
	// represent files on disk. However, some documents may have other schemes indicating that they are not
	// available on disk.
	//
	// @readonly
	URI uri.URI `json:"uri"`

	// LanguageID is the identifier of the language associated with this document.
	//
	// @readonly
	LanguageID string `json:"languageId"`

	// Version is the version number of this document (it will increase after each
	// change, including undo/redo).
	//
	// @readonly
	Version float64 `json:"version"`

	// LineCount is the number of lines in this document.
	//
	// @readonly
	LineCount float64 `json:"lineCount"`
}

TextDocument is a simple text document. Not to be implemented.

type TextDocumentChangeEvent

type TextDocumentChangeEvent struct {
	// Document is the document that has changed.
	Document TextDocument `json:"document"`
}

TextDocumentChangeEvent Event to signal changes to a simple text document.

type TextDocumentChangeRegistrationOptions

type TextDocumentChangeRegistrationOptions struct {
	TextDocumentRegistrationOptions

	// SyncKind how documents are synced to the server. See TextDocumentSyncKind.Full
	// and TextDocumentSyncKind.Incremental.
	SyncKind float64 `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 *TextDocumentClientCapabilitiesSynchronization `json:"synchronization,omitempty"`

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

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

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

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

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

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

	// Formatting capabilities specific to the `textDocument/formatting`
	Formatting *TextDocumentClientCapabilitiesFormatting `json:"formatting,omitempty"`

	// RangeFormatting capabilities specific to the `textDocument/rangeFormatting`
	RangeFormatting *TextDocumentClientCapabilitiesRangeFormatting `json:"rangeFormatting,omitempty"`

	// OnTypeFormatting Capabilities specific to the `textDocument/onTypeFormatting`
	OnTypeFormatting *TextDocumentClientCapabilitiesOnTypeFormatting `json:"onTypeFormatting,omitempty"`

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

	// Definition capabilities specific to the `textDocument/definition`.
	//
	// Since 3.14.0
	Definition *TextDocumentClientCapabilitiesDefinition `json:"definition,omitempty"`

	// TypeDefinition capabilities specific to the `textDocument/typeDefinition`
	//
	// Since 3.6.0
	TypeDefinition *TextDocumentClientCapabilitiesTypeDefinition `json:"typeDefinition,omitempty"`

	// Implementation capabilities specific to the `textDocument/implementation`.
	//
	// Since 3.6.0
	Implementation *TextDocumentClientCapabilitiesImplementation `json:"implementation,omitempty"`

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

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

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

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

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

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

	// FoldingRange capabilities specific to `textDocument/foldingRange` requests.
	//
	// Since 3.10.0
	FoldingRange *TextDocumentClientCapabilitiesFoldingRange `json:"foldingRange,omitempty"`

	// SelectionRange capabilities specific to `textDocument/selectionRange` requests.
	SelectionRange *TextDocumentClientCapabilitiesSelectionRange `json:"selectionRange,omitempty"`
}

TextDocumentClientCapabilities Text document specific client capabilities.

type TextDocumentClientCapabilitiesCodeAction

type TextDocumentClientCapabilitiesCodeAction 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 *TextDocumentClientCapabilitiesCodeActionLiteralSupport `json:"codeActionLiteralSupport,omitempty"`
}

TextDocumentClientCapabilitiesCodeAction capabilities specific to the `textDocument/codeAction`.

type TextDocumentClientCapabilitiesCodeActionKind

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

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

type TextDocumentClientCapabilitiesCodeActionLiteralSupport

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

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

type TextDocumentClientCapabilitiesCodeLens

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

TextDocumentClientCapabilitiesCodeLens capabilities specific to the `textDocument/codeLens`.

type TextDocumentClientCapabilitiesColorProvider

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

TextDocumentClientCapabilitiesColorProvider capabilities specific to the `textDocument/documentColor` and the `textDocument/colorPresentation` request.

Since 3.6.0.

type TextDocumentClientCapabilitiesCompletion

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

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

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

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

TextDocumentClientCapabilitiesCompletion Capabilities specific to the `textDocument/completion`.

type TextDocumentClientCapabilitiesCompletionItem

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

TextDocumentClientCapabilitiesCompletionItem is the client supports the following `CompletionItem` specific capabilities.

type TextDocumentClientCapabilitiesCompletionItemKind

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

TextDocumentClientCapabilitiesCompletionItemKind specific capabilities for the `CompletionItemKind ` in the `textDocument/completion` request.

type TextDocumentClientCapabilitiesDeclaration

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

TextDocumentClientCapabilitiesDeclaration capabilities specific to the `textDocument/declaration`.

type TextDocumentClientCapabilitiesDefinition

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

TextDocumentClientCapabilitiesDefinition capabilities specific to the `textDocument/definition`.

Since 3.14.0.

type TextDocumentClientCapabilitiesDocumentHighlight

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

TextDocumentClientCapabilitiesDocumentHighlight capabilities specific to the `textDocument/documentHighlight`.

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

TextDocumentClientCapabilitiesDocumentLink capabilities specific to the `textDocument/documentLink`.

type TextDocumentClientCapabilitiesDocumentSymbol

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

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

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

TextDocumentClientCapabilitiesDocumentSymbol capabilities specific to the `textDocument/documentSymbol`.

type TextDocumentClientCapabilitiesFoldingRange

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

TextDocumentClientCapabilitiesFoldingRange capabilities specific to `textDocument/foldingRange` requests.

Since 3.10.0.

type TextDocumentClientCapabilitiesFormatting

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

TextDocumentClientCapabilitiesFormatting capabilities specific to the `textDocument/formatting`.

type TextDocumentClientCapabilitiesHover

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

TextDocumentClientCapabilitiesHover capabilities specific to the `textDocument/hover`.

type TextDocumentClientCapabilitiesImplementation

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

TextDocumentClientCapabilitiesImplementation capabilities specific to the `textDocument/implementation`.

Since 3.6.0.

type TextDocumentClientCapabilitiesOnTypeFormatting

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

TextDocumentClientCapabilitiesOnTypeFormatting Capabilities specific to the `textDocument/onTypeFormatting`.

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

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

	// TagSupport client supports the tag property to provide meta data about a diagnostic.
	TagSupport bool `json:"tagSupport,omitempty"`
}

TextDocumentClientCapabilitiesPublishDiagnostics capabilities specific to `textDocument/publishDiagnostics`.

type TextDocumentClientCapabilitiesRangeFormatting

type TextDocumentClientCapabilitiesRangeFormatting struct {
	// DynamicRegistration whether range formatting supports dynamic registration.
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

TextDocumentClientCapabilitiesRangeFormatting capabilities specific to the `textDocument/rangeFormatting`.

type TextDocumentClientCapabilitiesReferences

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

TextDocumentClientCapabilitiesReferences capabilities specific to the `textDocument/references`.

type TextDocumentClientCapabilitiesRename

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

TextDocumentClientCapabilitiesRename capabilities specific to the `textDocument/rename`.

type TextDocumentClientCapabilitiesSelectionRange

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

TextDocumentClientCapabilitiesSelectionRange capabilities specific to `textDocument/selectionRange` requests.

type TextDocumentClientCapabilitiesSignatureHelp

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

TextDocumentClientCapabilitiesSignatureHelp capabilities specific to the `textDocument/signatureHelp`.

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

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

type TextDocumentClientCapabilitiesSynchronization

type TextDocumentClientCapabilitiesSynchronization struct {
	// DidSave is the client supports did save notifications.
	DidSave bool `json:"didSave,omitempty"`

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

TextDocumentClientCapabilitiesSynchronization defines which synchronization capabilities the client supports.

type TextDocumentClientCapabilitiesTypeDefinition

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

TextDocumentClientCapabilitiesTypeDefinition capabilities specific to the `textDocument/typeDefinition`

Since 3.6.0.

type TextDocumentContentChangeEvent

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

	// RangeLength is the length of the range that got replaced.
	RangeLength float64 `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 VersionedTextDocumentIdentifier `json:"textDocument"`

	// Edits is the edits to be applied.
	Edits []TextEdit `json:"edits"`
}

TextDocumentEdit describes textual changes on a single text document.

The text document is referred to as a VersionedTextDocumentIdentifier to allow clients to check the text document version before an edit is applied. A 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 uri.URI `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 uri.URI `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 float64 `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.

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 (
	// Manual is the manually triggered, e.g. by the user pressing save, by starting debugging,
	// or by an API call.
	Manual TextDocumentSaveReason = 1

	// AfterDelay is the automatic after a delay.
	AfterDelay TextDocumentSaveReason = 2

	// FocusOut when the editor lost focus.
	FocusOut 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 TextDocumentSyncKind

type TextDocumentSyncKind float64

TextDocumentSyncKind defines how the host (editor) should sync document changes to the language server.

const (
	// None documents should not be synced at all.
	None TextDocumentSyncKind = 0

	// Full documents are synced by always sending the full content
	// of the document.
	Full TextDocumentSyncKind = 1

	// Incremental documents are synced by sending the full content on open.
	// After that only incremental updates to the document are
	// send.
	Incremental 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 float64 `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 TraceMode

type TraceMode string

TraceMode represents a InitializeParams Trace mode.

const (
	// TraceOff disable tracing.
	TraceOff TraceMode = "off"

	// TraceMessage normal tracing mode.
	TraceMessage TraceMode = "message"

	// TraceVerbose verbose tracing mode.
	TraceVerbose TraceMode = "verbose"
)

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.
	//
	// If a 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
	// truth (as speced 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 *uint64 `json:"version"`
}

VersionedTextDocumentIdentifier represents an identifier to denote a specific version of a text document.

type WatchKind

type WatchKind float64

WatchKind kind of FileSystemWatcher kind.

const (
	// CreateWatch interested in create events.
	CreateWatch WatchKind = 1

	// ChangeWatch interested in change events.
	ChangeWatch WatchKind = 2

	// DeleteWatch interested in delete events.
	DeleteWatch 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 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 *WorkspaceClientCapabilitiesDidChangeConfiguration `json:"didChangeConfiguration,omitempty"`

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

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

	// ExecuteCommand capabilities specific to the `workspace/executeCommand` request.
	ExecuteCommand *WorkspaceClientCapabilitiesExecuteCommand `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"`
}

WorkspaceClientCapabilities Workspace specific client capabilities.

type WorkspaceClientCapabilitiesDidChangeConfiguration

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

WorkspaceClientCapabilitiesDidChangeConfiguration capabilities specific to the `workspace/didChangeConfiguration` notification.

type WorkspaceClientCapabilitiesDidChangeWatchedFiles

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

WorkspaceClientCapabilitiesDidChangeWatchedFiles capabilities specific to the `workspace/didChangeWatchedFiles` notification.

type WorkspaceClientCapabilitiesExecuteCommand

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

WorkspaceClientCapabilitiesExecuteCommand capabilities specific to the `workspace/executeCommand` request.

type WorkspaceClientCapabilitiesSymbol

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

	// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
	SymbolKind *WorkspaceClientCapabilitiesSymbolKind `json:"symbolKind,omitempty"`
}

WorkspaceClientCapabilitiesSymbol capabilities specific to the `workspace/symbol` request.

type WorkspaceClientCapabilitiesSymbolKind

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

WorkspaceClientCapabilitiesSymbolKind specific capabilities for the `SymbolKind` in the `workspace/symbol` request.

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.
	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"`
}

WorkspaceClientCapabilitiesWorkspaceEdit capabilities specific to `WorkspaceEdit`s.

type WorkspaceEdit

type WorkspaceEdit struct {
	// Changes holds changes to existing resources.
	Changes map[uri.URI][]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"`
}

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 WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	// Query a non-empty query string
	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