Documentation
¶
Overview ¶
Package protocol mirrors the structs and methods for the Language Server protocol, as defined in https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md
Index ¶
- Constants
- type CancelRequestParams
- type CodeActionParams
- type CodeActionResult
- type CodeLens
- type CodeLensOptions
- type CodeLensParams
- type CodeLensResult
- type Command
- type CompletionItem
- type CompletionKind
- type CompletionOptions
- type CompletionParams
- type CompletionResult
- type DefinitionParams
- type DefinitionResult
- type Diagnostic
- type DiagnosticSeverity
- type DidChangeTextDocumentParams
- type DidCloseTextDocumentParams
- type DidOpenTextDocumentParams
- type DocumentFormattingParams
- type DocumentFormattingResult
- type DocumentLinkOptions
- type DocumentOnTypeFormattingOptions
- type DocumentURI
- type ExecuteCommandOptions
- type ExecuteCommandParams
- type HoverParams
- type HoverResult
- type InitializeParams
- type InitializeResult
- type Location
- type MarkedString
- type MarkupContent
- type MarkupKind
- type ParameterInformation
- type Position
- type PublishDiagnosticsParams
- type Range
- type ResolveCodeLensParams
- type ResolveCodeLensResult
- type SaveOptions
- type ServerCapabilities
- type SignatureHelpOptions
- type SignatureHelpParams
- type SignatureHelpResult
- type SignatureInformation
- type SymbolInformation
- type SymbolKind
- type TextDocumentContentChangeEvent
- type TextDocumentIdentifier
- type TextDocumentItem
- type TextDocumentPositionParams
- type TextDocumentSyncKind
- type TextDocumentSyncOptions
- type TextEdit
- type TraceOption
- type VersionedTextDocumentIdentifier
- type WillSaveReason
- type WillSaveTextDocumentParams
- type WillSaveWaitUntilTextDocumentResult
- type WorkspaceSymbolParams
- type WorkspaceSymbolResponse
Constants ¶
const ( // TraceOff indicates tracing is turned off. TraceOff TraceOption = "off" // TraceMessages indicates tracing should show messages. TraceMessages = "messages" // TraceVerbose indicates verbose tracing should be enabled. TraceVerbose = "verbose" )
const ( CompletionText CompletionKind = 1 CompletionMethod = 2 CompletionFunction = 3 CompletionConstructor = 4 CompletionField = 5 CompletionVariable = 6 CompletionClass = 7 CompletionInterface = 8 CompletionModule = 9 CompletionProperty = 10 CompletionUnit = 11 CompletionValue = 12 CompletionEnum = 13 CompletionKeyword = 14 CompletionSnippet = 15 CompletionColor = 16 CompletionFile = 17 CompletionReference = 18 CompletionFolder = 19 CompletionEnumMember = 20 CompletionConstant = 21 CompletionStruct = 22 CompletionEvent = 23 CompletionOperator = 24 CompletionTypeParameter = 25 )
const ( // DiagnosticError indicates an error-level severity. DiagnosticError DiagnosticSeverity = 1 // DiagnosticWarning indicates an warning-level severity. DiagnosticWarning = 2 // DiagnosticInformation indicates an informative-level severity. DiagnosticInformation = 3 // DiagnosticHint indicates a hint-level severity. DiagnosticHint = 4 )
const ( SymbolFile SymbolKind = 1 SymbolModule = 2 SymbolNamespace = 3 SymbolPackage = 4 SymbolClass = 5 SymbolMethod = 6 SymbolProperty = 7 SymbolField = 8 SymbolConstructor = 9 SymbolEnum = 10 SymbolInterface = 11 SymbolFunction = 12 SymbolVariable = 13 SymbolConstant = 14 SymbolString = 15 SymbolNumber = 16 SymbolBoolean = 17 SymbolArray = 18 SymbolObject = 19 SymbolKey = 20 SymbolNull = 21 SymbolEnumMember = 22 SymbolStruct = 23 SymbolEvent = 24 SymbolOperator = 25 SymbolTypeParameter = 26 )
const ( // WillSaveManual indicates the save is manually triggered, e.g. by the user pressing save, // by starting debugging, or by an API call. WillSaveManual WillSaveReason = 1 // AfterDelay indicates the save wass triggered automatically after a defined delay. AfterDelay = 2 // FocusOut indicates the save was triggered due to the edito losing focus. FocusOut = 3 )
const CancelRequestNotification = "$/cancelRequest"
CancelRequestNotification defines the name of the `cancel request` notification.
const CodeActionRequest = "textDocument/codeAction"
CodeActionRequest defines the name of the code actions lookup method.
const CodeLensRequest = "textDocument/codeLens"
CodeLensRequest defines the name of the code lens lookup method.
const CompletionRequest = "textDocument/completion"
CompletionRequest defines the name of the completion method.
const DefinitionRequest = "textDocument/definition"
DefinitionRequest defines the name of the definition method.
const DidChangeTextDocumentNotification = "textDocument/didChange"
DidChangeTextDocumentNotification defines the name of the text-document-changed notification.
const DidCloseTextDocumentNotification = "textDocument/didClose"
DidCloseTextDocumentNotification defines the name of the text-document-closed notification.
const DidOpenTextDocumentNotification = "textDocument/didOpen"
DidOpenTextDocumentNotification defines the name of the text-document-opened notification.
const DocumentFormattingRequest = "textDocument/formatting"
DocumentFormattingRequest defines the name of the formatting method.
const ExecuteCommandRequest = "workspace/executeCommand"
ExecuteCommandRequest defines the name of the execute command method.
const ExitNotification = "exit"
ExitNotification defines the name of the `exit` notification.
const HoverRequest = "textDocument/hover"
HoverRequest defines the name of the hover method.
const InitializeMethod = "initialize"
InitializeMethod defines the name of the `initialize` method.
const InitializedNotification = "initialized"
InitializedNotification defines the name of the `initialized` notification.
const PublicDiagonsticsNotification = "textDocument/publishDiagnostics"
PublicDiagonsticsNotification defines a notification from the *server* to the client about diagnostic information being available for a document.
const ResolveCodeLensRequest = "codeLens/resolve"
ResolveCodeLensRequest defines the name of the resolve-code lens method.
const SignatureHelpRequest = "textDocument/signatureHelp"
SignatureHelpRequest defines the name of the signature help method.
const WillSaveWaitUntilTextDocumentRequest = "textDocument/willSaveWaitUntil"
WillSaveWaitUntilTextDocumentRequest defines the will-save-wait-util request, which is sent before a document is saved.
const WorkspaceSymbolRequest = "workspace/symbol"
WorkspaceSymbolRequest defines the name of the workspace symbol method.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelRequestParams ¶ added in v0.3.2
CancelRequestParams are the parameters for the cancelation of a request.
type CodeActionParams ¶
type CodeActionParams struct {
// TextDocument is the document for which the code actions are being requested.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// Range is the range for which the code actions are being requested.
Range Range `json:"range"`
}
CodeActionParams are the parameters for the code actions.
type CodeActionResult ¶
type CodeActionResult []Command
CodeActionResult represents the result of a code actions lookup request.
type CodeLens ¶
type CodeLens struct {
// Range is the range in the document to which the CodeLens applies. Should not apply to multiple lines.
Range Range `json:"range"`
// Command is the command to display for this CodeLens. Should be omitted on the initial response and only
// added when the resolve is called.
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 represents a single CodeLens in a source document.
type CodeLensOptions ¶
type CodeLensOptions struct {
// ResolveProvider, if true, indicates that the server provides support
// to resolve additional information for a code lens operation.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
CodeLensOptions defines the options for the CodeLens feature offered by the server.
type CodeLensParams ¶
type CodeLensParams struct {
// TextDocument is the document for which CodeLens is being requested.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
CodeLensParams defines the parameters for the codelens request.
type CodeLensResult ¶
type CodeLensResult []CodeLens
CodeLensResult defines the result of the CodeLens lookup request.
type Command ¶
type Command struct {
// Title is the title of the command to display.
Title string `json:"title"`
// Command is the internal command function name that will be sent to the server
// when this command is to be executed.
Command string `json:"command"`
// Arguments are the arguments with which the command handler should be invoked.
Arguments []interface{} `json:"arguments"`
}
Command represents a single command sent from the server to the client, to which the client can respond asking the server to execute.
type CompletionItem ¶
type CompletionItem struct {
// Label is the label of this completion item. By default
// also the text that is inserted when selecting this completion.
Label string `json:"label"`
// Kind is the kind of this completion item.
Kind CompletionKind `json:"kind"`
// InsertText is a string to be inserted when this completion is selected.
// If empty, the label is used.
InsertText string `json:"insertText"`
// Detail is a human-readable string with additional information
// about this item, like type or symbol information.
Detail string `json:"detail"`
// Documentation is a human-readable string that represents a doc comment. Can be a string or MarkupContent.
Documentation interface{} `json:"documentation"`
}
CompletionItem represents a single completion.
type CompletionKind ¶
type CompletionKind int
CompletionKind represents the various kinds of completions.
type CompletionOptions ¶
type CompletionOptions struct {
// ResolveProvider, if true, indicates that the server provides support
// to resolve additional information for a completion item.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
// TriggerCharacters defines the set of characters used to trigger completion.
TriggerCharacters []string `json:"triggerCharacters"`
}
CompletionOptions defines the options for the completion feature offered by the server.
type CompletionParams ¶
type CompletionParams struct {
TextDocumentPositionParams
}
CompletionParams defines the parameters for the completion request.
type CompletionResult ¶
type CompletionResult []CompletionItem
CompletionResult defines the result for the completion request.
type DefinitionParams ¶
type DefinitionParams struct {
TextDocumentPositionParams
}
DefinitionParams defines the parameters for the definition request.
type DefinitionResult ¶
type DefinitionResult []Location
DefinitionResult defines the result for the definition request.
type Diagnostic ¶
type Diagnostic struct {
// Range defines the range in the document to which this information applies.
Range Range `json:"range"`
// Severity defines the severity of this information.
Severity DiagnosticSeverity `json:"severity"`
// Code defines an optional code for this information.
Code *string `json:"code"`
// Source defines a human-readable string describing the source of this
// diagnostic, e.g. 'typescript' or 'super lint'.
Source *string `json:"source"`
// Messages defines the human-readable message for this information.
Message string `json:"message"`
}
Diagnostic defines a single piece of diagnostic information about a document.
type DiagnosticSeverity ¶
type DiagnosticSeverity int
DiagnosticSeverity defines the various severity levels for diagnostic information.
type DidChangeTextDocumentParams ¶
type DidChangeTextDocumentParams struct {
// TextDocument is the document that was changed. The version number points
// to the version after all provided content changes have
// been applied.
TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
// ContentChanges defines the changes to the document.
ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"`
}
DidChangeTextDocumentParams is the parameters for the DidChangeTextDocumentNotification.
type DidCloseTextDocumentParams ¶
type DidCloseTextDocumentParams struct {
// TextDocument is the document that was closed
TextDocument TextDocumentItem `json:"textDocument"`
}
DidCloseTextDocumentParams is the parameters for the DidCloseTextDocumentNotification.
type DidOpenTextDocumentParams ¶
type DidOpenTextDocumentParams struct {
// TextDocument is the document that was opened.
TextDocument TextDocumentItem `json:"textDocument"`
}
DidOpenTextDocumentParams is the parameters for the DidOpenTextDocumentNotification.
type DocumentFormattingParams ¶
type DocumentFormattingParams struct {
// TextDocument identifies the document to format.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
DocumentFormattingParams defines the parameters for the formatting request.
type DocumentFormattingResult ¶
type DocumentFormattingResult []TextEdit
DocumentFormattingResult defines the result of a formatting request.
type DocumentLinkOptions ¶
type DocumentLinkOptions struct {
// ResolveProvider, if true, indicates that the server provides support
// to resolve additional information for a document link.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
DocumentLinkOptions defines the various options for the document link capability.
type DocumentOnTypeFormattingOptions ¶
type DocumentOnTypeFormattingOptions struct {
// FirstTriggerCharacter defines a character on which formatting should be triggered, like `}`.
FirstTriggerCharacter rune `json:"firstTriggerCharacter"`
// MoreTriggerCharacter defines additional trigger characters for formatting.
MoreTriggerCharacter *[]string `json:"moreTriggerCharacter,omitempty"`
}
DocumentOnTypeFormattingOptions defines the options for the on-type formatting feature offered by the server.
type DocumentURI ¶
type DocumentURI string
DocumentURI is a URI representing a document.
func (DocumentURI) String ¶
func (uri DocumentURI) String() string
type ExecuteCommandOptions ¶
type ExecuteCommandOptions struct {
// Commands defines the commands that can be executed on the server.
Commands []string `json:"commands,omitempty"`
}
ExecuteCommandOptions defines the options of the various commands that can be executed on the server.
type ExecuteCommandParams ¶
type ExecuteCommandParams struct {
// Command is the internal command function name of the command to be executed.
Command string `json:"command"`
// Arguments are the arguments for the command.
Arguments []interface{} `json:"arguments"`
}
ExecuteCommandParams defines the parameters of the execute command request.
type HoverParams ¶
type HoverParams struct {
TextDocumentPositionParams
}
HoverParams defines the parameters for the hover request.
type HoverResult ¶
type HoverResult struct {
// Contents is the contents to display for the hover.
Contents []interface{} `json:"contents,omitempty"`
// Range, if specified, indicates the highlighting range for the hover.
Range *Range `json:"range,omitempty"`
}
HoverResult defines the result for the hover request.
type InitializeParams ¶
type InitializeParams struct {
/**
* The process Id of the parent process that started
* the server. Is null if the process has not been started by another process.
* If the parent process is not alive then the server should exit (see exit notification) its process.
*/
ProcessID *int `json:"processId,omitempty"`
/**
* The rootUri of the workspace. Is null if no
* folder is open.
*/
RootURI DocumentURI `json:"rootUri,omitempty"`
/**
* The initial trace setting. If omitted trace is disabled ('off').
*/
Trace *TraceOption `json:"trace,omitempty"`
}
InitializeParams is the set of parameters sent by the client for the `initialize` call.
type InitializeResult ¶
type InitializeResult struct {
/**
* The capabilities the language server provides.
*/
Capabilities ServerCapabilities `json:"capabilities"`
}
InitializeResult is the server result for an `initialize`.
type Location ¶
type Location struct {
// URI is the URI of the document.
URI DocumentURI `json:"uri"`
// Range is the range in the document.
Range Range `json:"range"`
}
Location represents a location in a particular document.
type MarkedString ¶
type MarkedString struct {
// Language is the markdown language.
Language string `json:"language"`
// Value is the markdown value.
Value string `json:"value"`
}
MarkedString represents a markdown string.
MarkedString can be used to render human readable text. It is either a markdown string or a code-block that provides a language and a code snippet. The language identifier is sematically equal to the optional language identifier in fenced code blocks in GitHub issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
The pair of a language and a value is an equivalent to markdown: ```${language} ${value} ```
Note that markdown strings will be sanitized - that means html will be escaped.
type MarkupContent ¶ added in v0.3.2
type MarkupContent struct {
// Kind is the type of the Markup.
Kind MarkupKind `json:"kind"`
// Value is the value of the Markup.
Value string `json:"value"`
}
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
Please Note* that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.
type MarkupKind ¶ added in v0.3.2
type MarkupKind string
MarkupKind defines the various supported kinds of markup.
const ( // MarkupKindPlainText indicates that the MarkupContent is plain text. MarkupKindPlainText MarkupKind = "plaintext" // MarkupKindMarkdown indicates that the MarkupContent is markdown. MarkupKindMarkdown )
type ParameterInformation ¶
type ParameterInformation struct {
// Label is the label to display for this parameter. Typically the name and maybe the
// type of the function/operator.
Label string `json:"label"`
// Documentation is the documentation to display, if any. Can be a string or MarkupContent.
Documentation interface{} `json:"documentation"`
}
ParameterInformation represents information about a parameter of a function or operator.
type Position ¶
type Position struct {
// Line is the (0-indexed) line number of the position.
Line int `json:"line"`
// Column is the (0-indexed) column position on the line.
Column int `json:"character"`
}
Position represents a position in a document.
type PublishDiagnosticsParams ¶
type PublishDiagnosticsParams struct {
// URI is the URI of the document for which we are publishing diagnostics.
URI DocumentURI `json:"uri"`
// Diagnostics is the set of diagnostic information being published.
Diagnostics []Diagnostic `json:"diagnostics"`
}
PublishDiagnosticsParams defines the parameters for the PublicDiagonsticsNotification.
type Range ¶
type Range struct {
// Start is the starting position of the range, inclusive.
Start Position `json:"start"`
// End is the ending position of the range, exclusive.
End Position `json:"end"`
}
Range represents a range in a document.
type ResolveCodeLensParams ¶
type ResolveCodeLensParams CodeLens
ResolveCodeLensParams defines the parameters for the resolve code lens request.
type ResolveCodeLensResult ¶
type ResolveCodeLensResult CodeLens
ResolveCodeLensResult defines the result for the resolve code lens request.
type SaveOptions ¶
type SaveOptions struct {
// IncludeText indicates that the client is supposed to include the content on save.
IncludeText *bool `json:"includeText,omitempty"`
}
SaveOptions defines the options for when a document is saved in the client.
type ServerCapabilities ¶
type ServerCapabilities struct {
// TextDocumentSync defines how text documents are synced.
TextDocumentSync *TextDocumentSyncOptions `json:"textDocumentSync,omitempty"`
// HoverProvider indicates (if true), that hover support is provided by this server.
HoverProvider *bool `json:"hoverProvider,omitempty"`
// CompletionProvider indicates (if set), that this server provides completion with the
// given options.
CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`
// SignatureHelpProvider indicates (if set), that this server supports signature help
// with the given options.
SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`
// DefinitionProvider indicates (if true), that this server supports goto definitions.
DefinitionProvider *bool `json:"definitionProvider,omitempty"`
// ReferencesProvider indicates (if true), that this server provides find references support.
ReferencesProvider *bool `json:"referencesProvider,omitempty"`
// DocumentHighlightProvider indicates (if true), that this server provides document highlight support.
DocumentHighlightProvider *bool `json:"documentHighlightProvider,omitempty"`
// DocumentSymbolProvider indicates (if true), that this server provides document symbol support.
DocumentSymbolProvider *bool `json:"documentSymbolProvider,omitempty"`
// WorkspaceSymbolProvider indicates (if true), that this server provides workspace symbol support.
WorkspaceSymbolProvider *bool `json:"workspaceSymbolProvider,omitempty"`
// CodeActionProvider indicates (if true), that this server provides code actions.
CodeActionProvider *bool `json:"codeActionProvider,omitempty"`
// CodeLensProvider indicates (if set), that this server provides code lens with the given options.
CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"`
// DocumentFormattingProvider indicates (if true), that this server provides document formatting support.
DocumentFormattingProvider *bool `json:"documentFormattingProvider,omitempty"`
// DocumentRangeFormattingProvider indicates (if true), that this server provides document range formatting support.
DocumentRangeFormattingProvider *bool `json:"documentRangeFormattingProvider,omitempty"`
// DocumentOnTypeFormattingProvider indicates (if set), that this server provides document on-type formatting support with the given options.
DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"`
// RenameProvider indicates (if true), that this server provides rename support.
RenameProvider *bool `json:"renameProvider,omitempty"`
// DocumentLinkProvider indicates (if set), that this server provides document link support with the given options.
DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"`
// ExecuteCommandProvider indicates (if set), that this server provides execute command with the given options.
ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"`
// Experimental defines all experimental features supported by this server.
Experimental interface{} `json:"experimental,omitempty"`
}
ServerCapabilities defines the set of capabilities for the language server.
type SignatureHelpOptions ¶
type SignatureHelpOptions struct {
// TriggerCharacters defines the set of characters used to trigger signature help.
TriggerCharacters []string `json:"triggerCharacters"`
}
SignatureHelpOptions defines the options for the signature help feature offered by the server.
type SignatureHelpParams ¶
type SignatureHelpParams struct {
TextDocumentPositionParams
}
SignatureHelpParams defines the parameters for the signature help request.
type SignatureHelpResult ¶
type SignatureHelpResult struct {
// Signatures defines the signatures returned, if any.
Signatures []SignatureInformation `json:"signatures"`
// ActiveSignatureIndex defines which signature specified is active.
ActiveSignatureIndex int `json:"activeSignature"`
// ActiveParameterIndex is the index in the active signature of the active parameter.
ActiveParameterIndex int `json:"activeParameter"`
}
SignatureHelpResult defines the result for the signature help request.
type SignatureInformation ¶
type SignatureInformation struct {
// Label is the label to display for this signature. Typically the name and maybe the
// type of the function/operator.
Label string `json:"label"`
// Documentation is the documentation to display, if any. Can be a string or MarkupContent.
Documentation interface{} `json:"documentation"`
// Parameters are the parameters for this signature.
Parameters []ParameterInformation `json:"parameters"`
}
SignatureInformation is information representing the signature of a single function or operator that is being called.
type SymbolInformation ¶
type SymbolInformation struct {
// Name is the name of the symbol.
Name string `json:"name"`
// Kind is the kind of the symbol.
Kind SymbolKind `json:"kind"`
// Location is the location of the symbol in source.
Location Location `json:"location"`
// ContainerName is the name of the symbol containing this symbol, if any.
ContainerName *string `json:"containerName,omitempty"`
}
SymbolInformation represents a single symbol found in a document or workspace.
type SymbolKind ¶
type SymbolKind int
SymbolKind is an enumeration of the different kinds of symbols.
type TextDocumentContentChangeEvent ¶
type TextDocumentContentChangeEvent struct {
// Text is the contents of the changed document.
Text string `json:"text"`
}
TextDocumentContentChangeEvent defines a single change event on a document.
type TextDocumentIdentifier ¶
type TextDocumentIdentifier struct {
// URI is the text document's URI.
URI DocumentURI `json:"uri"`
}
TextDocumentIdentifier defines a reference to a document in the client.
type TextDocumentItem ¶
type TextDocumentItem struct {
// URI is the text document's URI.
URI DocumentURI `json:"uri"`
// LanguageID is the ID of the language of the document, as identified by the client.
LanguageID string `json:"languageId"`
// Version is a monotomically increasing version number for the document, which is increased
// everytime the contents of the document have changed.
Version int `json:"version"`
// Text is the contents of the opened document.
Text string `json:"text"`
}
TextDocumentItem is a single document in the client.
type TextDocumentPositionParams ¶
type TextDocumentPositionParams struct {
// TextDocument is the text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// Position is the position in the document.
Position Position `json:"position"`
}
TextDocumentPositionParams defines parameters representing a position in a text document.
type TextDocumentSyncKind ¶
type TextDocumentSyncKind int
TextDocumentSyncKind defines the various kinds of syncing.
const ( // NoneDocument indicates that documents should not be synced at all. NoneDocument TextDocumentSyncKind = 0 // FullDocument indicates that Documents are synced by always sending the full content // of the document. FullDocument TextDocumentSyncKind = 1 // IncrementalDocument indicates that Documents are synced by sending the full content on open. // After that only incremental updates to the document are sent. IncrementalDocument TextDocumentSyncKind = 2 )
type TextDocumentSyncOptions ¶
type TextDocumentSyncOptions struct {
// OpenClose, if set, indicates that open and close notifications are sent to the server.
OpenClose *bool `json:"openClose,omitempty"`
// Change defines the change notifications are sent to the server
Change *TextDocumentSyncKind `json:"change,omitempty"`
// WillSave defines whether `will save` definitions are sent to the server.
WillSave *bool `json:"willSave,omitempty"`
// WillSaveWaitUntil defines whether saves will wait for the server to respond.
WillSaveWaitUntil *bool `json:"willSaveWaitUntil,omitempty"`
// Save defines the various saving options.
Save *SaveOptions `json:"save,omitempty"`
}
TextDocumentSyncOptions defines the various options for syncing of documents between the client and server.
type TextEdit ¶
type TextEdit struct {
// Range defines the range to edit.
Range Range `json:"range"`
// NewText is the new text for the range.
NewText string `json:"newText"`
}
TextEdit defines a single edit to a document.
type TraceOption ¶
type TraceOption string
TraceOption is an enumeration of the various trace operations available.
type VersionedTextDocumentIdentifier ¶
type VersionedTextDocumentIdentifier struct {
TextDocumentIdentifier
// Version is a monotomically increasing version number for the document, which is increased
// everytime the contents of the document have changed.
Version int `json:"version"`
}
VersionedTextDocumentIdentifier defines a reference to a specific version of a document in the client.
type WillSaveReason ¶
type WillSaveReason int
WillSaveReason defines the various reasons the document will be saved.
type WillSaveTextDocumentParams ¶
type WillSaveTextDocumentParams struct {
// TextDocument identifies the document being saved.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// Reason is the reason this request was made.
Reason WillSaveReason `json:"reason"`
}
WillSaveTextDocumentParams defines the parameters of the will-save-wait-util request.
type WillSaveWaitUntilTextDocumentResult ¶
type WillSaveWaitUntilTextDocumentResult []TextEdit
WillSaveWaitUntilTextDocumentResult defines the result of the will-save-wait-util request.
type WorkspaceSymbolParams ¶
type WorkspaceSymbolParams struct {
// Query is the lookup query.
Query string `json:"query"`
}
WorkspaceSymbolParams defines the parameters for the workspace symbol request.
type WorkspaceSymbolResponse ¶
type WorkspaceSymbolResponse []SymbolInformation
WorkspaceSymbolResponse defines the response to the workspace symbol request.