Documentation
¶
Overview ¶
Package lsp contains Go types for the messages used in the Language Server Protocol.
See https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md for more information.
Index ¶
- Constants
- type ClientCapabilities
- type CodeActionContext
- type CodeActionParams
- type CodeLens
- type CodeLensOptions
- type CodeLensParams
- type Command
- type CompletionItem
- type CompletionItemKind
- type CompletionList
- type CompletionOptions
- type Diagnostic
- type DiagnosticSeverity
- type DidChangeConfigurationParams
- type DidChangeTextDocumentParams
- type DidChangeWatchedFilesParams
- type DidCloseTextDocumentParams
- type DidOpenTextDocumentParams
- type DidSaveTextDocumentParams
- type DocumentFormattingParams
- type DocumentHighlight
- type DocumentHighlightKind
- type DocumentOnTypeFormattingOptions
- type DocumentOnTypeFormattingParams
- type DocumentRangeFormattingParams
- type DocumentSymbolParams
- type FileChangeType
- type FileEvent
- type FormattingOptions
- type Hover
- type InitializeError
- type InitializeParams
- type InitializeResult
- type Location
- type LogMessageParams
- type MarkedString
- type MessageActionItem
- type MessageType
- type None
- type ParameterInformation
- type Position
- type PublishDiagnosticsParams
- type Range
- type ReferenceContext
- type ReferenceParams
- type RenameParams
- type ServerCapabilities
- type ShowMessageParams
- type ShowMessageRequestParams
- type SignatureHelp
- type SignatureHelpOptions
- type SignatureInformation
- type SymbolInformation
- type SymbolKind
- type TextDocumentContentChangeEvent
- type TextDocumentIdentifier
- type TextDocumentItem
- type TextDocumentPositionParams
- type TextDocumentSyncKind
- type TextEdit
- type VersionedTextDocumentIdentifier
- type WorkspaceEdit
- type WorkspaceSymbolParams
Constants ¶
View Source
const ( TDSKNone TextDocumentSyncKind = 0 TDSKFull = 1 TDSKIncremental = 2 )
View Source
const ( CIKText CompletionItemKind = 1 CIKMethod = 2 CIKFunction = 3 CIKConstructor = 4 CIKField = 5 CIKVariable = 6 CIKClass = 7 CIKInterface = 8 CIKModule = 9 CIKProperty = 10 CIKUnit = 11 CIKValue = 12 CIKEnum = 13 CIKKeyword = 14 CIKSnippet = 15 CIKColor = 16 CIKFile = 17 CIKReference = 18 )
View Source
const ( Text DocumentHighlightKind = 1 Read = 2 Write = 3 )
View Source
const ( MTError MessageType = 1 MTWarning = 2 Info = 3 Log = 4 )
View Source
const ( Created FileChangeType = 1 Changed = 2 Deleted = 3 )
View Source
const ( Error DiagnosticSeverity = 1 Warning = 2 Information = 3 Hint = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCapabilities ¶
type ClientCapabilities struct {
// XFilesProvider indicates the client provides support for
// workspace/xfiles. This is a Sourcegraph extension.
XFilesProvider bool `json:"xfilesProvider,omitempty"`
// XContentProvider indicates the client provides support for
// textDocument/xcontent. This is a Sourcegraph extension.
XContentProvider bool `json:"xcontentProvider,omitempty"`
}
type CodeActionContext ¶
type CodeActionContext struct {
Diagnostics []Diagnostic `json:"diagnostics"`
}
type CodeActionParams ¶
type CodeActionParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Range Range `json:"range"`
Context CodeActionContext `json:"context"`
}
type CodeLensOptions ¶
type CodeLensOptions struct {
ResolveProvider bool `json:"resolveProvider,omitempty"`
}
type CodeLensParams ¶
type CodeLensParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
type CompletionItem ¶
type CompletionItem struct {
Label string `json:"label"`
Kind int `json:"kind,omitempty"`
Detail string `json:"detail,omitempty"`
Documentation string `json:"documentation,omitempty"`
SortText string `json:"sortText,omitempty"`
FilterText string `json:"filterText,omitempty"`
InsertText string `json:"insertText,omitempty"`
TextEdit TextEdit `json:"textEdit,omitempty"`
Data interface{} `json:"data,omitempty"`
}
type CompletionItemKind ¶
type CompletionItemKind int
type CompletionList ¶
type CompletionList struct {
IsIncomplete bool `json:"isIncomplete"`
Items []CompletionItem `json:"items"`
}
type CompletionOptions ¶
type Diagnostic ¶
type Diagnostic struct {
/**
* The range at which the message applies.
*/
Range Range `json:"range"`
/**
* The diagnostic's severity. Can be omitted. If omitted it is up to the
* client to interpret diagnostics as error, warning, info or hint.
*/
Severity DiagnosticSeverity `json:"severity,omitempty"`
/**
* The diagnostic's code. Can be omitted.
*/
Code string `json:"code,omitempty"`
/**
* A human-readable string describing the source of this
* diagnostic, e.g. 'typescript' or 'super lint'.
*/
Source string `json:"source,omitempty"`
/**
* The diagnostic's message.
*/
Message string `json:"message"`
}
type DiagnosticSeverity ¶
type DiagnosticSeverity int
type DidChangeConfigurationParams ¶
type DidChangeConfigurationParams struct {
Settings interface{} `json:"settings"`
}
type DidChangeTextDocumentParams ¶
type DidChangeTextDocumentParams struct {
TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"`
}
type DidChangeWatchedFilesParams ¶
type DidChangeWatchedFilesParams struct {
Changes []FileEvent `json:"changes"`
}
type DidCloseTextDocumentParams ¶
type DidCloseTextDocumentParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
type DidOpenTextDocumentParams ¶
type DidOpenTextDocumentParams struct {
TextDocument TextDocumentItem `json:"textDocument"`
}
type DidSaveTextDocumentParams ¶
type DidSaveTextDocumentParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
type DocumentFormattingParams ¶
type DocumentFormattingParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Options FormattingOptions `json:"options"`
}
type DocumentHighlight ¶
type DocumentHighlightKind ¶
type DocumentHighlightKind int
type DocumentOnTypeFormattingParams ¶
type DocumentOnTypeFormattingParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Position Position `json:"position"`
Ch string `json:"ch"`
Options FormattingOptions `json:"formattingOptions"`
}
type DocumentRangeFormattingParams ¶
type DocumentRangeFormattingParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Range Range `json:"range"`
Options FormattingOptions `json:"options"`
}
type DocumentSymbolParams ¶
type DocumentSymbolParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
type FileChangeType ¶
type FileChangeType int
type FormattingOptions ¶
type Hover ¶
type Hover struct {
Contents []MarkedString `json:"contents,omitempty"`
Range Range `json:"range"`
}
type InitializeError ¶
type InitializeError struct {
Retry bool `json:"retry"`
}
type InitializeParams ¶
type InitializeParams struct {
ProcessID int `json:"processId,omitempty"`
RootPath string `json:"rootPath,omitempty"`
InitializationOptions interface{} `json:"initializationOptions,omitempty"`
Capabilities ClientCapabilities `json:"capabilities"`
}
type InitializeResult ¶
type InitializeResult struct {
Capabilities ServerCapabilities `json:"capabilities,omitempty"`
}
type LogMessageParams ¶
type MarkedString ¶
type MessageActionItem ¶
type MessageActionItem struct {
Title string `json:"title"`
}
type MessageType ¶
type MessageType int
type ParameterInformation ¶
type PublishDiagnosticsParams ¶
type PublishDiagnosticsParams struct {
URI string `json:"uri"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type ReferenceContext ¶
type ReferenceContext struct {
IncludeDeclaration bool `json:"IncludeDeclaration"`
}
type ReferenceParams ¶
type ReferenceParams struct {
TextDocumentPositionParams
Context ReferenceContext `json:"context"`
}
type RenameParams ¶
type RenameParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Position Position `json:"position"`
NewName string `json:"newName"`
}
type ServerCapabilities ¶
type ServerCapabilities struct {
TextDocumentSync int `json:"textDocumentSync,omitempty"`
HoverProvider bool `json:"hoverProvider,omitempty"`
CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`
SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`
DefinitionProvider bool `json:"definitionProvider,omitempty"`
ReferencesProvider bool `json:"referencesProvider,omitempty"`
DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"`
DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"`
WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"`
CodeActionProvider bool `json:"codeActionProvider,omitempty"`
CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"`
DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"`
DocumentRangeFormattingProvider bool `json:"documentRangeFormattingProvider,omitempty"`
DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"`
RenameProvider bool `json:"renameProvider,omitempty"`
}
type ShowMessageParams ¶
type ShowMessageRequestParams ¶
type ShowMessageRequestParams struct {
Type int `json:"type"`
Message string `json:"message"`
Actions []MessageActionItem `json:"actions"`
}
type SignatureHelp ¶
type SignatureHelp struct {
Signatures []SignatureInformation `json:"signatures"`
ActiveSignature int `json:"activeSignature,omitempty"`
ActiveParameter int `json:"activeParameter,omitempty"`
}
type SignatureHelpOptions ¶
type SignatureHelpOptions struct {
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
}
type SignatureInformation ¶
type SignatureInformation struct {
Label string `json:"label"`
Documentation string `json:"documentation,omitempty"`
Paramaters []ParameterInformation `json:"paramaters,omitempty"`
}
type SymbolInformation ¶
type SymbolInformation struct {
Name string `json:"name"`
Kind SymbolKind `json:"kind"`
Location Location `json:"location"`
ContainerName string `json:"containerName,omitempty"`
}
type SymbolKind ¶
type SymbolKind int
const ( SKFile SymbolKind = 1 SKModule SymbolKind = 2 SKNamespace SymbolKind = 3 SKPackage SymbolKind = 4 SKClass SymbolKind = 5 SKMethod SymbolKind = 6 SKProperty SymbolKind = 7 SKField SymbolKind = 8 SKConstructor SymbolKind = 9 SKEnum SymbolKind = 10 SKInterface SymbolKind = 11 SKFunction SymbolKind = 12 SKVariable SymbolKind = 13 SKConstant SymbolKind = 14 SKString SymbolKind = 15 SKNumber SymbolKind = 16 SKBoolean SymbolKind = 17 SKArray SymbolKind = 18 )
type TextDocumentIdentifier ¶
type TextDocumentIdentifier struct {
/**
* The text document's URI.
*/
URI string `json:"uri"`
}
type TextDocumentItem ¶
type TextDocumentItem struct {
/**
* The text document's URI.
*/
URI string `json:"uri"`
/**
* The text document's language identifier.
*/
LanguageID string `json:"languageId"`
/**
* The version number of this document (it will strictly increase after each
* change, including undo/redo).
*/
Version int `json:"version"`
/**
* The content of the opened text document.
*/
Text string `json:"text"`
}
type TextDocumentPositionParams ¶
type TextDocumentPositionParams struct {
/**
* The text document.
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
* The position inside the text document.
*/
Position Position `json:"position"`
}
type TextDocumentSyncKind ¶
type TextDocumentSyncKind int
type VersionedTextDocumentIdentifier ¶
type VersionedTextDocumentIdentifier struct {
TextDocumentIdentifier
/**
* The version number of this document.
*/
Version int `json:"version"`
}
type WorkspaceEdit ¶
type WorkspaceSymbolParams ¶
Click to show internal directories.
Click to hide internal directories.