lsp

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

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

View Source
const (
	Text  DocumentHighlightKind = 1
	Read                        = 2
	Write                       = 3
)
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 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 ClientInfo struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

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 CodeLens

type CodeLens struct {
	Range   Range   `json:"range"`
	Command Command `json:"command,omitempty"`
	Data    any     `json:"data,omitempty"`
}

type CodeLensOptions

type CodeLensOptions struct {
	ResolveProvider bool `json:"resolveProvider,omitempty"`
}

type CodeLensParams

type CodeLensParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type Command

type Command struct {
	/**
	 * Title of the command, like `save`.
	 */
	Title string `json:"title"`
	/**
	 * The identifier of the actual command handler.
	 */
	Command string `json:"command"`
	/**
	 * Arguments that the command handler should be
	 * invoked with.
	 */
	Arguments []any `json:"arguments"`
}

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 CompletionOptions struct {
	ResolveProvider   bool     `json:"resolveProvider,omitempty"`
	TriggerCharacters []string `json:"triggerCharacters,omitempty"`
}

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 ConfigurationItem struct {
	ScopeURI string `json:"scopeUri,omitempty"`
	Section  string `json:"section,omitempty"`
}

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 DocumentHighlight struct {
	Range Range `json:"range"`
	Kind  int   `json:"kind,omitempty"`
}

type DocumentHighlightKind

type DocumentHighlightKind int

type DocumentOnTypeFormattingOptions

type DocumentOnTypeFormattingOptions struct {
	FirstTriggerCharacter string   `json:"firstTriggerCharacter"`
	MoreTriggerCharacter  []string `json:"moreTriggerCharacter,omitempty"`
}

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 ExecuteCommandParams struct {
	Command   string `json:"command"`
	Arguments []any  `json:"arguments,omitempty"`
}

type ExecuteQueryResult

type ExecuteQueryResult struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Result       QueryResult            `json:"result"`
}

type FileChangeType

type FileChangeType int

type FileEvent

type FileEvent struct {
	URI  DocumentURI `json:"uri"`
	Type int         `json:"type"`
}

type FormattingOptions

type FormattingOptions struct {
	TabSize      int    `json:"tabSize"`
	InsertSpaces bool   `json:"insertSpaces"`
	Key          string `json:"key"`
}

type Hover

type Hover struct {
	Contents []MarkedString `json:"contents"`
	Range    *Range         `json:"range,omitempty"`
}

func (Hover) MarshalJSON

func (h Hover) MarshalJSON() ([]byte, error)

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

func (id ID) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(data []byte) error

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

type None struct{}

type ParameterInformation

type ParameterInformation struct {
	Label         string `json:"label"`
	Documentation string `json:"documentation,omitempty"`
}

type Position

type Position struct {
	/**
	 * Line position in a document (zero-based).
	 */
	Line int `json:"line"`

	/**
	 * Character offset on a line in a document (zero-based).
	 */
	Character int `json:"character"`
}

func (Position) String

func (p Position) String() string

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 PublishDiagnosticsParams

type PublishDiagnosticsParams struct {
	URI         DocumentURI  `json:"uri"`
	Diagnostics []Diagnostic `json:"diagnostics"`
}

type QueryResult

type QueryResult struct {
	Columns []string           `json:"columns"`
	Data    [][]bigquery.Value `json:"data"`
}

type Range

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

	/**
	 * The range's end position.
	 */
	End Position `json:"end"`
}

func (Range) String

func (r Range) String() string

type ReferenceContext

type ReferenceContext struct {
	IncludeDeclaration bool `json:"includeDeclaration"`

	// Sourcegraph extension
	XLimit int `json:"xlimit,omitempty"`
}

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

type SemanticHighlightingToken struct {
	Character uint32
	Length    uint16
	Scope     uint16
}

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

type TextDocumentContentChangeEvent struct {
	Range       *Range `json:"range,omitEmpty"`
	RangeLength uint   `json:"rangeLength,omitEmpty"`
	Text        string `json:"text"`
}

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 TextEdit

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

	/**
	 * The string to be inserted. For delete operations use an
	 * empty string.
	 */
	NewText string `json:"newText"`
}

type Trace

type Trace string

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

type VirtualTextDocumentInfo

type VirtualTextDocumentInfo struct {
	ProjectID string
	DatasetID string
	TableID   string
	JobID     string
	Location  string
}

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

type WorkspaceEdit

type WorkspaceEdit struct {
	/**
	 * Holds changes to existing resources.
	 */
	Changes map[string][]TextEdit `json:"changes"`
}

type WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	Query string `json:"query"`
	Limit int    `json:"limit"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL