Documentation
¶
Overview ¶
Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.package langserver Source: https://github.com/sourcegraph/go-lsp/blob/219e11d77f5d414b4fe5ba7e532b277fca34c1b4/jsonrpc2.go
Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.package langserver Source: https://github.com/sourcegraph/go-lsp/blob/219e11d77f5d414b4fe5ba7e532b277fca34c1b4/service.go
Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.package langserver Source: https://github.com/sourcegraph/go-lsp/blob/219e11d77f5d414b4fe5ba7e532b277fca34c1b4/structures.go
Index ¶
- Constants
- type CancelParams
- type ClientCapabilities
- type ClientInfo
- type CodeActionContext
- type CodeActionKind
- type CodeActionParams
- type CodeLens
- type CodeLensOptions
- type CodeLensParams
- type Command
- type CompletionContext
- type CompletionItem
- type CompletionItemKind
- type CompletionList
- type CompletionOptions
- type CompletionParams
- type CompletionTriggerKind
- type ConfigurationItem
- type ConfigurationParams
- type ConfigurationResult
- 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 DocumentURI
- type DocumentationFormat
- type ExecuteCommandOptions
- type ExecuteCommandParams
- type ExecuteQueryResult
- type FieldSchema
- type FileChangeType
- type FileEvent
- type FormattingOptions
- type Hover
- type ID
- type InitializeError
- type InitializeParams
- type InitializeResult
- type InsertTextFormat
- type JobHistory
- type ListDatasetsResult
- type ListJobHistoryResult
- type ListProjectsResult
- type ListTablesResult
- type Location
- type LogMessageParams
- type MarkedString
- type MarkupContent
- type MarkupKind
- type MessageActionItem
- type MessageType
- type None
- type ParameterInformation
- type Position
- type ProgressParams
- type ProgressToken
- type ProjectInfo
- type PublishDiagnosticsParams
- type PublishVirtualTextDocumentParams
- type QueryResult
- type Range
- type ReferenceContext
- type ReferenceParams
- type RenameOptions
- type RenameParams
- type ResourceOperation
- type SaveOptions
- type SaveResultResult
- type SearchTablesResult
- type SemanticHighlightingInformation
- type SemanticHighlightingOptions
- type SemanticHighlightingParams
- type SemanticHighlightingToken
- type SemanticHighlightingTokens
- type ServerCapabilities
- type ShowMessageParams
- type ShowMessageRequestParams
- type SignatureHelp
- type SignatureHelpOptions
- type SignatureInformation
- type SymbolInformation
- type SymbolKind
- type TableSearchResult
- type TextDocumentClientCapabilities
- type TextDocumentContentChangeEvent
- type TextDocumentIdentifier
- type TextDocumentItem
- type TextDocumentPositionParams
- type TextDocumentPrepareRenameParams
- type TextDocumentSyncKind
- type TextDocumentSyncOptions
- type TextDocumentSyncOptionsOrKind
- type TextEdit
- type Trace
- type VersionedTextDocumentIdentifier
- type VirtualTextDocument
- type VirtualTextDocumentInfo
- type VirtualTextDocumentKind
- type VirtualTextDocumentParams
- type WindowClientCapabilities
- type WorkDoneProgressBegin
- type WorkDoneProgressEnd
- type WorkDoneProgressParams
- type WorkDoneProgressReport
- type WorkspaceClientCapabilities
- type WorkspaceEdit
- type WorkspaceSymbolParams
Constants ¶
const ( Text DocumentHighlightKind = 1 Read = 2 Write = 3 )
const ( Created FileChangeType = 1 Changed = 2 Deleted = 3 )
const ( Error DiagnosticSeverity = 1 Warning = 2 Information = 3 Hint = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelParams ¶
type CancelParams struct {
ID ID `json:"id"`
}
type ClientCapabilities ¶
type ClientCapabilities struct {
Workspace WorkspaceClientCapabilities `json:"workspace,omitempty"`
TextDocument TextDocumentClientCapabilities `json:"textDocument,omitempty"`
Window WindowClientCapabilities `json:"window,omitempty"`
Experimental any `json:"experimental,omitempty"`
// 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"`
// XCacheProvider indicates the client provides support for cache/get
// and cache/set.
XCacheProvider bool `json:"xcacheProvider,omitempty"`
}
type ClientInfo ¶
type CodeActionContext ¶
type CodeActionContext struct {
Diagnostics []Diagnostic `json:"diagnostics"`
}
type CodeActionKind ¶
type CodeActionKind string
const ( CAKEmpty CodeActionKind = "" CAKQuickFix CodeActionKind = "quickfix" CAKRefactor CodeActionKind = "refactor" CAKRefactorExtract CodeActionKind = "refactor.extract" CAKRefactorInline CodeActionKind = "refactor.inline" CAKRefactorRewrite CodeActionKind = "refactor.rewrite" CAKSource CodeActionKind = "source" CAKSourceOrganizeImports CodeActionKind = "source.organizeImports" )
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 CompletionContext ¶
type CompletionContext struct {
TriggerKind CompletionTriggerKind `json:"triggerKind"`
TriggerCharacter string `json:"triggerCharacter,omitempty"`
}
type CompletionItem ¶
type CompletionItem struct {
Label string `json:"label"`
Kind CompletionItemKind `json:"kind,omitempty"`
Detail string `json:"detail,omitempty"`
Documentation MarkupContent `json:"documentation,omitempty"`
SortText string `json:"sortText,omitempty"`
FilterText string `json:"filterText,omitempty"`
InsertText string `json:"insertText,omitempty"`
InsertTextFormat InsertTextFormat `json:"insertTextFormat,omitempty"`
TextEdit *TextEdit `json:"textEdit,omitempty"`
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
Data any `json:"data,omitempty"`
}
type CompletionItemKind ¶
type CompletionItemKind int
const ( CIKText CompletionItemKind CIKMethod CIKFunction CIKConstructor CIKField CIKVariable CIKClass CIKInterface CIKModule CIKProperty CIKUnit CIKValue CIKEnum CIKKeyword CIKSnippet CIKColor CIKFile CIKReference CIKFolder CIKEnumMember CIKConstant CIKStruct CIKEvent CIKOperator CIKTypeParameter )
func (CompletionItemKind) String ¶
func (c CompletionItemKind) String() string
type CompletionList ¶
type CompletionList struct {
IsIncomplete bool `json:"isIncomplete"`
Items []CompletionItem `json:"items"`
}
type CompletionOptions ¶
type CompletionParams ¶
type CompletionParams struct {
TextDocumentPositionParams
Context CompletionContext `json:"context,omitempty"`
}
type CompletionTriggerKind ¶
type CompletionTriggerKind int
const ( CTKInvoked CompletionTriggerKind = 1 CTKTriggerCharacter = 2 )
type ConfigurationItem ¶
type ConfigurationParams ¶
type ConfigurationParams struct {
Items []ConfigurationItem `json:"items"`
}
type ConfigurationResult ¶
type ConfigurationResult []any
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[T any] struct { Settings T `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 DocumentURI ¶
type DocumentURI string
func NewJobVirtualTextDocumentURI ¶
func NewJobVirtualTextDocumentURI(projectID, jobID, location string) DocumentURI
func NewTableVirtualTextDocumentURI ¶
func NewTableVirtualTextDocumentURI(projectID, datasetID, tableID string) DocumentURI
func (DocumentURI) FilePath ¶
func (d DocumentURI) FilePath() (string, error)
func (DocumentURI) IsFile ¶
func (d DocumentURI) IsFile() bool
func (DocumentURI) IsVirtualTextDocument ¶
func (d DocumentURI) IsVirtualTextDocument() bool
func (DocumentURI) VirtualTextDocumentInfo ¶
func (d DocumentURI) VirtualTextDocumentInfo() (VirtualTextDocumentInfo, error)
type DocumentationFormat ¶
type DocumentationFormat string
const (
DFPlainText DocumentationFormat = "plaintext"
)
type ExecuteCommandOptions ¶
type ExecuteCommandOptions struct {
Commands []string `json:"commands"`
}
type ExecuteCommandParams ¶
type ExecuteQueryResult ¶
type ExecuteQueryResult struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Result QueryResult `json:"result"`
}
type FieldSchema ¶ added in v0.7.0
type FileChangeType ¶
type FileChangeType int
type FileEvent ¶
type FileEvent struct {
URI DocumentURI `json:"uri"`
Type int `json:"type"`
}
type FormattingOptions ¶
type Hover ¶
type Hover struct {
Contents []MarkedString `json:"contents"`
Range *Range `json:"range,omitempty"`
}
func (Hover) MarshalJSON ¶
type ID ¶
type ID struct {
// At most one of Num or Str may be nonzero. If both are zero
// valued, then IsNum specifies which field's value is to be used
// as the ID.
Num uint64
Str string
// IsString controls whether the Num or Str field's value should be
// used as the ID, when both are zero valued. It must always be
// set to true if the request ID is a string.
IsString bool
}
ID represents a JSON-RPC 2.0 request ID, which may be either a string or number (or null, which is unsupported).
func (ID) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type InitializeError ¶
type InitializeError struct {
Retry bool `json:"retry"`
}
type InitializeParams ¶
type InitializeParams[T any] struct { ProcessID int `json:"processId,omitempty"` // RootPath is DEPRECATED in favor of the RootURI field. RootPath string `json:"rootPath,omitempty"` RootURI DocumentURI `json:"rootUri,omitempty"` ClientInfo ClientInfo `json:"clientInfo,omitempty"` Trace Trace `json:"trace,omitempty"` InitializationOptions T `json:"initializationOptions,omitempty"` Capabilities ClientCapabilities `json:"capabilities"` WorkDoneToken string `json:"workDoneToken,omitempty"` }
func (*InitializeParams[T]) Root ¶
func (p *InitializeParams[T]) Root() DocumentURI
Root returns the RootURI if set, or otherwise the RootPath with 'file://' prepended.
type InitializeResult ¶
type InitializeResult struct {
Capabilities ServerCapabilities `json:"capabilities,omitempty"`
}
type InsertTextFormat ¶
type InsertTextFormat int
const ( ITFPlainText InsertTextFormat = 1 ITFSnippet = 2 )
type JobHistory ¶
type JobHistory struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
ID string `json:"id"`
Owner string `json:"owner"`
// Summary is a human-readable summary of the job.
// When the job is a query job, it is the query string.
Summary string `json:"summary"`
}
type ListDatasetsResult ¶
type ListDatasetsResult struct {
Datasets []string `json:"datasets"`
}
type ListJobHistoryResult ¶
type ListJobHistoryResult struct {
Jobs []JobHistory `json:"jobs"`
}
type ListProjectsResult ¶ added in v0.7.1
type ListProjectsResult struct {
Projects []ProjectInfo `json:"projects"`
}
type ListTablesResult ¶
type ListTablesResult struct {
Tables []string `json:"tables"`
}
type Location ¶
type Location struct {
URI DocumentURI `json:"uri"`
Range Range `json:"range"`
}
type LogMessageParams ¶
type LogMessageParams struct {
Type MessageType `json:"type"`
Message string `json:"message"`
}
type MarkedString ¶
type MarkedString markedString
func RawMarkedString ¶
func RawMarkedString(s string) MarkedString
RawMarkedString returns a MarkedString consisting of only a raw string (i.e., "foo" instead of {"value":"foo", "language":"bar"}).
func (MarkedString) MarshalJSON ¶
func (m MarkedString) MarshalJSON() ([]byte, error)
func (*MarkedString) UnmarshalJSON ¶
func (m *MarkedString) UnmarshalJSON(data []byte) error
type MarkupContent ¶
type MarkupContent struct {
Kind MarkupKind `json:"kind"`
Value string `json:"value"`
}
type MarkupKind ¶
type MarkupKind string
const ( MKPlainText MarkupKind = "plaintext" MKMarkdown MarkupKind = "markdown" )
type MessageActionItem ¶
type MessageActionItem struct {
Title string `json:"title"`
}
type MessageType ¶
type MessageType int
const ( MTError MessageType = 1 MTWarning MessageType = 2 Info MessageType = 3 Log MessageType = 4 )
type ParameterInformation ¶
type Position ¶
type ProgressParams ¶
type ProgressParams[T wdp] struct {
/**
* An optional token that a server can use to report work done progress.
*/
Token ProgressToken `json:"token"`
Value *T `json:"value,omitempty"`
}
type ProgressToken ¶
type ProgressToken string
type ProjectInfo ¶ added in v0.7.1
type PublishDiagnosticsParams ¶
type PublishDiagnosticsParams struct {
URI DocumentURI `json:"uri"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type PublishVirtualTextDocumentParams ¶ added in v0.7.0
type PublishVirtualTextDocumentParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Kind VirtualTextDocumentKind `json:"kind"`
Contents []MarkedString `json:"contents,omitempty"`
// Schema is set alongside Contents (Kind == details) for table virtual
// documents; see VirtualTextDocument.Schema.
Schema []FieldSchema `json:"schema,omitempty"`
Result *QueryResult `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}
PublishVirtualTextDocumentParams is pushed by the server once an async bqls/virtualTextDocument fetch completes (or fails) for the given Kind. TextDocument.URI correlates it back to the uri the client originally requested. Two notifications (one per Kind) are sent per request.
type QueryResult ¶
type QueryResult struct {
Columns []string `json:"columns"`
Data [][]bigquery.Value `json:"data"`
// Schema is additional column type information used to render nested
// (RECORD/REPEATED) values on the client. Omitted when empty so that
// older clients ignoring this field keep working unchanged.
Schema []FieldSchema `json:"schema,omitempty"`
}
type Range ¶
type ReferenceContext ¶
type ReferenceParams ¶
type ReferenceParams struct {
TextDocumentPositionParams
Context ReferenceContext `json:"context"`
}
type RenameOptions ¶
type RenameOptions struct {
PrepareProvider bool `json:"prepareProvider,omitempty"`
}
type RenameParams ¶
type RenameParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Position Position `json:"position"`
NewName string `json:"newName"`
}
type ResourceOperation ¶
type ResourceOperation string
const ( ROCreate ResourceOperation = "create" RODelete ResourceOperation = "delete" RORename ResourceOperation = "rename" )
type SaveOptions ¶
type SaveOptions struct {
IncludeText bool `json:"includeText"`
}
type SaveResultResult ¶
type SaveResultResult struct {
URL string `json:"url"`
}
type SearchTablesResult ¶ added in v0.6.0
type SearchTablesResult struct {
Tables []TableSearchResult `json:"tables"`
}
type SemanticHighlightingInformation ¶
type SemanticHighlightingInformation struct {
// Line is the zero-based line position in the text document.
Line int `json:"line"`
// Tokens is a base64 encoded string representing every single highlighted
// characters with its start position, length and the "lookup table" index of
// the semantic highlighting [TextMate scopes](https://manual.macromates.com/en/language_grammars).
// If the `tokens` is empty or not defined, then no highlighted positions are
// available for the line.
Tokens SemanticHighlightingTokens `json:"tokens,omitempty"`
}
SemanticHighlightingInformation represents a semantic highlighting information that has to be applied on a specific line of the text document.
func (*SemanticHighlightingInformation) MarshalJSON ¶
func (v *SemanticHighlightingInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SemanticHighlightingInformation) UnmarshalJSON ¶
func (v *SemanticHighlightingInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SemanticHighlightingOptions ¶
type SemanticHighlightingOptions struct {
Scopes [][]string `json:"scopes,omitempty"`
}
type SemanticHighlightingParams ¶
type SemanticHighlightingParams struct {
TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
Lines []SemanticHighlightingInformation `json:"lines"`
}
type SemanticHighlightingTokens ¶
type SemanticHighlightingTokens []SemanticHighlightingToken
func DeserializeSemanticHighlightingTokens ¶
func DeserializeSemanticHighlightingTokens(src []byte) (SemanticHighlightingTokens, error)
func (SemanticHighlightingTokens) Serialize ¶
func (v SemanticHighlightingTokens) Serialize() []byte
type ServerCapabilities ¶
type ServerCapabilities struct {
TextDocumentSync *TextDocumentSyncOptionsOrKind `json:"textDocumentSync,omitempty"`
HoverProvider bool `json:"hoverProvider,omitempty"`
CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`
SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`
DefinitionProvider bool `json:"definitionProvider,omitempty"`
TypeDefinitionProvider bool `json:"typeDefinitionProvider,omitempty"`
ReferencesProvider bool `json:"referencesProvider,omitempty"`
DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"`
DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"`
WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"`
ImplementationProvider bool `json:"implementationProvider,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 *RenameOptions `json:"renameProvider,omitempty"`
ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"`
SemanticHighlighting *SemanticHighlightingOptions `json:"semanticHighlighting,omitempty"`
// XWorkspaceReferencesProvider indicates the server provides support for
// xworkspace/references. This is a Sourcegraph extension.
XWorkspaceReferencesProvider bool `json:"xworkspaceReferencesProvider,omitempty"`
// XDefinitionProvider indicates the server provides support for
// textDocument/xdefinition. This is a Sourcegraph extension.
XDefinitionProvider bool `json:"xdefinitionProvider,omitempty"`
// XWorkspaceSymbolByProperties indicates the server provides support for
// querying symbols by properties with WorkspaceSymbolParams.symbol. This
// is a Sourcegraph extension.
XWorkspaceSymbolByProperties bool `json:"xworkspaceSymbolByProperties,omitempty"`
Experimental any `json:"experimental,omitempty"`
}
type ShowMessageParams ¶
type ShowMessageParams struct {
Type MessageType `json:"type"`
Message string `json:"message"`
}
type ShowMessageRequestParams ¶
type ShowMessageRequestParams struct {
Type MessageType `json:"type"`
Message string `json:"message"`
Actions []MessageActionItem `json:"actions"`
}
type SignatureHelp ¶
type SignatureHelp struct {
Signatures []SignatureInformation `json:"signatures"`
ActiveSignature int `json:"activeSignature"`
ActiveParameter int `json:"activeParameter"`
}
type SignatureHelpOptions ¶
type SignatureHelpOptions struct {
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
}
type SignatureInformation ¶
type SignatureInformation struct {
Label string `json:"label"`
Documentation string `json:"documentation,omitempty"`
Parameters []ParameterInformation `json:"parameters,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 SKObject SymbolKind = 19 SKKey SymbolKind = 20 SKNull SymbolKind = 21 SKEnumMember SymbolKind = 22 SKStruct SymbolKind = 23 SKEvent SymbolKind = 24 SKOperator SymbolKind = 25 SKTypeParameter SymbolKind = 26 )
The SymbolKind values are defined at https://microsoft.github.io/language-server-protocol/specification.
func (SymbolKind) String ¶
func (s SymbolKind) String() string
type TableSearchResult ¶ added in v0.6.0
type TextDocumentClientCapabilities ¶
type TextDocumentClientCapabilities struct {
Declaration *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"declaration,omitempty"`
Definition *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"definition,omitempty"`
Implementation *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"implementation,omitempty"`
TypeDefinition *struct {
LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"typeDefinition,omitempty"`
Synchronization *struct {
WillSave bool `json:"willSave,omitempty"`
DidSave bool `json:"didSave,omitempty"`
WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`
} `json:"synchronization,omitempty"`
DocumentSymbol struct {
SymbolKind struct {
ValueSet []int `json:"valueSet,omitempty"`
} `json:"symbolKind,omitEmpty"`
HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`
} `json:"documentSymbol,omitempty"`
Formatting *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"formatting,omitempty"`
RangeFormatting *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"rangeFormatting,omitempty"`
Rename *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
PrepareSupport bool `json:"prepareSupport,omitempty"`
} `json:"rename,omitempty"`
SemanticHighlightingCapabilities *struct {
SemanticHighlighting bool `json:"semanticHighlighting,omitempty"`
} `json:"semanticHighlightingCapabilities,omitempty"`
CodeAction struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
IsPreferredSupport bool `json:"isPreferredSupport,omitempty"`
CodeActionLiteralSupport struct {
CodeActionKind struct {
ValueSet []CodeActionKind `json:"valueSet,omitempty"`
} `json:"codeActionKind,omitempty"`
} `json:"codeActionLiteralSupport,omitempty"`
} `json:"codeAction,omitempty"`
Completion struct {
CompletionItem struct {
DocumentationFormat []DocumentationFormat `json:"documentationFormat,omitempty"`
SnippetSupport bool `json:"snippetSupport,omitempty"`
} `json:"completionItem,omitempty"`
CompletionItemKind struct {
ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
} `json:"completionItemKind,omitempty"`
ContextSupport bool `json:"contextSupport,omitempty"`
} `json:"completion,omitempty"`
SignatureHelp *struct {
SignatureInformation struct {
ParameterInformation struct {
LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
} `json:"parameterInformation,omitempty"`
} `json:"signatureInformation,omitempty"`
} `json:"signatureHelp,omitempty"`
DocumentLink *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
TooltipSupport bool `json:"tooltipSupport,omitempty"`
} `json:"documentLink,omitempty"`
Hover *struct {
ContentFormat []string `json:"contentFormat,omitempty"`
} `json:"hover,omitempty"`
FoldingRange *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
RangeLimit any `json:"rangeLimit,omitempty"`
LineFoldingOnly bool `json:"lineFoldingOnly,omitempty"`
} `json:"foldingRange,omitempty"`
CallHierarchy *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"callHierarchy,omitempty"`
ColorProvider *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"colorProvider,omitempty"`
}
type TextDocumentIdentifier ¶
type TextDocumentIdentifier struct {
/**
* The text document's URI.
*/
URI DocumentURI `json:"uri"`
}
type TextDocumentItem ¶
type TextDocumentItem struct {
/**
* The text document's URI.
*/
URI DocumentURI `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 TextDocumentPrepareRenameParams ¶
type TextDocumentPrepareRenameParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
type TextDocumentSyncKind ¶
type TextDocumentSyncKind int
TextDocumentSyncKind is a DEPRECATED way to describe how text document syncing works. Use TextDocumentSyncOptions instead (or the Options field of TextDocumentSyncOptionsOrKind if you need to support JSON-(un)marshaling both).
const ( TDSKNone TextDocumentSyncKind = 0 TDSKFull TextDocumentSyncKind = 1 TDSKIncremental TextDocumentSyncKind = 2 )
type TextDocumentSyncOptions ¶
type TextDocumentSyncOptions struct {
OpenClose bool `json:"openClose,omitempty"`
Change TextDocumentSyncKind `json:"change"`
WillSave bool `json:"willSave,omitempty"`
WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`
Save *SaveOptions `json:"save,omitempty"`
}
type TextDocumentSyncOptionsOrKind ¶
type TextDocumentSyncOptionsOrKind struct {
Kind *TextDocumentSyncKind
Options *TextDocumentSyncOptions
}
TextDocumentSyncOptions holds either a TextDocumentSyncKind or TextDocumentSyncOptions. The LSP API allows either to be specified in the (ServerCapabilities).TextDocumentSync field.
func (*TextDocumentSyncOptionsOrKind) MarshalJSON ¶
func (v *TextDocumentSyncOptionsOrKind) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*TextDocumentSyncOptionsOrKind) UnmarshalJSON ¶
func (v *TextDocumentSyncOptionsOrKind) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type VersionedTextDocumentIdentifier ¶
type VersionedTextDocumentIdentifier struct {
TextDocumentIdentifier
/**
* The version number of this document.
*/
Version int `json:"version"`
}
type VirtualTextDocument ¶
type VirtualTextDocument struct {
Contents []MarkedString `json:"contents"`
Result QueryResult `json:"result"`
// Schema is the table's schema as structured data (name/type/repeated/
// fields), letting clients render a collapsible tree instead of relying
// on the Markdown table already embedded in Contents. Only set for
// table (not job) virtual documents; omitted when empty.
Schema []FieldSchema `json:"schema,omitempty"`
// Pending indicates this is a placeholder response; the real contents/
// result will follow via a bqls/publishVirtualTextDocument notification.
// Only set when the client declared supports_async_virtual_text_document.
Pending bool `json:"pending,omitempty"`
}
type VirtualTextDocumentInfo ¶
type VirtualTextDocumentKind ¶ added in v0.7.0
type VirtualTextDocumentKind string
VirtualTextDocumentKind distinguishes which part of a virtual text document a bqls/publishVirtualTextDocument notification carries. Details (table/job metadata) are usually available well before the preview (query result rows), so they're published as soon as each becomes ready instead of waiting for both.
const ( VirtualTextDocumentKindDetails VirtualTextDocumentKind = "details" VirtualTextDocumentKindPreview VirtualTextDocumentKind = "preview" )
type VirtualTextDocumentParams ¶
type VirtualTextDocumentParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
type WindowClientCapabilities ¶
type WindowClientCapabilities struct {
WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
}
type WorkDoneProgressBegin ¶
type WorkDoneProgressBegin struct {
Title string `json:"title"`
Cancellable bool `json:"cancellable,omitempty"`
Message string `json:"message,omitempty"`
Percentage float64 `json:"percentage,omitempty"`
}
func (WorkDoneProgressBegin) IsWorkDoneProgress ¶
func (w WorkDoneProgressBegin) IsWorkDoneProgress()
func (WorkDoneProgressBegin) MarshalJSON ¶
func (w WorkDoneProgressBegin) MarshalJSON() ([]byte, error)
type WorkDoneProgressEnd ¶
type WorkDoneProgressEnd struct {
Message string `json:"message,omitempty"`
}
func (WorkDoneProgressEnd) IsWorkDoneProgress ¶
func (w WorkDoneProgressEnd) IsWorkDoneProgress()
func (WorkDoneProgressEnd) MarshalJSON ¶
func (w WorkDoneProgressEnd) MarshalJSON() ([]byte, error)
type WorkDoneProgressParams ¶
type WorkDoneProgressParams struct {
/**
* An optional token that a server can use to report work done progress.
*/
WorkDoneToken ProgressToken `json:"workDoneToken,omitempty"`
}
type WorkDoneProgressReport ¶
type WorkDoneProgressReport struct {
Cancellable bool `json:"cancellable,omitempty"`
Message string `json:"message,omitempty"`
Percentage float64 `json:"percentage,omitempty"`
}
func (WorkDoneProgressReport) IsWorkDoneProgress ¶
func (w WorkDoneProgressReport) IsWorkDoneProgress()
func (WorkDoneProgressReport) MarshalJSON ¶
func (w WorkDoneProgressReport) MarshalJSON() ([]byte, error)
type WorkspaceClientCapabilities ¶
type WorkspaceClientCapabilities struct {
WorkspaceEdit struct {
DocumentChanges bool `json:"documentChanges,omitempty"`
ResourceOperations []string `json:"resourceOperations,omitempty"`
} `json:"workspaceEdit,omitempty"`
ApplyEdit bool `json:"applyEdit,omitempty"`
Symbol struct {
SymbolKind struct {
ValueSet []int `json:"valueSet,omitempty"`
} `json:"symbolKind,omitEmpty"`
} `json:"symbol,omitempty"`
ExecuteCommand *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"executeCommand,omitempty"`
DidChangeWatchedFiles *struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"didChangeWatchedFiles,omitempty"`
WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
Configuration bool `json:"configuration,omitempty"`
}