// Code generated by generate.mts; DO NOT EDIT. package lsproto import ( "cmp" "fmt" "strings" "github.com/microsoft/typescript-go/internal/json" ) // Meta model version 3.17.0 // Structures type ImplementationParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } func (s *ImplementationParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *ImplementationParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*ImplementationParams)(nil) func (s *ImplementationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a location inside a resource, such as a line // inside a text file. type Location struct { Uri DocumentUri `json:"uri" lsp:"required"` Range Range `json:"range" lsp:"required"` } func (s Location) GetLocation() Location { return s } var _ json.UnmarshalerFrom = (*Location)(nil) func (s *Location) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type ImplementationRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*ImplementationRegistrationOptions)(nil) func (s *ImplementationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type TypeDefinitionParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } func (s *TypeDefinitionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *TypeDefinitionParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*TypeDefinitionParams)(nil) func (s *TypeDefinitionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type TypeDefinitionRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*TypeDefinitionRegistrationOptions)(nil) func (s *TypeDefinitionRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A workspace folder inside a client. type WorkspaceFolder struct { // The associated URI for this workspace folder. Uri URI `json:"uri" lsp:"required"` // The name of the workspace folder. Used to refer to this // workspace folder in the user interface. Name string `json:"name" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceFolder)(nil) func (s *WorkspaceFolder) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a `workspace/didChangeWorkspaceFolders` notification. type DidChangeWorkspaceFoldersParams struct { // The actual workspace folder change event. Event *WorkspaceFoldersChangeEvent `json:"event" lsp:"required"` } var _ json.UnmarshalerFrom = (*DidChangeWorkspaceFoldersParams)(nil) func (s *DidChangeWorkspaceFoldersParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a configuration request. type ConfigurationParams struct { Items []*ConfigurationItem `json:"items" lsp:"required"` } var _ json.UnmarshalerFrom = (*ConfigurationParams)(nil) func (s *ConfigurationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a DocumentColorRequest. type DocumentColorParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *DocumentColorParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentColorParams)(nil) func (s *DocumentColorParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a color range from a document. type ColorInformation struct { // The range in the document where this color appears. Range Range `json:"range" lsp:"required"` // The actual color value for this color range. Color Color `json:"color" lsp:"required"` } var _ json.UnmarshalerFrom = (*ColorInformation)(nil) func (s *ColorInformation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DocumentColorRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentColorRegistrationOptions)(nil) func (s *DocumentColorRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a ColorPresentationRequest. type ColorPresentationParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The color to request presentations for. Color Color `json:"color" lsp:"required"` // The range where the color would be inserted. Serves as a context. Range Range `json:"range" lsp:"required"` } func (s *ColorPresentationParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*ColorPresentationParams)(nil) func (s *ColorPresentationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type ColorPresentation struct { // The label of this color presentation. It will be shown on the color // picker header. By default this is also the text that is inserted when selecting // this color presentation. Label string `json:"label" lsp:"required"` // An edit which is applied to a document when selecting // this presentation for the color. When `falsy` the label // is used. TextEdit *TextEdit `json:"textEdit,omitzero"` // An optional array of additional edits that are applied when // selecting this color presentation. Edits must not overlap with the main edit nor with themselves. AdditionalTextEdits *[]*TextEdit `json:"additionalTextEdits,omitzero"` } var _ json.UnmarshalerFrom = (*ColorPresentation)(nil) func (s *ColorPresentation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressOptions)(nil) func (s *WorkDoneProgressOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // General text document registration options. type TextDocumentRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentRegistrationOptions)(nil) func (s *TextDocumentRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a FoldingRangeRequest. type FoldingRangeParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *FoldingRangeParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*FoldingRangeParams)(nil) func (s *FoldingRangeParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a folding range. To be valid, start and end line must be bigger than zero and smaller // than the number of lines in the document. Clients are free to ignore invalid ranges. type FoldingRange struct { // The zero-based start line of the range to fold. The folded area starts after the line's last character. // To be valid, the end must be zero or larger and smaller than the number of lines in the document. StartLine uint32 `json:"startLine" lsp:"required"` // The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. StartCharacter *uint32 `json:"startCharacter,omitzero"` // The zero-based end line of the range to fold. The folded area ends with the line's last character. // To be valid, the end must be zero or larger and smaller than the number of lines in the document. EndLine uint32 `json:"endLine" lsp:"required"` // The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. EndCharacter *uint32 `json:"endCharacter,omitzero"` // Describes the kind of the folding range such as 'comment' or 'region'. The kind // is used to categorize folding ranges and used by commands like 'Fold all comments'. // See FoldingRangeKind for an enumeration of standardized kinds. Kind *FoldingRangeKind `json:"kind,omitzero"` // The text that the client should show when the specified range is // collapsed. If not defined or not supported by the client, a default // will be chosen by the client. // // Since: 3.17.0 CollapsedText *string `json:"collapsedText,omitzero"` } var _ json.UnmarshalerFrom = (*FoldingRange)(nil) func (s *FoldingRange) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type FoldingRangeRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*FoldingRangeRegistrationOptions)(nil) func (s *FoldingRangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DeclarationParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } func (s *DeclarationParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *DeclarationParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*DeclarationParams)(nil) func (s *DeclarationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DeclarationRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*DeclarationRegistrationOptions)(nil) func (s *DeclarationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A parameter literal used in selection range requests. type SelectionRangeParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The positions inside the text document. Positions []Position `json:"positions" lsp:"required"` } func (s *SelectionRangeParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*SelectionRangeParams)(nil) func (s *SelectionRangeParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A selection range represents a part of a selection hierarchy. A selection range // may have a parent selection range that contains it. type SelectionRange struct { // The range of this selection range. Range Range `json:"range" lsp:"required"` // The parent selection range containing this range. Therefore `parent.range` must contain `this.range`. Parent *SelectionRange `json:"parent,omitzero"` } var _ json.UnmarshalerFrom = (*SelectionRange)(nil) func (s *SelectionRange) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type SelectionRangeRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*SelectionRangeRegistrationOptions)(nil) func (s *SelectionRangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressCreateParams struct { // The token to be used to report progress. Token IntegerOrString `json:"token" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressCreateParams)(nil) func (s *WorkDoneProgressCreateParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressCancelParams struct { // The token to be used to report progress. Token IntegerOrString `json:"token" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressCancelParams)(nil) func (s *WorkDoneProgressCancelParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameter of a `textDocument/prepareCallHierarchy` request. // // Since: 3.16.0 type CallHierarchyPrepareParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` } func (s *CallHierarchyPrepareParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *CallHierarchyPrepareParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*CallHierarchyPrepareParams)(nil) func (s *CallHierarchyPrepareParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents programming constructs like functions or constructors in the context // of call hierarchy. // // Since: 3.16.0 type CallHierarchyItem struct { // The name of this item. Name string `json:"name" lsp:"required"` // The kind of this item. Kind SymbolKind `json:"kind" lsp:"required"` // Tags for this item. Tags *[]SymbolTag `json:"tags,omitzero"` // More detail for this item, e.g. the signature of a function. Detail *string `json:"detail,omitzero"` // The resource identifier of this item. Uri DocumentUri `json:"uri" lsp:"required"` // The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code. Range Range `json:"range" lsp:"required"` // The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. // Must be contained by the `range`. SelectionRange Range `json:"selectionRange" lsp:"required"` // A data entry field that is preserved between a call hierarchy prepare and // incoming calls or outgoing calls requests. Data *CallHierarchyItemData `json:"data,omitzero"` } func (s CallHierarchyItem) GetLocation() Location { return Location{ Uri: s.Uri, Range: s.Range, } } var _ json.UnmarshalerFrom = (*CallHierarchyItem)(nil) func (s *CallHierarchyItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Call hierarchy options used during static or dynamic registration. // // Since: 3.16.0 type CallHierarchyRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*CallHierarchyRegistrationOptions)(nil) func (s *CallHierarchyRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameter of a `callHierarchy/incomingCalls` request. // // Since: 3.16.0 type CallHierarchyIncomingCallsParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` Item *CallHierarchyItem `json:"item" lsp:"required"` } var _ json.UnmarshalerFrom = (*CallHierarchyIncomingCallsParams)(nil) func (s *CallHierarchyIncomingCallsParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents an incoming call, e.g. a caller of a method or constructor. // // Since: 3.16.0 type CallHierarchyIncomingCall struct { // The item that makes the call. From *CallHierarchyItem `json:"from" lsp:"required"` // The ranges at which the calls appear. This is relative to the caller // denoted by `this.from`. FromRanges []Range `json:"fromRanges" lsp:"required"` } var _ json.UnmarshalerFrom = (*CallHierarchyIncomingCall)(nil) func (s *CallHierarchyIncomingCall) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameter of a `callHierarchy/outgoingCalls` request. // // Since: 3.16.0 type CallHierarchyOutgoingCallsParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` Item *CallHierarchyItem `json:"item" lsp:"required"` } var _ json.UnmarshalerFrom = (*CallHierarchyOutgoingCallsParams)(nil) func (s *CallHierarchyOutgoingCallsParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc. // // Since: 3.16.0 type CallHierarchyOutgoingCall struct { // The item that is called. To *CallHierarchyItem `json:"to" lsp:"required"` // The range at which this item is called. This is the range relative to the caller, e.g the item // passed to `provideCallHierarchyOutgoingCalls` // and not `this.to`. FromRanges []Range `json:"fromRanges" lsp:"required"` } var _ json.UnmarshalerFrom = (*CallHierarchyOutgoingCall)(nil) func (s *CallHierarchyOutgoingCall) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *SemanticTokensParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*SemanticTokensParams)(nil) func (s *SemanticTokensParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokens struct { // An optional result id. If provided and clients support delta updating // the client will include the result id in the next semantic token request. // A server can then instead of computing all semantic tokens again simply // send a delta. ResultId *string `json:"resultId,omitzero"` // The actual tokens. Data []uint32 `json:"data" lsp:"required"` } var _ json.UnmarshalerFrom = (*SemanticTokens)(nil) func (s *SemanticTokens) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensPartialResult struct { Data []uint32 `json:"data" lsp:"required"` } var _ json.UnmarshalerFrom = (*SemanticTokensPartialResult)(nil) func (s *SemanticTokensPartialResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The legend used by the server Legend *SemanticTokensLegend `json:"legend" lsp:"required"` // Server supports providing semantic tokens for a specific range // of a document. Range *BooleanOrEmptyObject `json:"range,omitzero"` // Server supports providing semantic tokens for a full document. Full *BooleanOrSemanticTokensFullDelta `json:"full,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*SemanticTokensRegistrationOptions)(nil) func (s *SemanticTokensRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensDeltaParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The result id of a previous response. The result Id can either point to a full response // or a delta response depending on what was received last. PreviousResultId string `json:"previousResultId" lsp:"required"` } func (s *SemanticTokensDeltaParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*SemanticTokensDeltaParams)(nil) func (s *SemanticTokensDeltaParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensDelta struct { ResultId *string `json:"resultId,omitzero"` // The semantic token edits to transform a previous result into a new result. Edits []*SemanticTokensEdit `json:"edits" lsp:"required"` } var _ json.UnmarshalerFrom = (*SemanticTokensDelta)(nil) func (s *SemanticTokensDelta) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensDeltaPartialResult struct { Edits []*SemanticTokensEdit `json:"edits" lsp:"required"` } var _ json.UnmarshalerFrom = (*SemanticTokensDeltaPartialResult)(nil) func (s *SemanticTokensDeltaPartialResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensRangeParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The range the semantic tokens are requested for. Range Range `json:"range" lsp:"required"` } func (s *SemanticTokensRangeParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*SemanticTokensRangeParams)(nil) func (s *SemanticTokensRangeParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Params to show a resource in the UI. // // Since: 3.16.0 type ShowDocumentParams struct { // The uri to show. Uri URI `json:"uri" lsp:"required"` // Indicates to show the resource in an external program. // To show, for example, `https://code.visualstudio.com/` // in the default WEB browser set `external` to `true`. External *bool `json:"external,omitzero"` // An optional property to indicate whether the editor // showing the document should take focus or not. // Clients might ignore this property if an external // program is started. TakeFocus *bool `json:"takeFocus,omitzero"` // An optional selection range if the document is a text // document. Clients might ignore the property if an // external program is started or the file is not a text // file. Selection *Range `json:"selection,omitzero"` } var _ json.UnmarshalerFrom = (*ShowDocumentParams)(nil) func (s *ShowDocumentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The result of a showDocument request. // // Since: 3.16.0 type ShowDocumentResult struct { // A boolean indicating if the show was successful. Success bool `json:"success" lsp:"required"` } var _ json.UnmarshalerFrom = (*ShowDocumentResult)(nil) func (s *ShowDocumentResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type LinkedEditingRangeParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` } func (s *LinkedEditingRangeParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *LinkedEditingRangeParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*LinkedEditingRangeParams)(nil) func (s *LinkedEditingRangeParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The result of a linked editing range request. // // Since: 3.16.0 type LinkedEditingRanges struct { // A list of ranges that can be edited together. The ranges must have // identical length and contain identical text content. The ranges cannot overlap. Ranges []Range `json:"ranges" lsp:"required"` // An optional word pattern (regular expression) that describes valid contents for // the given ranges. If no pattern is provided, the client configuration's word // pattern will be used. WordPattern *string `json:"wordPattern,omitzero"` } var _ json.UnmarshalerFrom = (*LinkedEditingRanges)(nil) func (s *LinkedEditingRanges) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type LinkedEditingRangeRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*LinkedEditingRangeRegistrationOptions)(nil) func (s *LinkedEditingRangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in notifications/requests for user-initiated creation of // files. // // Since: 3.16.0 type CreateFilesParams struct { // An array of all files/folders created in this operation. Files []*FileCreate `json:"files" lsp:"required"` } var _ json.UnmarshalerFrom = (*CreateFilesParams)(nil) func (s *CreateFilesParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A workspace edit represents changes to many resources managed in the workspace. The edit // should either provide `changes` or `documentChanges`. If documentChanges are present // they are preferred over `changes` if the client can handle versioned document edits. // // Since version 3.13.0 a workspace edit can contain resource operations as well. If resource // operations are present clients need to execute the operations in the order in which they // are provided. So a workspace edit for example can consist of the following two changes: // (1) a create file a.txt and (2) a text document edit which insert text into file a.txt. // // An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will // cause failure of the operation. How the client recovers from the failure is described by // the client capability: `workspace.workspaceEdit.failureHandling` type WorkspaceEdit struct { // Holds changes to existing resources. Changes *map[DocumentUri][]*TextEdit `json:"changes,omitzero"` // Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes // are either an array of `TextDocumentEdit`s to express changes to n different text documents // where each text document edit addresses a specific version of a text document. Or it can contain // above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations. // // Whether a client supports versioned document edits is expressed via // `workspace.workspaceEdit.documentChanges` client capability. // // If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then // only plain `TextEdit`s using the `changes` property are supported. DocumentChanges *[]TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile `json:"documentChanges,omitzero"` // A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and // delete file / folder operations. // // Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`. // // Since: 3.16.0 ChangeAnnotations *map[string]*ChangeAnnotation `json:"changeAnnotations,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceEdit)(nil) func (s *WorkspaceEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The options to register for file operations. // // Since: 3.16.0 type FileOperationRegistrationOptions struct { // The actual filters. Filters []*FileOperationFilter `json:"filters" lsp:"required"` } var _ json.UnmarshalerFrom = (*FileOperationRegistrationOptions)(nil) func (s *FileOperationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in notifications/requests for user-initiated renames of // files. // // Since: 3.16.0 type RenameFilesParams struct { // An array of all files/folders renamed in this operation. When a folder is renamed, only // the folder will be included, and not its children. Files []*FileRename `json:"files" lsp:"required"` } var _ json.UnmarshalerFrom = (*RenameFilesParams)(nil) func (s *RenameFilesParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in notifications/requests for user-initiated deletes of // files. // // Since: 3.16.0 type DeleteFilesParams struct { // An array of all files/folders deleted in this operation. Files []*FileDelete `json:"files" lsp:"required"` } var _ json.UnmarshalerFrom = (*DeleteFilesParams)(nil) func (s *DeleteFilesParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type MonikerParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } func (s *MonikerParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *MonikerParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*MonikerParams)(nil) func (s *MonikerParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Moniker definition to match LSIF 0.5 moniker definition. // // Since: 3.16.0 type Moniker struct { // The scheme of the moniker. For example tsc or .Net Scheme string `json:"scheme" lsp:"required"` // The identifier of the moniker. The value is opaque in LSIF however // schema owners are allowed to define the structure if they want. Identifier string `json:"identifier" lsp:"required"` // The scope in which the moniker is unique Unique UniquenessLevel `json:"unique" lsp:"required"` // The moniker kind if known. Kind *MonikerKind `json:"kind,omitzero"` } var _ json.UnmarshalerFrom = (*Moniker)(nil) func (s *Moniker) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type MonikerRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*MonikerRegistrationOptions)(nil) func (s *MonikerRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameter of a `textDocument/prepareTypeHierarchy` request. // // Since: 3.17.0 type TypeHierarchyPrepareParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` } func (s *TypeHierarchyPrepareParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *TypeHierarchyPrepareParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*TypeHierarchyPrepareParams)(nil) func (s *TypeHierarchyPrepareParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.17.0 type TypeHierarchyItem struct { // The name of this item. Name string `json:"name" lsp:"required"` // The kind of this item. Kind SymbolKind `json:"kind" lsp:"required"` // Tags for this item. Tags *[]SymbolTag `json:"tags,omitzero"` // More detail for this item, e.g. the signature of a function. Detail *string `json:"detail,omitzero"` // The resource identifier of this item. Uri DocumentUri `json:"uri" lsp:"required"` // The range enclosing this symbol not including leading/trailing whitespace // but everything else, e.g. comments and code. Range Range `json:"range" lsp:"required"` // The range that should be selected and revealed when this symbol is being // picked, e.g. the name of a function. Must be contained by the // `range`. SelectionRange Range `json:"selectionRange" lsp:"required"` // A data entry field that is preserved between a type hierarchy prepare and // supertypes or subtypes requests. It could also be used to identify the // type hierarchy in the server, helping improve the performance on // resolving supertypes and subtypes. Data *TypeHierarchyItemData `json:"data,omitzero"` } func (s TypeHierarchyItem) GetLocation() Location { return Location{ Uri: s.Uri, Range: s.Range, } } var _ json.UnmarshalerFrom = (*TypeHierarchyItem)(nil) func (s *TypeHierarchyItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Type hierarchy options used during static or dynamic registration. // // Since: 3.17.0 type TypeHierarchyRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*TypeHierarchyRegistrationOptions)(nil) func (s *TypeHierarchyRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameter of a `typeHierarchy/supertypes` request. // // Since: 3.17.0 type TypeHierarchySupertypesParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` Item *TypeHierarchyItem `json:"item" lsp:"required"` } var _ json.UnmarshalerFrom = (*TypeHierarchySupertypesParams)(nil) func (s *TypeHierarchySupertypesParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameter of a `typeHierarchy/subtypes` request. // // Since: 3.17.0 type TypeHierarchySubtypesParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` Item *TypeHierarchyItem `json:"item" lsp:"required"` } var _ json.UnmarshalerFrom = (*TypeHierarchySubtypesParams)(nil) func (s *TypeHierarchySubtypesParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A parameter literal used in inline value requests. // // Since: 3.17.0 type InlineValueParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The document range for which inline values information will be returned. Range Range `json:"range" lsp:"required"` // Additional information about the context in which inline values information was // requested. Context *InlineValueContext `json:"context" lsp:"required"` } func (s *InlineValueParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*InlineValueParams)(nil) func (s *InlineValueParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inline value options used during static or dynamic registration. // // Since: 3.17.0 type InlineValueRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*InlineValueRegistrationOptions)(nil) func (s *InlineValueRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A parameter literal used in inlay hint requests. // // Since: 3.17.0 type InlayHintParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The document range for which inlay hints should be computed. Range Range `json:"range" lsp:"required"` } func (s *InlayHintParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*InlayHintParams)(nil) func (s *InlayHintParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inlay hint information. // // Since: 3.17.0 type InlayHint struct { // The position of this hint. // // If multiple hints have the same position, they will be shown in the order // they appear in the response. Position Position `json:"position" lsp:"required"` // The label of this hint. A human readable string or an array of // InlayHintLabelPart label parts. // // *Note* that neither the string nor the label part can be empty. Label StringOrInlayHintLabelParts `json:"label" lsp:"required"` // The kind of this hint. Can be omitted in which case the client // should fall back to a reasonable default. Kind *InlayHintKind `json:"kind,omitzero"` // Optional text edits that are performed when accepting this inlay hint. // // *Note* that edits are expected to change the document so that the inlay // hint (or its nearest variant) is now part of the document and the inlay // hint itself is now obsolete. TextEdits *[]*TextEdit `json:"textEdits,omitzero"` // The tooltip text when you hover over this item. Tooltip *StringOrMarkupContent `json:"tooltip,omitzero"` // Render padding before the hint. // // Note: Padding should use the editor's background color, not the // background color of the hint itself. That means padding can be used // to visually align/separate an inlay hint. PaddingLeft *bool `json:"paddingLeft,omitzero"` // Render padding after the hint. // // Note: Padding should use the editor's background color, not the // background color of the hint itself. That means padding can be used // to visually align/separate an inlay hint. PaddingRight *bool `json:"paddingRight,omitzero"` // A data entry field that is preserved on an inlay hint between // a `textDocument/inlayHint` and a `inlayHint/resolve` request. Data *InlayHintData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*InlayHint)(nil) func (s *InlayHint) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inlay hint options used during static or dynamic registration. // // Since: 3.17.0 type InlayHintRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The server provides support to resolve additional // information for an inlay hint item. ResolveProvider *bool `json:"resolveProvider,omitzero"` // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*InlayHintRegistrationOptions)(nil) func (s *InlayHintRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters of the document diagnostic request. // // Since: 3.17.0 type DocumentDiagnosticParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The additional identifier provided during registration. Identifier *string `json:"identifier,omitzero"` // The result id of a previous response if provided. PreviousResultId *string `json:"previousResultId,omitzero"` } func (s *DocumentDiagnosticParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentDiagnosticParams)(nil) func (s *DocumentDiagnosticParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Cancellation data returned from a diagnostic request. // // Since: 3.17.0 type DiagnosticServerCancellationData struct { RetriggerRequest bool `json:"retriggerRequest" lsp:"required"` } var _ json.UnmarshalerFrom = (*DiagnosticServerCancellationData)(nil) func (s *DiagnosticServerCancellationData) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Diagnostic registration options. // // Since: 3.17.0 type DiagnosticRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // An optional identifier under which the diagnostics are // managed by the client. Identifier *string `json:"identifier,omitzero"` // Whether the language has inter file dependencies meaning that // editing code in one file can result in a different diagnostic // set in another file. Inter file dependencies are common for // most programming languages and typically uncommon for linters. InterFileDependencies bool `json:"interFileDependencies" lsp:"required"` // The server provides support for workspace diagnostics as well. WorkspaceDiagnostics bool `json:"workspaceDiagnostics" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*DiagnosticRegistrationOptions)(nil) func (s *DiagnosticRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters of the workspace diagnostic request. // // Since: 3.17.0 type WorkspaceDiagnosticParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The additional identifier provided during registration. Identifier *string `json:"identifier,omitzero"` // The currently known diagnostic reports with their // previous result ids. PreviousResultIds []PreviousResultId `json:"previousResultIds" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceDiagnosticParams)(nil) func (s *WorkspaceDiagnosticParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A workspace diagnostic report. // // Since: 3.17.0 type WorkspaceDiagnosticReport struct { Items []WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport `json:"items" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceDiagnosticReport)(nil) func (s *WorkspaceDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A partial result for a workspace diagnostic report. // // Since: 3.17.0 type WorkspaceDiagnosticReportPartialResult struct { Items []WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport `json:"items" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceDiagnosticReportPartialResult)(nil) func (s *WorkspaceDiagnosticReportPartialResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A parameter literal used in inline completion requests. // // Since: 3.18.0 type InlineCompletionParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // Additional information about the context in which inline completions were // requested. Context *InlineCompletionContext `json:"context" lsp:"required"` } func (s *InlineCompletionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *InlineCompletionParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*InlineCompletionParams)(nil) func (s *InlineCompletionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a collection of items to be presented in the editor. // // Since: 3.18.0 type InlineCompletionList struct { // The inline completion items Items []*InlineCompletionItem `json:"items" lsp:"required"` } var _ json.UnmarshalerFrom = (*InlineCompletionList)(nil) func (s *InlineCompletionList) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An inline completion item represents a text snippet that is proposed inline to complete text that is being typed. // // Since: 3.18.0 type InlineCompletionItem struct { // The text to replace the range with. Must be set. InsertText StringOrStringValue `json:"insertText" lsp:"required"` // A text that is used to decide if this inline completion should be shown. When `falsy` the InlineCompletionItem.insertText is used. FilterText *string `json:"filterText,omitzero"` // The range to replace. Must begin and end on the same line. Range *Range `json:"range,omitzero"` // An optional Command that is executed *after* inserting this completion. Command *Command `json:"command,omitzero"` } var _ json.UnmarshalerFrom = (*InlineCompletionItem)(nil) func (s *InlineCompletionItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inline completion options used during static or dynamic registration. // // Since: 3.18.0 type InlineCompletionRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*InlineCompletionRegistrationOptions)(nil) func (s *InlineCompletionRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the `workspace/textDocumentContent` request. // // Since: 3.18.0 type TextDocumentContentParams struct { // The uri of the text document. Uri DocumentUri `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentContentParams)(nil) func (s *TextDocumentContentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Result of the `workspace/textDocumentContent` request. // // Since: 3.18.0 type TextDocumentContentResult struct { // The text content of the text document. Please note, that the content of // any subsequent open notifications for the text document might differ // from the returned content due to whitespace and line ending // normalizations done on the client Text string `json:"text" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentContentResult)(nil) func (s *TextDocumentContentResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Text document content provider registration options. // // Since: 3.18.0 type TextDocumentContentRegistrationOptions struct { // The schemes for which the server provides content. Schemes []string `json:"schemes" lsp:"required"` // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentContentRegistrationOptions)(nil) func (s *TextDocumentContentRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the `workspace/textDocumentContent/refresh` request. // // Since: 3.18.0 type TextDocumentContentRefreshParams struct { // The uri of the text document to refresh. Uri DocumentUri `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentContentRefreshParams)(nil) func (s *TextDocumentContentRefreshParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type RegistrationParams struct { Registrations []*Registration `json:"registrations" lsp:"required"` } var _ json.UnmarshalerFrom = (*RegistrationParams)(nil) func (s *RegistrationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type UnregistrationParams struct { Unregisterations []*Unregistration `json:"unregisterations" lsp:"required"` } var _ json.UnmarshalerFrom = (*UnregistrationParams)(nil) func (s *UnregistrationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type InitializeParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // 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. ProcessId IntegerOrNull `json:"processId" lsp:"required"` // Information about the client // // Since: 3.15.0 ClientInfo *ClientInfo `json:"clientInfo,omitzero"` // The locale the client is currently showing the user interface // in. This must not necessarily be the locale of the operating // system. // // Uses IETF language tags as the value's syntax // (See https://en.wikipedia.org/wiki/IETF_language_tag) // // Since: 3.16.0 Locale *string `json:"locale,omitzero"` // The rootPath of the workspace. Is null // if no folder is open. // // Deprecated: in favour of rootUri. RootPath *StringOrNull `json:"rootPath,omitzero" lsp:"nullable"` // The rootUri of the workspace. Is null if no // folder is open. If both `rootPath` and `rootUri` are set // `rootUri` wins. // // Deprecated: in favour of workspaceFolders. RootUri DocumentUriOrNull `json:"rootUri" lsp:"required"` // The capabilities provided by the client (editor or tool) Capabilities *ClientCapabilities `json:"capabilities" lsp:"required"` // User provided initialization options. InitializationOptions *InitializationOptionsOrNull `json:"initializationOptions,omitzero" lsp:"nullable"` // The initial trace setting. If omitted trace is disabled ('off'). Trace *TraceValue `json:"trace,omitzero"` // The workspace folders configured in the client when the server starts. // // This property is only available if the client supports workspace folders. // It can be `null` if the client supports workspace folders but none are // configured. // // Since: 3.6.0 WorkspaceFolders *WorkspaceFoldersOrNull `json:"workspaceFolders,omitzero" lsp:"nullable"` } var _ json.UnmarshalerFrom = (*InitializeParams)(nil) func (s *InitializeParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The result returned from an initialize request. type InitializeResult struct { // The capabilities the language server provides. Capabilities *ServerCapabilities `json:"capabilities" lsp:"required"` // Information about the server. // // Since: 3.15.0 ServerInfo *ServerInfo `json:"serverInfo,omitzero"` } var _ json.UnmarshalerFrom = (*InitializeResult)(nil) func (s *InitializeResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The data type of the ResponseError if the // initialize request fails. type InitializeError struct { // Indicates whether the client execute the following retry logic: // (1) show the message provided by the ResponseError to the user // (2) user selects retry or cancel // (3) if user selected retry the initialize method is sent again. Retry bool `json:"retry" lsp:"required"` } var _ json.UnmarshalerFrom = (*InitializeError)(nil) func (s *InitializeError) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type InitializedParams struct{} // The parameters of a change configuration notification. type DidChangeConfigurationParams struct { // The actual changed settings Settings any `json:"settings" lsp:"required"` } var _ json.UnmarshalerFrom = (*DidChangeConfigurationParams)(nil) func (s *DidChangeConfigurationParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DidChangeConfigurationRegistrationOptions struct { Section *StringOrStrings `json:"section,omitzero"` } var _ json.UnmarshalerFrom = (*DidChangeConfigurationRegistrationOptions)(nil) func (s *DidChangeConfigurationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a notification message. type ShowMessageParams struct { // The message type. See MessageType Type MessageType `json:"type" lsp:"required"` // The actual message. Message string `json:"message" lsp:"required"` } var _ json.UnmarshalerFrom = (*ShowMessageParams)(nil) func (s *ShowMessageParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type ShowMessageRequestParams struct { // The message type. See MessageType Type MessageType `json:"type" lsp:"required"` // The actual message. Message string `json:"message" lsp:"required"` // The message action items to present. Actions *[]*MessageActionItem `json:"actions,omitzero"` } var _ json.UnmarshalerFrom = (*ShowMessageRequestParams)(nil) func (s *ShowMessageRequestParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type MessageActionItem struct { // A short title like 'Retry', 'Open Log' etc. Title string `json:"title" lsp:"required"` } var _ json.UnmarshalerFrom = (*MessageActionItem)(nil) func (s *MessageActionItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The log message parameters. type LogMessageParams struct { // The message type. See MessageType Type MessageType `json:"type" lsp:"required"` // The actual message. Message string `json:"message" lsp:"required"` } var _ json.UnmarshalerFrom = (*LogMessageParams)(nil) func (s *LogMessageParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in an open text document notification type DidOpenTextDocumentParams struct { // The document that was opened. TextDocument *TextDocumentItem `json:"textDocument" lsp:"required"` } var _ json.UnmarshalerFrom = (*DidOpenTextDocumentParams)(nil) func (s *DidOpenTextDocumentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The change text document notification's parameters. type DidChangeTextDocumentParams struct { // The document that did change. The version number points // to the version after all provided content changes have // been applied. TextDocument VersionedTextDocumentIdentifier `json:"textDocument" lsp:"required"` // The actual content changes. The content changes describe single state changes // to the document. So if there are two content changes c1 (at array index 0) and // c2 (at array index 1) for a document in state S then c1 moves the document from // S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed // on the state S'. // // To mirror the content of a document using change events use the following approach: // - start with the same initial content // - apply the 'textDocument/didChange' notifications in the order you receive them. // - apply the `TextDocumentContentChangeEvent`s in a single notification in the order // you receive them. ContentChanges []TextDocumentContentChangePartialOrWholeDocument `json:"contentChanges" lsp:"required"` } var _ json.UnmarshalerFrom = (*DidChangeTextDocumentParams)(nil) func (s *DidChangeTextDocumentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Describe options to be used when registered for text document change events. type TextDocumentChangeRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // How documents are synced to the server. SyncKind TextDocumentSyncKind `json:"syncKind" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentChangeRegistrationOptions)(nil) func (s *TextDocumentChangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in a close text document notification type DidCloseTextDocumentParams struct { // The document that was closed. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *DidCloseTextDocumentParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DidCloseTextDocumentParams)(nil) func (s *DidCloseTextDocumentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in a save text document notification type DidSaveTextDocumentParams struct { // The document that was saved. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // Optional the content when saved. Depends on the includeText value // when the save notification was requested. Text *string `json:"text,omitzero"` } func (s *DidSaveTextDocumentParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DidSaveTextDocumentParams)(nil) func (s *DidSaveTextDocumentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Save registration options. type TextDocumentSaveRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // The client is supposed to include the content on save. IncludeText *bool `json:"includeText,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentSaveRegistrationOptions)(nil) func (s *TextDocumentSaveRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters sent in a will save text document notification. type WillSaveTextDocumentParams struct { // The document that will be saved. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The 'TextDocumentSaveReason'. Reason TextDocumentSaveReason `json:"reason" lsp:"required"` } func (s *WillSaveTextDocumentParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*WillSaveTextDocumentParams)(nil) func (s *WillSaveTextDocumentParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A text edit applicable to a text document. 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" lsp:"required"` // The string to be inserted. For delete operations use an // empty string. NewText string `json:"newText" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextEdit)(nil) func (s *TextEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } func (s *TextEdit) Compare(other *TextEdit) int { if c := s.Range.Compare(&other.Range); c != 0 { return c } return cmp.Compare(s.NewText, other.NewText) } // The watched files change notification's parameters. type DidChangeWatchedFilesParams struct { // The actual file events. Changes []*FileEvent `json:"changes" lsp:"required"` } var _ json.UnmarshalerFrom = (*DidChangeWatchedFilesParams)(nil) func (s *DidChangeWatchedFilesParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Describe options to be used when registered for text document change events. type DidChangeWatchedFilesRegistrationOptions struct { // The watchers to register. Watchers []*FileSystemWatcher `json:"watchers" lsp:"required"` } var _ json.UnmarshalerFrom = (*DidChangeWatchedFilesRegistrationOptions)(nil) func (s *DidChangeWatchedFilesRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The publish diagnostic notification's parameters. type PublishDiagnosticsParams struct { // The URI for which diagnostic information is reported. Uri DocumentUri `json:"uri" lsp:"required"` // Optional the version number of the document the diagnostics are published for. // // Since: 3.15.0 Version *int32 `json:"version,omitzero"` // An array of diagnostic information items. Diagnostics []*Diagnostic `json:"diagnostics" lsp:"required"` } var _ json.UnmarshalerFrom = (*PublishDiagnosticsParams)(nil) func (s *PublishDiagnosticsParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Completion parameters type CompletionParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The completion context. This is only available it the client specifies // to send this using the client capability `textDocument.completion.contextSupport === true` Context *CompletionContext `json:"context,omitzero"` } func (s *CompletionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *CompletionParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*CompletionParams)(nil) func (s *CompletionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A completion item represents a text snippet that is // proposed to complete text that is being typed. type CompletionItem struct { // The label of this completion item. // // The label property is also by default the text that // is inserted when selecting this completion. // // If label details are provided the label itself should // be an unqualified name of the completion item. Label string `json:"label" lsp:"required"` // Additional details for the label // // Since: 3.17.0 LabelDetails *CompletionItemLabelDetails `json:"labelDetails,omitzero"` // The kind of this completion item. Based of the kind // an icon is chosen by the editor. Kind *CompletionItemKind `json:"kind,omitzero"` // Tags for this completion item. // // Since: 3.15.0 Tags *[]CompletionItemTag `json:"tags,omitzero"` // A human-readable string with additional information // about this item, like type or symbol information. Detail *string `json:"detail,omitzero"` // A human-readable string that represents a doc-comment. Documentation *StringOrMarkupContent `json:"documentation,omitzero"` // Indicates if this item is deprecated. // // Deprecated: Use `tags` instead. Deprecated *bool `json:"deprecated,omitzero"` // Select this item when showing. // // *Note* that only one completion item can be selected and that the // tool / client decides which item that is. The rule is that the *first* // item of those that match best is selected. Preselect *bool `json:"preselect,omitzero"` // A string that should be used when comparing this item // with other items. When `falsy` the label // is used. SortText *string `json:"sortText,omitzero"` // A string that should be used when filtering a set of // completion items. When `falsy` the label // is used. FilterText *string `json:"filterText,omitzero"` // A string that should be inserted into a document when selecting // this completion. When `falsy` the label // is used. // // The `insertText` is subject to interpretation by the client side. // Some tools might not take the string literally. For example // VS Code when code complete is requested in this example // `con` and a completion item with an `insertText` of // `console` is provided it will only insert `sole`. Therefore it is // recommended to use `textEdit` instead since it avoids additional client // side interpretation. InsertText *string `json:"insertText,omitzero"` // The format of the insert text. The format applies to both the // `insertText` property and the `newText` property of a provided // `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`. // // Please note that the insertTextFormat doesn't apply to // `additionalTextEdits`. InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitzero"` // How whitespace and indentation is handled during completion // item insertion. If not provided the clients default value depends on // the `textDocument.completion.insertTextMode` client capability. // // Since: 3.16.0 InsertTextMode *InsertTextMode `json:"insertTextMode,omitzero"` // An edit which is applied to a document when selecting // this completion. When an edit is provided the value of // insertText is ignored. // // Most editors support two different operations when accepting a completion // item. One is to insert a completion text and the other is to replace an // existing text with a completion text. Since this can usually not be // predetermined by a server it can report both ranges. Clients need to // signal support for `InsertReplaceEdits` via the // `textDocument.completion.insertReplaceSupport` client capability // property. // // *Note 1:* The text edit's range as well as both ranges from an insert // replace edit must be a [single line] and they must contain the position // at which completion has been requested. // *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range // must be a prefix of the edit's replace range, that means it must be // contained and starting at the same position. // // Since: 3.16.0 additional type `InsertReplaceEdit` TextEdit *TextEditOrInsertReplaceEdit `json:"textEdit,omitzero"` // The edit text used if the completion item is part of a CompletionList and // CompletionList defines an item default for the text edit range. // // Clients will only honor this property if they opt into completion list // item defaults using the capability `completionList.itemDefaults`. // // If not provided and a list's default range is provided the label // property is used as a text. // // Since: 3.17.0 TextEditText *string `json:"textEditText,omitzero"` // An optional array of additional edits that are applied when // selecting this completion. Edits must not overlap (including the same insert position) // with the main edit nor with themselves. // // Additional text edits should be used to change text unrelated to the current cursor position // (for example adding an import statement at the top of the file if the completion item will // insert an unqualified type). AdditionalTextEdits *[]*TextEdit `json:"additionalTextEdits,omitzero"` // An optional set of characters that when pressed while this completion is active will accept it first and // then type that character. *Note* that all commit characters should have `length=1` and that superfluous // characters will be ignored. CommitCharacters *[]string `json:"commitCharacters,omitzero"` // An optional command that is executed *after* inserting this completion. *Note* that // additional modifications to the current document should be described with the // additionalTextEdits-property. Command *Command `json:"command,omitzero"` // A data entry field that is preserved on a completion item between a // CompletionRequest and a CompletionResolveRequest. Data *CompletionItemData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionItem)(nil) func (s *CompletionItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a collection of items to be presented // in the editor. type CompletionList struct { // This list it not complete. Further typing results in recomputing this list. // // Recomputed lists have all their items replaced (not appended) in the // incomplete completion sessions. IsIncomplete bool `json:"isIncomplete" lsp:"required"` // In many cases the items of an actual completion result share the same // value for properties like `commitCharacters` or the range of a text // edit. A completion list can therefore define item defaults which will // be used if a completion item itself doesn't specify the value. // // If a completion list specifies a default value and a completion item // also specifies a corresponding value, the rules for combining these are // defined by `applyKinds` (if the client supports it), defaulting to // ApplyKind.Replace. // // Servers are only allowed to return default values if the client // signals support for this via the `completionList.itemDefaults` // capability. // // Since: 3.17.0 ItemDefaults *CompletionItemDefaults `json:"itemDefaults,omitzero"` // Specifies how fields from a completion item should be combined with those // from `completionList.itemDefaults`. // // If unspecified, all fields will be treated as ApplyKind.Replace. // // If a field's value is ApplyKind.Replace, the value from a completion item // (if provided and not `null`) will always be used instead of the value // from `completionItem.itemDefaults`. // // If a field's value is ApplyKind.Merge, the values will be merged using // the rules defined against each field below. // // Servers are only allowed to return `applyKind` if the client // signals support for this via the `completionList.applyKindSupport` // capability. // // Since: 3.18.0 ApplyKind *CompletionItemApplyKinds `json:"applyKind,omitzero"` // The completion items. Items []*CompletionItem `json:"items" lsp:"required"` } var _ json.UnmarshalerFrom = (*CompletionList)(nil) func (s *CompletionList) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a CompletionRequest. type CompletionRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Most tools trigger completion request automatically without explicitly requesting // it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user // starts to type an identifier. For example if the user types `c` in a JavaScript file // code complete will automatically pop up present `console` besides others as a // completion item. Characters that make up identifiers don't need to be listed here. // // If code complete should automatically be trigger on characters not being valid inside // an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. TriggerCharacters *[]string `json:"triggerCharacters,omitzero"` // The list of all possible characters that commit a completion. This field can be used // if clients don't support individual commit characters per completion item. See // `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` // // If a server provides both `allCommitCharacters` and commit characters on an individual // completion item the ones on the completion item win. // // Since: 3.2.0 AllCommitCharacters *[]string `json:"allCommitCharacters,omitzero"` // The server provides support to resolve additional // information for a completion item. ResolveProvider *bool `json:"resolveProvider,omitzero"` // The server supports the following `CompletionItem` specific // capabilities. // // Since: 3.17.0 CompletionItem *ServerCompletionItemOptions `json:"completionItem,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionRegistrationOptions)(nil) func (s *CompletionRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a HoverRequest. type HoverParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // Controls how many levels of type definitions will be expanded. Default is 0. VerbosityLevel *int32 `json:"verbosityLevel,omitzero"` } func (s *HoverParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *HoverParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*HoverParams)(nil) func (s *HoverParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The result of a hover request. type Hover struct { // The hover's content Contents MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings `json:"contents" lsp:"required"` // An optional range inside the text document that is used to // visualize the hover, e.g. by changing the background color. Range *Range `json:"range,omitzero"` // Whether the verbosity level can be increased for this hover. CanIncreaseVerbosity bool `json:"canIncreaseVerbosity,omitzero" lsp:"nullable"` } var _ json.UnmarshalerFrom = (*Hover)(nil) func (s *Hover) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a HoverRequest. type HoverRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*HoverRegistrationOptions)(nil) func (s *HoverRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a SignatureHelpRequest. type SignatureHelpParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The signature help context. This is only available if the client specifies // to send this using the client capability `textDocument.signatureHelp.contextSupport === true` // // Since: 3.15.0 Context *SignatureHelpContext `json:"context,omitzero"` } func (s *SignatureHelpParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *SignatureHelpParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*SignatureHelpParams)(nil) func (s *SignatureHelpParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Signature help represents the signature of something // callable. There can be multiple signature but only one // active and only one active parameter. type SignatureHelp struct { // One or more signatures. Signatures []*SignatureInformation `json:"signatures" lsp:"required"` // The active signature. If omitted or the value lies outside the // range of `signatures` the value defaults to zero or is ignored if // the `SignatureHelp` has no signatures. // // Whenever possible implementors should make an active decision about // the active signature and shouldn't rely on a default value. // // In future version of the protocol this property might become // mandatory to better express this. ActiveSignature *uint32 `json:"activeSignature,omitzero"` // The active parameter of the active signature. // // If `null`, no parameter of the signature is active (for example a named // argument that does not match any declared parameters). This is only valid // if the client specifies the client capability // `textDocument.signatureHelp.noActiveParameterSupport === true` // // If omitted or the value lies outside the range of // `signatures[activeSignature].parameters` defaults to 0 if the active // signature has parameters. // // If the active signature has no parameters it is ignored. // // In future version of the protocol this property might become // mandatory (but still nullable) to better express the active parameter if // the active signature does have any. // // Since version 3.16.0 the `SignatureInformation` itself provides a // `activeParameter` property and it should be used instead of this one. ActiveParameter *UintegerOrNull `json:"activeParameter,omitzero" lsp:"nullable"` } var _ json.UnmarshalerFrom = (*SignatureHelp)(nil) func (s *SignatureHelp) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a SignatureHelpRequest. type SignatureHelpRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // List of characters that trigger signature help automatically. TriggerCharacters *[]string `json:"triggerCharacters,omitzero"` // List of characters that re-trigger signature help. // // These trigger characters are only active when signature help is already showing. All trigger characters // are also counted as re-trigger characters. // // Since: 3.15.0 RetriggerCharacters *[]string `json:"retriggerCharacters,omitzero"` } var _ json.UnmarshalerFrom = (*SignatureHelpRegistrationOptions)(nil) func (s *SignatureHelpRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a DefinitionRequest. type DefinitionParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } func (s *DefinitionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *DefinitionParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*DefinitionParams)(nil) func (s *DefinitionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DefinitionRequest. type DefinitionRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DefinitionRegistrationOptions)(nil) func (s *DefinitionRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a ReferencesRequest. type ReferenceParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` Context *ReferenceContext `json:"context" lsp:"required"` } func (s *ReferenceParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *ReferenceParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*ReferenceParams)(nil) func (s *ReferenceParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a ReferencesRequest. type ReferenceRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*ReferenceRegistrationOptions)(nil) func (s *ReferenceRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a DocumentHighlightRequest. type DocumentHighlightParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } func (s *DocumentHighlightParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *DocumentHighlightParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*DocumentHighlightParams)(nil) func (s *DocumentHighlightParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A document highlight is a range inside a text document which deserves // special attention. Usually a document highlight is visualized by changing // the background color of its range. type DocumentHighlight struct { // The range this highlight applies to. Range Range `json:"range" lsp:"required"` // The highlight kind, default is text. Kind *DocumentHighlightKind `json:"kind,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentHighlight)(nil) func (s *DocumentHighlight) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DocumentHighlightRequest. type DocumentHighlightRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentHighlightRegistrationOptions)(nil) func (s *DocumentHighlightRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for a DocumentSymbolRequest. type DocumentSymbolParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *DocumentSymbolParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentSymbolParams)(nil) func (s *DocumentSymbolParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents information about programming constructs like variables, classes, // interfaces etc. type SymbolInformation struct { // The name of this symbol. Name string `json:"name" lsp:"required"` // The kind of this symbol. Kind SymbolKind `json:"kind" lsp:"required"` // Tags for this symbol. // // Since: 3.16.0 Tags *[]SymbolTag `json:"tags,omitzero"` // The name of the symbol containing this symbol. This information is for // user interface purposes (e.g. to render a qualifier in the user interface // if necessary). It can't be used to re-infer a hierarchy for the document // symbols. ContainerName *string `json:"containerName,omitzero"` // Indicates if this symbol is deprecated. // // Deprecated: Use tags instead Deprecated *bool `json:"deprecated,omitzero"` // The location of this symbol. The location's range is used by a tool // to reveal the location in the editor. If the symbol is selected in the // tool the range's start information is used to position the cursor. So // the range usually spans more than the actual symbol's name and does // normally include things like visibility modifiers. // // The range doesn't have to denote a node range in the sense of an abstract // syntax tree. It can therefore not be used to re-construct a hierarchy of // the symbols. Location Location `json:"location" lsp:"required"` } var _ json.UnmarshalerFrom = (*SymbolInformation)(nil) func (s *SymbolInformation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents programming constructs like variables, classes, interfaces etc. // that appear in a document. Document symbols can be hierarchical and they // have two ranges: one that encloses its definition and one that points to // its most interesting range, e.g. the range of an identifier. type DocumentSymbol struct { // The name of this symbol. Will be displayed in the user interface and therefore must not be // an empty string or a string only consisting of white spaces. Name string `json:"name" lsp:"required"` // More detail for this symbol, e.g the signature of a function. Detail *string `json:"detail,omitzero"` // The kind of this symbol. Kind SymbolKind `json:"kind" lsp:"required"` // Tags for this document symbol. // // Since: 3.16.0 Tags *[]SymbolTag `json:"tags,omitzero"` // Indicates if this symbol is deprecated. // // Deprecated: Use tags instead Deprecated *bool `json:"deprecated,omitzero"` // The range enclosing this symbol not including leading/trailing whitespace but everything else // like comments. This information is typically used to determine if the clients cursor is // inside the symbol to reveal in the symbol in the UI. Range Range `json:"range" lsp:"required"` // The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. // Must be contained by the `range`. SelectionRange Range `json:"selectionRange" lsp:"required"` // Children of this symbol, e.g. properties of a class. Children *[]*DocumentSymbol `json:"children,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentSymbol)(nil) func (s *DocumentSymbol) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DocumentSymbolRequest. type DocumentSymbolRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A human-readable string that is shown when multiple outlines trees // are shown for the same document. // // Since: 3.16.0 Label *string `json:"label,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentSymbolRegistrationOptions)(nil) func (s *DocumentSymbolRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a CodeActionRequest. type CodeActionParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The document in which the command was invoked. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The range for which the command was invoked. Range Range `json:"range" lsp:"required"` // Context carrying additional information. Context *CodeActionContext `json:"context" lsp:"required"` } func (s *CodeActionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*CodeActionParams)(nil) func (s *CodeActionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a reference to a command. Provides a title which // will be used to represent a command in the UI and, optionally, // an array of arguments which will be passed to the command handler // function when invoked. type Command struct { // Title of the command, like `save`. Title string `json:"title" lsp:"required"` // An optional tooltip. // // Since: 3.18.0 Tooltip *string `json:"tooltip,omitzero"` // The identifier of the actual command handler. Command string `json:"command" lsp:"required"` // Arguments that the command handler should be // invoked with. Arguments *[]any `json:"arguments,omitzero"` } var _ json.UnmarshalerFrom = (*Command)(nil) func (s *Command) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A code action represents a change that can be performed in code, e.g. to fix a problem or // to refactor code. // // A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. type CodeAction struct { // A short, human-readable, title for this code action. Title string `json:"title" lsp:"required"` // The kind of the code action. // // Used to filter code actions. Kind *CodeActionKind `json:"kind,omitzero"` // The diagnostics that this code action resolves. Diagnostics *[]*Diagnostic `json:"diagnostics,omitzero"` // Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted // by keybindings. // // A quick fix should be marked preferred if it properly addresses the underlying error. // A refactoring should be marked preferred if it is the most reasonable choice of actions to take. // // Since: 3.15.0 IsPreferred *bool `json:"isPreferred,omitzero"` // Marks that the code action cannot currently be applied. // // Clients should follow the following guidelines regarding disabled code actions: // // - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) // code action menus. // // - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type // of code action, such as refactorings. // // - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) // that auto applies a code action and only disabled code actions are returned, the client should show the user an // error message with `reason` in the editor. // // Since: 3.16.0 Disabled *CodeActionDisabled `json:"disabled,omitzero"` // The workspace edit this code action performs. Edit *WorkspaceEdit `json:"edit,omitzero"` // A command this code action executes. If a code action // provides an edit and a command, first the edit is // executed and then the command. Command *Command `json:"command,omitzero"` // A data entry field that is preserved on a code action between // a `textDocument/codeAction` and a `codeAction/resolve` request. // // Since: 3.16.0 Data *CodeActionData `json:"data,omitzero"` // Tags for this code action. // // Since: 3.18.0 - proposed Tags *[]CodeActionTag `json:"tags,omitzero"` } var _ json.UnmarshalerFrom = (*CodeAction)(nil) func (s *CodeAction) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a CodeActionRequest. type CodeActionRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // CodeActionKinds that this server may return. // // The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server // may list out every specific kind they provide. CodeActionKinds *[]CodeActionKind `json:"codeActionKinds,omitzero"` // Static documentation for a class of code actions. // // Documentation from the provider should be shown in the code actions menu if either: // // - Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that // most closely matches the requested code action kind. For example, if a provider has documentation for // both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`, // the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`. // // - Any code actions of `kind` are returned by the provider. // // At most one documentation entry should be shown per provider. // // Since: 3.18.0 Documentation *[]*CodeActionKindDocumentation `json:"documentation,omitzero"` // The server provides support to resolve additional // information for a code action. // // Since: 3.16.0 ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*CodeActionRegistrationOptions)(nil) func (s *CodeActionRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a WorkspaceSymbolRequest. type WorkspaceSymbolParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // A query string to filter symbols by. Clients may send an empty // string here to request all symbols. // // The `query`-parameter should be interpreted in a *relaxed way* as editors // will apply their own highlighting and scoring on the results. A good rule // of thumb is to match case-insensitive and to simply check that the // characters of *query* appear in their order in a candidate symbol. // Servers shouldn't use prefix, substring, or similar strict matching. Query string `json:"query" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceSymbolParams)(nil) func (s *WorkspaceSymbolParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A special workspace symbol that supports locations without a range. // // See also SymbolInformation. // // Since: 3.17.0 type WorkspaceSymbol struct { // The name of this symbol. Name string `json:"name" lsp:"required"` // The kind of this symbol. Kind SymbolKind `json:"kind" lsp:"required"` // Tags for this symbol. // // Since: 3.16.0 Tags *[]SymbolTag `json:"tags,omitzero"` // The name of the symbol containing this symbol. This information is for // user interface purposes (e.g. to render a qualifier in the user interface // if necessary). It can't be used to re-infer a hierarchy for the document // symbols. ContainerName *string `json:"containerName,omitzero"` // The location of the symbol. Whether a server is allowed to // return a location without a range depends on the client // capability `workspace.symbol.resolveSupport`. // // See SymbolInformation#location for more details. Location LocationOrLocationUriOnly `json:"location" lsp:"required"` // A data entry field that is preserved on a workspace symbol between a // workspace symbol request and a workspace symbol resolve request. Data *WorkspaceSymbolData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceSymbol)(nil) func (s *WorkspaceSymbol) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a WorkspaceSymbolRequest. type WorkspaceSymbolRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The server provides support to resolve additional // information for a workspace symbol. // // Since: 3.17.0 ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceSymbolRegistrationOptions)(nil) func (s *WorkspaceSymbolRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a CodeLensRequest. type CodeLensParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The document to request code lens for. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *CodeLensParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*CodeLensParams)(nil) func (s *CodeLensParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A code lens represents a command that should be shown along with // source text, like the number of references, a way to run tests, etc. // // A code lens is _unresolved_ when no command is associated to it. For performance // reasons the creation of a code lens and resolving should be done in two stages. type CodeLens struct { // The range in which this code lens is valid. Should only span a single line. Range Range `json:"range" lsp:"required"` // The command this code lens represents. Command *Command `json:"command,omitzero"` // A data entry field that is preserved on a code lens item between // a CodeLensRequest and a CodeLensResolveRequest Data *CodeLensData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*CodeLens)(nil) func (s *CodeLens) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a CodeLensRequest. type CodeLensRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Code lens has a resolve provider as well. ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*CodeLensRegistrationOptions)(nil) func (s *CodeLensRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a DocumentLinkRequest. type DocumentLinkParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` // The document to provide document links for. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *DocumentLinkParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentLinkParams)(nil) func (s *DocumentLinkParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A document link is a range in a text document that links to an internal or external resource, like another // text document or a web site. type DocumentLink struct { // The range this link applies to. Range Range `json:"range" lsp:"required"` // The uri this link points to. If missing a resolve request is sent later. Target *URI `json:"target,omitzero"` // The tooltip text when you hover over this link. // // If a tooltip is provided, is will be displayed in a string that includes instructions on how to // trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS, // user settings, and localization. // // Since: 3.15.0 Tooltip *string `json:"tooltip,omitzero"` // A data entry field that is preserved on a document link between a // DocumentLinkRequest and a DocumentLinkResolveRequest. Data *DocumentLinkData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentLink)(nil) func (s *DocumentLink) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DocumentLinkRequest. type DocumentLinkRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Document links have a resolve provider as well. ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentLinkRegistrationOptions)(nil) func (s *DocumentLinkRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a DocumentFormattingRequest. type DocumentFormattingParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The document to format. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The format options. Options *FormattingOptions `json:"options" lsp:"required"` } func (s *DocumentFormattingParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentFormattingParams)(nil) func (s *DocumentFormattingParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DocumentFormattingRequest. type DocumentFormattingRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentFormattingRegistrationOptions)(nil) func (s *DocumentFormattingRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a DocumentRangeFormattingRequest. type DocumentRangeFormattingParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The document to format. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The range to format Range Range `json:"range" lsp:"required"` // The format options Options *FormattingOptions `json:"options" lsp:"required"` } func (s *DocumentRangeFormattingParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentRangeFormattingParams)(nil) func (s *DocumentRangeFormattingParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DocumentRangeFormattingRequest. type DocumentRangeFormattingRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Whether the server supports formatting multiple ranges at once. // // Since: 3.18.0 RangesSupport *bool `json:"rangesSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentRangeFormattingRegistrationOptions)(nil) func (s *DocumentRangeFormattingRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a DocumentRangesFormattingRequest. // // Since: 3.18.0 type DocumentRangesFormattingParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The document to format. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The ranges to format Ranges []Range `json:"ranges" lsp:"required"` // The format options Options *FormattingOptions `json:"options" lsp:"required"` } func (s *DocumentRangesFormattingParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*DocumentRangesFormattingParams)(nil) func (s *DocumentRangesFormattingParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a DocumentOnTypeFormattingRequest. type DocumentOnTypeFormattingParams struct { // The document to format. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position around which the on type formatting should happen. // This is not necessarily the exact position where the character denoted // by the property `ch` got typed. Position Position `json:"position" lsp:"required"` // The character that has been typed that triggered the formatting // on type request. That is not necessarily the last character that // got inserted into the document since the client could auto insert // characters as well (e.g. like automatic brace completion). Ch string `json:"ch" lsp:"required"` // The formatting options. Options *FormattingOptions `json:"options" lsp:"required"` } func (s *DocumentOnTypeFormattingParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *DocumentOnTypeFormattingParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*DocumentOnTypeFormattingParams)(nil) func (s *DocumentOnTypeFormattingParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a DocumentOnTypeFormattingRequest. type DocumentOnTypeFormattingRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` // A character on which formatting should be triggered, like `{`. FirstTriggerCharacter string `json:"firstTriggerCharacter" lsp:"required"` // More trigger characters. MoreTriggerCharacter *[]string `json:"moreTriggerCharacter,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentOnTypeFormattingRegistrationOptions)(nil) func (s *DocumentOnTypeFormattingRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a RenameRequest. type RenameParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The new name of the symbol. If the given name is not valid the // request must return a ResponseError with an // appropriate message set. NewName string `json:"newName" lsp:"required"` } func (s *RenameParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *RenameParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*RenameParams)(nil) func (s *RenameParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a RenameRequest. type RenameRegistrationOptions struct { // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Renames should be checked and tested before being executed. // // Since: version 3.12.0 PrepareProvider *bool `json:"prepareProvider,omitzero"` } var _ json.UnmarshalerFrom = (*RenameRegistrationOptions)(nil) func (s *RenameRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type PrepareRenameParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` } func (s *PrepareRenameParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *PrepareRenameParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*PrepareRenameParams)(nil) func (s *PrepareRenameParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters of a ExecuteCommandRequest. type ExecuteCommandParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` // The identifier of the actual command handler. Command string `json:"command" lsp:"required"` // Arguments that the command should be invoked with. Arguments *[]any `json:"arguments,omitzero"` } var _ json.UnmarshalerFrom = (*ExecuteCommandParams)(nil) func (s *ExecuteCommandParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Registration options for a ExecuteCommandRequest. type ExecuteCommandRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The commands to be executed on the server Commands []string `json:"commands" lsp:"required"` } var _ json.UnmarshalerFrom = (*ExecuteCommandRegistrationOptions)(nil) func (s *ExecuteCommandRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The parameters passed via an apply workspace edit request. type ApplyWorkspaceEditParams struct { // An optional label of the workspace edit. This label is // presented in the user interface for example on an undo // stack to undo the workspace edit. Label *string `json:"label,omitzero"` // The edits to apply. Edit *WorkspaceEdit `json:"edit" lsp:"required"` // Additional data about the edit. // // Since: 3.18.0 Metadata *WorkspaceEditMetadata `json:"metadata,omitzero"` } var _ json.UnmarshalerFrom = (*ApplyWorkspaceEditParams)(nil) func (s *ApplyWorkspaceEditParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The result returned from the apply workspace edit request. // // Since: 3.17 renamed from ApplyWorkspaceEditResponse type ApplyWorkspaceEditResult struct { // Indicates whether the edit was applied or not. Applied bool `json:"applied" lsp:"required"` // An optional textual description for why the edit was not applied. // This may be used by the server for diagnostic logging or to provide // a suitable error for a request that triggered the edit. FailureReason *string `json:"failureReason,omitzero"` // Depending on the client's failure handling strategy `failedChange` might // contain the index of the change that failed. This property is only available // if the client signals a `failureHandlingStrategy` in its client capabilities. FailedChange *uint32 `json:"failedChange,omitzero"` } var _ json.UnmarshalerFrom = (*ApplyWorkspaceEditResult)(nil) func (s *ApplyWorkspaceEditResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressBegin struct { Kind StringLiteralBegin `json:"kind" lsp:"required"` // Mandatory title of the progress operation. Used to briefly inform about // the kind of operation being performed. // // Examples: "Indexing" or "Linking dependencies". Title string `json:"title" lsp:"required"` // Controls if a cancel button should show to allow the user to cancel the // long running operation. Clients that don't support cancellation are allowed // to ignore the setting. Cancellable *bool `json:"cancellable,omitzero"` // Optional, more detailed associated progress message. Contains // complementary information to the `title`. // // Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". // If unset, the previous progress message (if any) is still valid. Message *string `json:"message,omitzero"` // Optional progress percentage to display (value 100 is considered 100%). // If not provided infinite progress is assumed and clients are allowed // to ignore the `percentage` value in subsequent in report notifications. // // The value should be steadily rising. Clients are free to ignore values // that are not following this rule. The value range is [0, 100]. Percentage *uint32 `json:"percentage,omitzero"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressBegin)(nil) func (s *WorkDoneProgressBegin) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressReport struct { Kind StringLiteralReport `json:"kind" lsp:"required"` // Controls enablement state of a cancel button. // // Clients that don't support cancellation or don't support controlling the button's // enablement state are allowed to ignore the property. Cancellable *bool `json:"cancellable,omitzero"` // Optional, more detailed associated progress message. Contains // complementary information to the `title`. // // Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". // If unset, the previous progress message (if any) is still valid. Message *string `json:"message,omitzero"` // Optional progress percentage to display (value 100 is considered 100%). // If not provided infinite progress is assumed and clients are allowed // to ignore the `percentage` value in subsequent in report notifications. // // The value should be steadily rising. Clients are free to ignore values // that are not following this rule. The value range is [0, 100] Percentage *uint32 `json:"percentage,omitzero"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressReport)(nil) func (s *WorkDoneProgressReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressEnd struct { Kind StringLiteralEnd `json:"kind" lsp:"required"` // Optional, a final message indicating to for example indicate the outcome // of the operation. Message *string `json:"message,omitzero"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressEnd)(nil) func (s *WorkDoneProgressEnd) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type SetTraceParams struct { Value TraceValue `json:"value" lsp:"required"` } var _ json.UnmarshalerFrom = (*SetTraceParams)(nil) func (s *SetTraceParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type LogTraceParams struct { Message string `json:"message" lsp:"required"` Verbose *string `json:"verbose,omitzero"` } var _ json.UnmarshalerFrom = (*LogTraceParams)(nil) func (s *LogTraceParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type CancelParams struct { // The request id to cancel. Id IntegerOrString `json:"id" lsp:"required"` } var _ json.UnmarshalerFrom = (*CancelParams)(nil) func (s *CancelParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type ProgressParams struct { // The progress token provided by the client or server. Token IntegerOrString `json:"token" lsp:"required"` // The progress data. Value WorkDoneProgressBeginOrReportOrEnd `json:"value" lsp:"required"` } var _ json.UnmarshalerFrom = (*ProgressParams)(nil) func (s *ProgressParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A parameter literal used in requests to pass a text document and a position inside that // document. type TextDocumentPositionParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` } func (s *TextDocumentPositionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *TextDocumentPositionParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*TextDocumentPositionParams)(nil) func (s *TextDocumentPositionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkDoneProgressParams struct { // An optional token that a server can use to report work done progress. WorkDoneToken *IntegerOrString `json:"workDoneToken,omitzero"` } var _ json.UnmarshalerFrom = (*WorkDoneProgressParams)(nil) func (s *WorkDoneProgressParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type PartialResultParams struct { // An optional token that a server can use to report partial results (e.g. streaming) to // the client. PartialResultToken *IntegerOrString `json:"partialResultToken,omitzero"` } var _ json.UnmarshalerFrom = (*PartialResultParams)(nil) func (s *PartialResultParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents the connection of two locations. Provides additional metadata over normal locations, // including an origin range. type LocationLink struct { // Span of the origin of this link. // // Used as the underlined span for mouse interaction. Defaults to the word range at // the definition position. OriginSelectionRange *Range `json:"originSelectionRange,omitzero"` // The target resource identifier of this link. TargetUri DocumentUri `json:"targetUri" lsp:"required"` // The full target range of this link. If the target for example is a symbol then target range is the // range enclosing this symbol not including leading/trailing whitespace but everything else // like comments. This information is typically used to highlight the range in the editor. TargetRange Range `json:"targetRange" lsp:"required"` // The range that should be selected and revealed when this link is being followed, e.g the name of a function. // Must be contained by the `targetRange`. See also `DocumentSymbol#range` TargetSelectionRange Range `json:"targetSelectionRange" lsp:"required"` } func (s LocationLink) GetLocation() Location { return Location{ Uri: s.TargetUri, Range: s.TargetRange, } } var _ json.UnmarshalerFrom = (*LocationLink)(nil) func (s *LocationLink) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A range in a text document expressed as (zero-based) start and end positions. // // If you want to specify a range that contains a line including the line ending // character(s) then use an end position denoting the start of the next line. // For example: // ```ts // // { // start: { line: 5, character: 23 } // end : { line 6, character : 0 } // } // // ``` type Range struct { // The range's start position. Start Position `json:"start" lsp:"required"` // The range's end position. End Position `json:"end" lsp:"required"` } var _ json.UnmarshalerFrom = (*Range)(nil) func (s *Range) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } func (s *Range) Compare(other *Range) int { if c := s.Start.Compare(&other.Start); c != 0 { return c } return s.End.Compare(&other.End) } type ImplementationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*ImplementationOptions)(nil) func (s *ImplementationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Static registration options to be returned in the initialize // request. type StaticRegistrationOptions struct { // The id used to register the request. The id can be used to deregister // the request again. See also Registration#id. Id *string `json:"id,omitzero"` } var _ json.UnmarshalerFrom = (*StaticRegistrationOptions)(nil) func (s *StaticRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type TypeDefinitionOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*TypeDefinitionOptions)(nil) func (s *TypeDefinitionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The workspace folder change event. type WorkspaceFoldersChangeEvent struct { // The array of added workspace folders Added []*WorkspaceFolder `json:"added" lsp:"required"` // The array of the removed workspace folders Removed []*WorkspaceFolder `json:"removed" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceFoldersChangeEvent)(nil) func (s *WorkspaceFoldersChangeEvent) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type ConfigurationItem struct { // The scope to get the configuration section for. ScopeUri *URI `json:"scopeUri,omitzero"` // The configuration section asked for. Section *string `json:"section,omitzero"` } var _ json.UnmarshalerFrom = (*ConfigurationItem)(nil) func (s *ConfigurationItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A literal to identify a text document in the client. type TextDocumentIdentifier struct { // The text document's uri. Uri DocumentUri `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentIdentifier)(nil) func (s *TextDocumentIdentifier) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a color in RGBA space. type Color struct { // The red component of this color in the range [0-1]. Red float64 `json:"red" lsp:"required"` // The green component of this color in the range [0-1]. Green float64 `json:"green" lsp:"required"` // The blue component of this color in the range [0-1]. Blue float64 `json:"blue" lsp:"required"` // The alpha component of this color in the range [0-1]. Alpha float64 `json:"alpha" lsp:"required"` } var _ json.UnmarshalerFrom = (*Color)(nil) func (s *Color) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DocumentColorOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentColorOptions)(nil) func (s *DocumentColorOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type FoldingRangeOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*FoldingRangeOptions)(nil) func (s *FoldingRangeOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DeclarationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DeclarationOptions)(nil) func (s *DeclarationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Position in a text document expressed as zero-based line and character // offset. Prior to 3.17 the offsets were always based on a UTF-16 string // representation. So a string of the form `a𐐀b` the character offset of the // character `a` is 0, the character offset of `𐐀` is 1 and the character // offset of b is 3 since `𐐀` is represented using two code units in UTF-16. // Since 3.17 clients and servers can agree on a different string encoding // representation (e.g. UTF-8). The client announces it's supported encoding // via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities). // The value is an array of position encodings the client supports, with // decreasing preference (e.g. the encoding at index `0` is the most preferred // one). To stay backwards compatible the only mandatory encoding is UTF-16 // represented via the string `utf-16`. The server can pick one of the // encodings offered by the client and signals that encoding back to the // client via the initialize result's property // [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value // `utf-16` is missing from the client's capability `general.positionEncodings` // servers can safely assume that the client supports UTF-16. If the server // omits the position encoding in its initialize result the encoding defaults // to the string value `utf-16`. Implementation considerations: since the // conversion from one encoding into another requires the content of the // file / line the conversion is best done where the file is read which is // usually on the server side. // // Positions are line end character agnostic. So you can not specify a position // that denotes `\r|\n` or `\n|` where `|` represents the character offset. // // Since: 3.17.0 - support for negotiated position encoding. type Position struct { // Line position in a document (zero-based). Line uint32 `json:"line" lsp:"required"` // Character offset on a line in a document (zero-based). // // The meaning of this offset is determined by the negotiated // `PositionEncodingKind`. Character uint32 `json:"character" lsp:"required"` } var _ json.UnmarshalerFrom = (*Position)(nil) func (s *Position) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } func (s *Position) Compare(other *Position) int { if c := cmp.Compare(s.Line, other.Line); c != 0 { return c } return cmp.Compare(s.Character, other.Character) } type SelectionRangeOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*SelectionRangeOptions)(nil) func (s *SelectionRangeOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Call hierarchy options used during static registration. // // Since: 3.16.0 type CallHierarchyOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*CallHierarchyOptions)(nil) func (s *CallHierarchyOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The legend used by the server Legend *SemanticTokensLegend `json:"legend" lsp:"required"` // Server supports providing semantic tokens for a specific range // of a document. Range *BooleanOrEmptyObject `json:"range,omitzero"` // Server supports providing semantic tokens for a full document. Full *BooleanOrSemanticTokensFullDelta `json:"full,omitzero"` } var _ json.UnmarshalerFrom = (*SemanticTokensOptions)(nil) func (s *SemanticTokensOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensEdit struct { // The start offset of the edit. Start uint32 `json:"start" lsp:"required"` // The count of elements to remove. DeleteCount uint32 `json:"deleteCount" lsp:"required"` // The elements to insert. Data *[]uint32 `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*SemanticTokensEdit)(nil) func (s *SemanticTokensEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type LinkedEditingRangeOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*LinkedEditingRangeOptions)(nil) func (s *LinkedEditingRangeOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents information on a file/folder create. // // Since: 3.16.0 type FileCreate struct { // A file:// URI for the location of the file/folder being created. Uri string `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*FileCreate)(nil) func (s *FileCreate) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Describes textual changes on a text document. A TextDocumentEdit describes all changes // on a document version Si and after they are applied move the document to version Si+1. // So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any // kind of ordering. However the edits must be non overlapping. type TextDocumentEdit struct { // The text document to change. TextDocument OptionalVersionedTextDocumentIdentifier `json:"textDocument" lsp:"required"` // The edits to be applied. // // Since: 3.16.0 - support for AnnotatedTextEdit. This is guarded using a // client capability. // // Since: 3.18.0 - support for SnippetTextEdit. This is guarded using a // client capability. Edits []TextEditOrAnnotatedTextEditOrSnippetTextEdit `json:"edits" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentEdit)(nil) func (s *TextDocumentEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Create file operation. type CreateFile struct { // A create Kind StringLiteralCreate `json:"kind" lsp:"required"` // An optional annotation identifier describing the operation. // // Since: 3.16.0 AnnotationId *string `json:"annotationId,omitzero"` // The resource to create. Uri DocumentUri `json:"uri" lsp:"required"` // Additional options Options *CreateFileOptions `json:"options,omitzero"` } var _ json.UnmarshalerFrom = (*CreateFile)(nil) func (s *CreateFile) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Rename file operation type RenameFile struct { // A rename Kind StringLiteralRename `json:"kind" lsp:"required"` // An optional annotation identifier describing the operation. // // Since: 3.16.0 AnnotationId *string `json:"annotationId,omitzero"` // The old (existing) location. OldUri DocumentUri `json:"oldUri" lsp:"required"` // The new location. NewUri DocumentUri `json:"newUri" lsp:"required"` // Rename options. Options *RenameFileOptions `json:"options,omitzero"` } var _ json.UnmarshalerFrom = (*RenameFile)(nil) func (s *RenameFile) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Delete file operation type DeleteFile struct { // A delete Kind StringLiteralDelete `json:"kind" lsp:"required"` // An optional annotation identifier describing the operation. // // Since: 3.16.0 AnnotationId *string `json:"annotationId,omitzero"` // The file to delete. Uri DocumentUri `json:"uri" lsp:"required"` // Delete options. Options *DeleteFileOptions `json:"options,omitzero"` } var _ json.UnmarshalerFrom = (*DeleteFile)(nil) func (s *DeleteFile) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Additional information that describes document changes. // // Since: 3.16.0 type ChangeAnnotation struct { // A human-readable string describing the actual change. The string // is rendered prominent in the user interface. Label string `json:"label" lsp:"required"` // A flag which indicates that user confirmation is needed // before applying the change. NeedsConfirmation *bool `json:"needsConfirmation,omitzero"` // A human-readable string which is rendered less prominent in // the user interface. Description *string `json:"description,omitzero"` } var _ json.UnmarshalerFrom = (*ChangeAnnotation)(nil) func (s *ChangeAnnotation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A filter to describe in which file operation requests or notifications // the server is interested in receiving. // // Since: 3.16.0 type FileOperationFilter struct { // A Uri scheme like `file` or `untitled`. Scheme *string `json:"scheme,omitzero"` // The actual file operation pattern. Pattern *FileOperationPattern `json:"pattern" lsp:"required"` } var _ json.UnmarshalerFrom = (*FileOperationFilter)(nil) func (s *FileOperationFilter) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents information on a file/folder rename. // // Since: 3.16.0 type FileRename struct { // A file:// URI for the original location of the file/folder being renamed. OldUri string `json:"oldUri" lsp:"required"` // A file:// URI for the new location of the file/folder being renamed. NewUri string `json:"newUri" lsp:"required"` } var _ json.UnmarshalerFrom = (*FileRename)(nil) func (s *FileRename) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents information on a file/folder delete. // // Since: 3.16.0 type FileDelete struct { // A file:// URI for the location of the file/folder being deleted. Uri string `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*FileDelete)(nil) func (s *FileDelete) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type MonikerOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*MonikerOptions)(nil) func (s *MonikerOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Type hierarchy options used during static registration. // // Since: 3.17.0 type TypeHierarchyOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*TypeHierarchyOptions)(nil) func (s *TypeHierarchyOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.17.0 type InlineValueContext struct { // The stack frame (as a DAP Id) where the execution has stopped. FrameId int32 `json:"frameId" lsp:"required"` // The document range where execution has stopped. // Typically the end position of the range denotes the line where the inline values are shown. StoppedLocation Range `json:"stoppedLocation" lsp:"required"` } var _ json.UnmarshalerFrom = (*InlineValueContext)(nil) func (s *InlineValueContext) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Returns inline value information as the complete text to be shown. // // Since: 3.17.0 type InlineValueText struct { // The document range for which the inline value applies. Range Range `json:"range" lsp:"required"` // The text of the inline value. Text string `json:"text" lsp:"required"` } var _ json.UnmarshalerFrom = (*InlineValueText)(nil) func (s *InlineValueText) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // To compute inline value through a variable lookup. // // If only a range is specified, the variable name should // be extracted from the underlying document. // // An optional variable name could be used to lookup instead // of the extracted name. // // Since: 3.17.0 type InlineValueVariableLookup struct { // The document range for which the inline value applies. // // The range could be used to extract the variable name // from the underlying document. Range Range `json:"range" lsp:"required"` // If specified the name of the variable to look up. VariableName *string `json:"variableName,omitzero"` // How to perform the lookup. CaseSensitiveLookup bool `json:"caseSensitiveLookup" lsp:"required"` } var _ json.UnmarshalerFrom = (*InlineValueVariableLookup)(nil) func (s *InlineValueVariableLookup) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // To compute an inline value through an expression evaluation. // // If only a range is specified, the expression should be // extracted from the underlying document. // // An optional expression could be evaluated instead of // the extracted expression. // // Since: 3.17.0 type InlineValueEvaluatableExpression struct { // The document range for which the inline value applies. // // The range could be used to extract the evaluatable expression // from the underlying document. Range Range `json:"range" lsp:"required"` // If specified the expression could be evaluated instead. Expression *string `json:"expression,omitzero"` } var _ json.UnmarshalerFrom = (*InlineValueEvaluatableExpression)(nil) func (s *InlineValueEvaluatableExpression) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inline value options used during static registration. // // Since: 3.17.0 type InlineValueOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*InlineValueOptions)(nil) func (s *InlineValueOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An inlay hint label part allows for interactive and composite labels // of inlay hints. // // Since: 3.17.0 type InlayHintLabelPart struct { // The value of this label part. Value string `json:"value" lsp:"required"` // The tooltip text when you hover over this label part. Depending on // the client capability `inlayHint.resolveSupport` clients might resolve // this property late using the resolve request. Tooltip *StringOrMarkupContent `json:"tooltip,omitzero"` // An optional source code location that represents this // label part. // // The editor will use this location for the hover and for code navigation // features: This part will become a clickable link that resolves to the // definition of the symbol at the given location (not necessarily the // location itself), it shows the hover that shows at the given location, // and it shows a context menu with further code navigation commands. // // Depending on the client capability `inlayHint.resolveSupport` clients // might resolve this property late using the resolve request. Location *Location `json:"location,omitzero"` // An optional command for this label part. // // Depending on the client capability `inlayHint.resolveSupport` clients // might resolve this property late using the resolve request. Command *Command `json:"command,omitzero"` } var _ json.UnmarshalerFrom = (*InlayHintLabelPart)(nil) func (s *InlayHintLabelPart) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A `MarkupContent` literal represents a string value which content is interpreted base on its // kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds. // // If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues. // See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting // // Here is an example how such a string can be constructed using JavaScript / TypeScript: // ```ts // // let markdown: MarkdownContent = { // kind: MarkupKind.Markdown, // value: [ // '# Header', // 'Some text', // '```typescript', // 'someCode();', // '```' // ].join('\n') // }; // // ``` // // *Please Note* that clients might sanitize the return markdown. A client could decide to // remove HTML from the markdown to avoid script execution. type MarkupContent struct { // The type of the Markup Kind MarkupKind `json:"kind" lsp:"required"` // The content itself Value string `json:"value" lsp:"required"` } var _ json.UnmarshalerFrom = (*MarkupContent)(nil) func (s *MarkupContent) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inlay hint options used during static registration. // // Since: 3.17.0 type InlayHintOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The server provides support to resolve additional // information for an inlay hint item. ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*InlayHintOptions)(nil) func (s *InlayHintOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A full diagnostic report with a set of related documents. // // Since: 3.17.0 type RelatedFullDocumentDiagnosticReport struct { // A full document diagnostic report. Kind StringLiteralFull `json:"kind" lsp:"required"` // An optional result id. If provided it will // be sent on the next diagnostic request for the // same document. ResultId *string `json:"resultId,omitzero"` // The actual items. Items []*Diagnostic `json:"items" lsp:"required"` // Diagnostics of related documents. This information is useful // in programming languages where code in a file A can generate // diagnostics in a file B which A depends on. An example of // such a language is C/C++ where marco definitions in a file // a.cpp and result in errors in a header file b.hpp. // // Since: 3.17.0 RelatedDocuments *map[DocumentUri]FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport `json:"relatedDocuments,omitzero"` } var _ json.UnmarshalerFrom = (*RelatedFullDocumentDiagnosticReport)(nil) func (s *RelatedFullDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An unchanged diagnostic report with a set of related documents. // // Since: 3.17.0 type RelatedUnchangedDocumentDiagnosticReport struct { // A document diagnostic report indicating // no changes to the last result. A server can // only return `unchanged` if result ids are // provided. Kind StringLiteralUnchanged `json:"kind" lsp:"required"` // A result id which will be sent on the next // diagnostic request for the same document. ResultId string `json:"resultId" lsp:"required"` // Diagnostics of related documents. This information is useful // in programming languages where code in a file A can generate // diagnostics in a file B which A depends on. An example of // such a language is C/C++ where marco definitions in a file // a.cpp and result in errors in a header file b.hpp. // // Since: 3.17.0 RelatedDocuments *map[DocumentUri]FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport `json:"relatedDocuments,omitzero"` } var _ json.UnmarshalerFrom = (*RelatedUnchangedDocumentDiagnosticReport)(nil) func (s *RelatedUnchangedDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A partial result for a document diagnostic report. // // Since: 3.17.0 type DocumentDiagnosticReportPartialResult struct { RelatedDocuments map[DocumentUri]FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport `json:"relatedDocuments" lsp:"required"` } var _ json.UnmarshalerFrom = (*DocumentDiagnosticReportPartialResult)(nil) func (s *DocumentDiagnosticReportPartialResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Diagnostic options. // // Since: 3.17.0 type DiagnosticOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // An optional identifier under which the diagnostics are // managed by the client. Identifier *string `json:"identifier,omitzero"` // Whether the language has inter file dependencies meaning that // editing code in one file can result in a different diagnostic // set in another file. Inter file dependencies are common for // most programming languages and typically uncommon for linters. InterFileDependencies bool `json:"interFileDependencies" lsp:"required"` // The server provides support for workspace diagnostics as well. WorkspaceDiagnostics bool `json:"workspaceDiagnostics" lsp:"required"` } var _ json.UnmarshalerFrom = (*DiagnosticOptions)(nil) func (s *DiagnosticOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A previous result id in a workspace pull request. // // Since: 3.17.0 type PreviousResultId struct { // The URI for which the client knowns a // result id. Uri DocumentUri `json:"uri" lsp:"required"` // The value of the previous result id. Value string `json:"value" lsp:"required"` } var _ json.UnmarshalerFrom = (*PreviousResultId)(nil) func (s *PreviousResultId) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An item to transfer a text document from the client to the // server. type TextDocumentItem struct { // The text document's uri. Uri DocumentUri `json:"uri" lsp:"required"` // The text document's language identifier. LanguageId LanguageKind `json:"languageId" lsp:"required"` // The version number of this document (it will increase after each // change, including undo/redo). Version int32 `json:"version" lsp:"required"` // The content of the opened text document. Text string `json:"text" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentItem)(nil) func (s *TextDocumentItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provides information about the context in which an inline completion was requested. // // Since: 3.18.0 type InlineCompletionContext struct { // Describes how the inline completion was triggered. TriggerKind InlineCompletionTriggerKind `json:"triggerKind" lsp:"required"` // Provides information about the currently selected item in the autocomplete widget if it is visible. SelectedCompletionInfo *SelectedCompletionInfo `json:"selectedCompletionInfo,omitzero"` } var _ json.UnmarshalerFrom = (*InlineCompletionContext)(nil) func (s *InlineCompletionContext) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A string value used as a snippet is a template which allows to insert text // and to control the editor cursor when insertion happens. // // A snippet can define tab stops and placeholders with `$1`, `$2` // and `${3:foo}`. `$0` defines the final tab stop, it defaults to // the end of the snippet. Variables are defined with `$name` and // `${name:default value}`. // // Since: 3.18.0 type StringValue struct { // The kind of string value. Kind StringLiteralSnippet `json:"kind" lsp:"required"` // The snippet string. Value string `json:"value" lsp:"required"` } var _ json.UnmarshalerFrom = (*StringValue)(nil) func (s *StringValue) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inline completion options used during static registration. // // Since: 3.18.0 type InlineCompletionOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*InlineCompletionOptions)(nil) func (s *InlineCompletionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Text document content provider options. // // Since: 3.18.0 type TextDocumentContentOptions struct { // The schemes for which the server provides content. Schemes []string `json:"schemes" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentContentOptions)(nil) func (s *TextDocumentContentOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // General parameters to register for a notification or to register a provider. type Registration struct { // The id used to register the request. The id can be used to deregister // the request again. Id string `json:"id" lsp:"required"` // Options necessary for the registration. Determines the method. RegisterOptions *RegisterOptions `json:"-"` } // RegisterOptions is an externally-tagged union representing the options for a capability registration. // Exactly one field should be set. The set field determines the method for the registration. type RegisterOptions struct { TextDocumentImplementation *ImplementationRegistrationOptions TextDocumentTypeDefinition *TypeDefinitionRegistrationOptions TextDocumentDocumentColor *DocumentColorRegistrationOptions TextDocumentColorPresentation *ColorPresentationRegistrationOptions TextDocumentFoldingRange *FoldingRangeRegistrationOptions TextDocumentDeclaration *DeclarationRegistrationOptions TextDocumentSelectionRange *SelectionRangeRegistrationOptions TextDocumentPrepareCallHierarchy *CallHierarchyRegistrationOptions TextDocumentSemanticTokens *SemanticTokensRegistrationOptions TextDocumentLinkedEditingRange *LinkedEditingRangeRegistrationOptions WorkspaceWillCreateFiles *FileOperationRegistrationOptions WorkspaceWillRenameFiles *FileOperationRegistrationOptions WorkspaceWillDeleteFiles *FileOperationRegistrationOptions TextDocumentMoniker *MonikerRegistrationOptions TextDocumentPrepareTypeHierarchy *TypeHierarchyRegistrationOptions TextDocumentInlineValue *InlineValueRegistrationOptions TextDocumentInlayHint *InlayHintRegistrationOptions TextDocumentDiagnostic *DiagnosticRegistrationOptions TextDocumentInlineCompletion *InlineCompletionRegistrationOptions WorkspaceTextDocumentContent *TextDocumentContentRegistrationOptions TextDocumentWillSaveWaitUntil *TextDocumentRegistrationOptions TextDocumentCompletion *CompletionRegistrationOptions TextDocumentHover *HoverRegistrationOptions TextDocumentSignatureHelp *SignatureHelpRegistrationOptions TextDocumentDefinition *DefinitionRegistrationOptions TextDocumentReferences *ReferenceRegistrationOptions TextDocumentDocumentHighlight *DocumentHighlightRegistrationOptions TextDocumentDocumentSymbol *DocumentSymbolRegistrationOptions TextDocumentCodeAction *CodeActionRegistrationOptions WorkspaceSymbol *WorkspaceSymbolRegistrationOptions TextDocumentCodeLens *CodeLensRegistrationOptions TextDocumentDocumentLink *DocumentLinkRegistrationOptions TextDocumentFormatting *DocumentFormattingRegistrationOptions TextDocumentRangeFormatting *DocumentRangeFormattingRegistrationOptions TextDocumentRangesFormatting *DocumentRangeFormattingRegistrationOptions TextDocumentOnTypeFormatting *DocumentOnTypeFormattingRegistrationOptions TextDocumentRename *RenameRegistrationOptions WorkspaceExecuteCommand *ExecuteCommandRegistrationOptions WorkspaceDidCreateFiles *FileOperationRegistrationOptions WorkspaceDidRenameFiles *FileOperationRegistrationOptions WorkspaceDidDeleteFiles *FileOperationRegistrationOptions WorkspaceDidChangeConfiguration *DidChangeConfigurationRegistrationOptions TextDocumentDidOpen *TextDocumentRegistrationOptions TextDocumentDidChange *TextDocumentChangeRegistrationOptions TextDocumentDidClose *TextDocumentRegistrationOptions TextDocumentDidSave *TextDocumentSaveRegistrationOptions TextDocumentWillSave *TextDocumentRegistrationOptions WorkspaceDidChangeWatchedFiles *DidChangeWatchedFilesRegistrationOptions } var _ json.MarshalerTo = (*Registration)(nil) func (s *Registration) MarshalJSONTo(enc *json.Encoder) error { if s.RegisterOptions == nil { panic("RegisterOptions must be set") } assertOnlyOne("exactly one element of RegisterOptions should be set", countNonNil(s.RegisterOptions)) if err := enc.WriteToken(json.BeginObject); err != nil { return err } if err := enc.WriteValue(json.Value(`"id"`)); err != nil { return err } if err := json.MarshalEncode(enc, s.Id); err != nil { return err } if err := enc.WriteValue(json.Value(`"method"`)); err != nil { return err } var method json.Value var opts any switch { case s.RegisterOptions.TextDocumentImplementation != nil: method = json.Value(`"textDocument/implementation"`) opts = s.RegisterOptions.TextDocumentImplementation case s.RegisterOptions.TextDocumentTypeDefinition != nil: method = json.Value(`"textDocument/typeDefinition"`) opts = s.RegisterOptions.TextDocumentTypeDefinition case s.RegisterOptions.TextDocumentDocumentColor != nil: method = json.Value(`"textDocument/documentColor"`) opts = s.RegisterOptions.TextDocumentDocumentColor case s.RegisterOptions.TextDocumentColorPresentation != nil: method = json.Value(`"textDocument/colorPresentation"`) opts = s.RegisterOptions.TextDocumentColorPresentation case s.RegisterOptions.TextDocumentFoldingRange != nil: method = json.Value(`"textDocument/foldingRange"`) opts = s.RegisterOptions.TextDocumentFoldingRange case s.RegisterOptions.TextDocumentDeclaration != nil: method = json.Value(`"textDocument/declaration"`) opts = s.RegisterOptions.TextDocumentDeclaration case s.RegisterOptions.TextDocumentSelectionRange != nil: method = json.Value(`"textDocument/selectionRange"`) opts = s.RegisterOptions.TextDocumentSelectionRange case s.RegisterOptions.TextDocumentPrepareCallHierarchy != nil: method = json.Value(`"textDocument/prepareCallHierarchy"`) opts = s.RegisterOptions.TextDocumentPrepareCallHierarchy case s.RegisterOptions.TextDocumentSemanticTokens != nil: method = json.Value(`"textDocument/semanticTokens"`) opts = s.RegisterOptions.TextDocumentSemanticTokens case s.RegisterOptions.TextDocumentLinkedEditingRange != nil: method = json.Value(`"textDocument/linkedEditingRange"`) opts = s.RegisterOptions.TextDocumentLinkedEditingRange case s.RegisterOptions.WorkspaceWillCreateFiles != nil: method = json.Value(`"workspace/willCreateFiles"`) opts = s.RegisterOptions.WorkspaceWillCreateFiles case s.RegisterOptions.WorkspaceWillRenameFiles != nil: method = json.Value(`"workspace/willRenameFiles"`) opts = s.RegisterOptions.WorkspaceWillRenameFiles case s.RegisterOptions.WorkspaceWillDeleteFiles != nil: method = json.Value(`"workspace/willDeleteFiles"`) opts = s.RegisterOptions.WorkspaceWillDeleteFiles case s.RegisterOptions.TextDocumentMoniker != nil: method = json.Value(`"textDocument/moniker"`) opts = s.RegisterOptions.TextDocumentMoniker case s.RegisterOptions.TextDocumentPrepareTypeHierarchy != nil: method = json.Value(`"textDocument/prepareTypeHierarchy"`) opts = s.RegisterOptions.TextDocumentPrepareTypeHierarchy case s.RegisterOptions.TextDocumentInlineValue != nil: method = json.Value(`"textDocument/inlineValue"`) opts = s.RegisterOptions.TextDocumentInlineValue case s.RegisterOptions.TextDocumentInlayHint != nil: method = json.Value(`"textDocument/inlayHint"`) opts = s.RegisterOptions.TextDocumentInlayHint case s.RegisterOptions.TextDocumentDiagnostic != nil: method = json.Value(`"textDocument/diagnostic"`) opts = s.RegisterOptions.TextDocumentDiagnostic case s.RegisterOptions.TextDocumentInlineCompletion != nil: method = json.Value(`"textDocument/inlineCompletion"`) opts = s.RegisterOptions.TextDocumentInlineCompletion case s.RegisterOptions.WorkspaceTextDocumentContent != nil: method = json.Value(`"workspace/textDocumentContent"`) opts = s.RegisterOptions.WorkspaceTextDocumentContent case s.RegisterOptions.TextDocumentWillSaveWaitUntil != nil: method = json.Value(`"textDocument/willSaveWaitUntil"`) opts = s.RegisterOptions.TextDocumentWillSaveWaitUntil case s.RegisterOptions.TextDocumentCompletion != nil: method = json.Value(`"textDocument/completion"`) opts = s.RegisterOptions.TextDocumentCompletion case s.RegisterOptions.TextDocumentHover != nil: method = json.Value(`"textDocument/hover"`) opts = s.RegisterOptions.TextDocumentHover case s.RegisterOptions.TextDocumentSignatureHelp != nil: method = json.Value(`"textDocument/signatureHelp"`) opts = s.RegisterOptions.TextDocumentSignatureHelp case s.RegisterOptions.TextDocumentDefinition != nil: method = json.Value(`"textDocument/definition"`) opts = s.RegisterOptions.TextDocumentDefinition case s.RegisterOptions.TextDocumentReferences != nil: method = json.Value(`"textDocument/references"`) opts = s.RegisterOptions.TextDocumentReferences case s.RegisterOptions.TextDocumentDocumentHighlight != nil: method = json.Value(`"textDocument/documentHighlight"`) opts = s.RegisterOptions.TextDocumentDocumentHighlight case s.RegisterOptions.TextDocumentDocumentSymbol != nil: method = json.Value(`"textDocument/documentSymbol"`) opts = s.RegisterOptions.TextDocumentDocumentSymbol case s.RegisterOptions.TextDocumentCodeAction != nil: method = json.Value(`"textDocument/codeAction"`) opts = s.RegisterOptions.TextDocumentCodeAction case s.RegisterOptions.WorkspaceSymbol != nil: method = json.Value(`"workspace/symbol"`) opts = s.RegisterOptions.WorkspaceSymbol case s.RegisterOptions.TextDocumentCodeLens != nil: method = json.Value(`"textDocument/codeLens"`) opts = s.RegisterOptions.TextDocumentCodeLens case s.RegisterOptions.TextDocumentDocumentLink != nil: method = json.Value(`"textDocument/documentLink"`) opts = s.RegisterOptions.TextDocumentDocumentLink case s.RegisterOptions.TextDocumentFormatting != nil: method = json.Value(`"textDocument/formatting"`) opts = s.RegisterOptions.TextDocumentFormatting case s.RegisterOptions.TextDocumentRangeFormatting != nil: method = json.Value(`"textDocument/rangeFormatting"`) opts = s.RegisterOptions.TextDocumentRangeFormatting case s.RegisterOptions.TextDocumentRangesFormatting != nil: method = json.Value(`"textDocument/rangesFormatting"`) opts = s.RegisterOptions.TextDocumentRangesFormatting case s.RegisterOptions.TextDocumentOnTypeFormatting != nil: method = json.Value(`"textDocument/onTypeFormatting"`) opts = s.RegisterOptions.TextDocumentOnTypeFormatting case s.RegisterOptions.TextDocumentRename != nil: method = json.Value(`"textDocument/rename"`) opts = s.RegisterOptions.TextDocumentRename case s.RegisterOptions.WorkspaceExecuteCommand != nil: method = json.Value(`"workspace/executeCommand"`) opts = s.RegisterOptions.WorkspaceExecuteCommand case s.RegisterOptions.WorkspaceDidCreateFiles != nil: method = json.Value(`"workspace/didCreateFiles"`) opts = s.RegisterOptions.WorkspaceDidCreateFiles case s.RegisterOptions.WorkspaceDidRenameFiles != nil: method = json.Value(`"workspace/didRenameFiles"`) opts = s.RegisterOptions.WorkspaceDidRenameFiles case s.RegisterOptions.WorkspaceDidDeleteFiles != nil: method = json.Value(`"workspace/didDeleteFiles"`) opts = s.RegisterOptions.WorkspaceDidDeleteFiles case s.RegisterOptions.WorkspaceDidChangeConfiguration != nil: method = json.Value(`"workspace/didChangeConfiguration"`) opts = s.RegisterOptions.WorkspaceDidChangeConfiguration case s.RegisterOptions.TextDocumentDidOpen != nil: method = json.Value(`"textDocument/didOpen"`) opts = s.RegisterOptions.TextDocumentDidOpen case s.RegisterOptions.TextDocumentDidChange != nil: method = json.Value(`"textDocument/didChange"`) opts = s.RegisterOptions.TextDocumentDidChange case s.RegisterOptions.TextDocumentDidClose != nil: method = json.Value(`"textDocument/didClose"`) opts = s.RegisterOptions.TextDocumentDidClose case s.RegisterOptions.TextDocumentDidSave != nil: method = json.Value(`"textDocument/didSave"`) opts = s.RegisterOptions.TextDocumentDidSave case s.RegisterOptions.TextDocumentWillSave != nil: method = json.Value(`"textDocument/willSave"`) opts = s.RegisterOptions.TextDocumentWillSave case s.RegisterOptions.WorkspaceDidChangeWatchedFiles != nil: method = json.Value(`"workspace/didChangeWatchedFiles"`) opts = s.RegisterOptions.WorkspaceDidChangeWatchedFiles } if err := enc.WriteValue(method); err != nil { return err } if err := enc.WriteValue(json.Value(`"registerOptions"`)); err != nil { return err } if err := json.MarshalEncode(enc, opts); err != nil { return err } return enc.WriteToken(json.EndObject) } var _ json.UnmarshalerFrom = (*Registration)(nil) func (s *Registration) UnmarshalJSONFrom(dec *json.Decoder) error { *s = Registration{} const ( missingId uint = 1 << iota missingMethod _missingLast ) missing := _missingLast - 1 if k := dec.PeekKind(); k != '{' { return errNotObject(k) } if _, err := dec.ReadToken(); err != nil { return err } var method string var rawRegisterOptions json.Value for dec.PeekKind() != '}' { name, err := dec.ReadValue() if err != nil { return err } switch string(name) { case `"id"`: missing &^= missingId if err := json.UnmarshalDecode(dec, &s.Id); err != nil { return err } case `"method"`: missing &^= missingMethod if err := json.UnmarshalDecode(dec, &method); err != nil { return err } case `"registerOptions"`: v, err := dec.ReadValue() if err != nil { return err } rawRegisterOptions = v default: if err := dec.SkipValue(); err != nil { return err } } } if _, err := dec.ReadToken(); err != nil { return err } if missing != 0 { var missingProps []string if missing&missingId != 0 { missingProps = append(missingProps, "id") } if missing&missingMethod != 0 { missingProps = append(missingProps, "method") } return errMissing(missingProps) } if len(rawRegisterOptions) > 0 { s.RegisterOptions = &RegisterOptions{} switch Method(method) { case MethodTextDocumentImplementation: var v ImplementationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentImplementation = &v case MethodTextDocumentTypeDefinition: var v TypeDefinitionRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentTypeDefinition = &v case MethodTextDocumentDocumentColor: var v DocumentColorRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDocumentColor = &v case MethodTextDocumentColorPresentation: var v ColorPresentationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentColorPresentation = &v case MethodTextDocumentFoldingRange: var v FoldingRangeRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentFoldingRange = &v case MethodTextDocumentDeclaration: var v DeclarationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDeclaration = &v case MethodTextDocumentSelectionRange: var v SelectionRangeRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentSelectionRange = &v case MethodTextDocumentPrepareCallHierarchy: var v CallHierarchyRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentPrepareCallHierarchy = &v case MethodTextDocumentSemanticTokens: var v SemanticTokensRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentSemanticTokens = &v case MethodTextDocumentLinkedEditingRange: var v LinkedEditingRangeRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentLinkedEditingRange = &v case MethodWorkspaceWillCreateFiles: var v FileOperationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceWillCreateFiles = &v case MethodWorkspaceWillRenameFiles: var v FileOperationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceWillRenameFiles = &v case MethodWorkspaceWillDeleteFiles: var v FileOperationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceWillDeleteFiles = &v case MethodTextDocumentMoniker: var v MonikerRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentMoniker = &v case MethodTextDocumentPrepareTypeHierarchy: var v TypeHierarchyRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentPrepareTypeHierarchy = &v case MethodTextDocumentInlineValue: var v InlineValueRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentInlineValue = &v case MethodTextDocumentInlayHint: var v InlayHintRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentInlayHint = &v case MethodTextDocumentDiagnostic: var v DiagnosticRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDiagnostic = &v case MethodTextDocumentInlineCompletion: var v InlineCompletionRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentInlineCompletion = &v case MethodWorkspaceTextDocumentContent: var v TextDocumentContentRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceTextDocumentContent = &v case MethodTextDocumentWillSaveWaitUntil: var v TextDocumentRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentWillSaveWaitUntil = &v case MethodTextDocumentCompletion: var v CompletionRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentCompletion = &v case MethodTextDocumentHover: var v HoverRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentHover = &v case MethodTextDocumentSignatureHelp: var v SignatureHelpRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentSignatureHelp = &v case MethodTextDocumentDefinition: var v DefinitionRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDefinition = &v case MethodTextDocumentReferences: var v ReferenceRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentReferences = &v case MethodTextDocumentDocumentHighlight: var v DocumentHighlightRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDocumentHighlight = &v case MethodTextDocumentDocumentSymbol: var v DocumentSymbolRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDocumentSymbol = &v case MethodTextDocumentCodeAction: var v CodeActionRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentCodeAction = &v case MethodWorkspaceSymbol: var v WorkspaceSymbolRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceSymbol = &v case MethodTextDocumentCodeLens: var v CodeLensRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentCodeLens = &v case MethodTextDocumentDocumentLink: var v DocumentLinkRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDocumentLink = &v case MethodTextDocumentFormatting: var v DocumentFormattingRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentFormatting = &v case MethodTextDocumentRangeFormatting: var v DocumentRangeFormattingRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentRangeFormatting = &v case MethodTextDocumentRangesFormatting: var v DocumentRangeFormattingRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentRangesFormatting = &v case MethodTextDocumentOnTypeFormatting: var v DocumentOnTypeFormattingRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentOnTypeFormatting = &v case MethodTextDocumentRename: var v RenameRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentRename = &v case MethodWorkspaceExecuteCommand: var v ExecuteCommandRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceExecuteCommand = &v case MethodWorkspaceDidCreateFiles: var v FileOperationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceDidCreateFiles = &v case MethodWorkspaceDidRenameFiles: var v FileOperationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceDidRenameFiles = &v case MethodWorkspaceDidDeleteFiles: var v FileOperationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceDidDeleteFiles = &v case MethodWorkspaceDidChangeConfiguration: var v DidChangeConfigurationRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceDidChangeConfiguration = &v case MethodTextDocumentDidOpen: var v TextDocumentRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDidOpen = &v case MethodTextDocumentDidChange: var v TextDocumentChangeRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDidChange = &v case MethodTextDocumentDidClose: var v TextDocumentRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDidClose = &v case MethodTextDocumentDidSave: var v TextDocumentSaveRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentDidSave = &v case MethodTextDocumentWillSave: var v TextDocumentRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.TextDocumentWillSave = &v case MethodWorkspaceDidChangeWatchedFiles: var v DidChangeWatchedFilesRegistrationOptions if err := json.Unmarshal(rawRegisterOptions, &v); err != nil { return err } s.RegisterOptions.WorkspaceDidChangeWatchedFiles = &v default: return fmt.Errorf("unknown registration method: %s", method) } } else { return fmt.Errorf("missing registerOptions for method: %s", method) } return nil } // General parameters to unregister a request or notification. type Unregistration struct { // The id used to unregister the request or notification. Usually an id // provided during the register request. Id string `json:"id" lsp:"required"` // The method to unregister for. Method string `json:"method" lsp:"required"` } var _ json.UnmarshalerFrom = (*Unregistration)(nil) func (s *Unregistration) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkspaceFoldersInitializeParams struct { // The workspace folders configured in the client when the server starts. // // This property is only available if the client supports workspace folders. // It can be `null` if the client supports workspace folders but none are // configured. // // Since: 3.6.0 WorkspaceFolders *WorkspaceFoldersOrNull `json:"workspaceFolders,omitzero" lsp:"nullable"` } // Defines the capabilities provided by a language // server. type ServerCapabilities struct { // The position encoding the server picked from the encodings offered // by the client via the client capability `general.positionEncodings`. // // If the client didn't provide any position encodings the only valid // value that a server can return is 'utf-16'. // // If omitted it defaults to 'utf-16'. // // Since: 3.17.0 PositionEncoding *PositionEncodingKind `json:"positionEncoding,omitzero"` // Defines how text documents are synced. Is either a detailed structure // defining each notification or for backwards compatibility the // TextDocumentSyncKind number. TextDocumentSync *TextDocumentSyncOptionsOrKind `json:"textDocumentSync,omitzero"` // The server provides completion support. CompletionProvider *CompletionOptions `json:"completionProvider,omitzero"` // The server provides hover support. HoverProvider *BooleanOrHoverOptions `json:"hoverProvider,omitzero"` // The server provides signature help support. SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitzero"` // The server provides Goto Declaration support. DeclarationProvider *BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions `json:"declarationProvider,omitzero"` // The server provides goto definition support. DefinitionProvider *BooleanOrDefinitionOptions `json:"definitionProvider,omitzero"` // The server provides Goto Type Definition support. TypeDefinitionProvider *BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions `json:"typeDefinitionProvider,omitzero"` // The server provides Goto Implementation support. ImplementationProvider *BooleanOrImplementationOptionsOrImplementationRegistrationOptions `json:"implementationProvider,omitzero"` // The server provides find references support. ReferencesProvider *BooleanOrReferenceOptions `json:"referencesProvider,omitzero"` // The server provides document highlight support. DocumentHighlightProvider *BooleanOrDocumentHighlightOptions `json:"documentHighlightProvider,omitzero"` // The server provides document symbol support. DocumentSymbolProvider *BooleanOrDocumentSymbolOptions `json:"documentSymbolProvider,omitzero"` // The server provides code actions. CodeActionOptions may only be // specified if the client states that it supports // `codeActionLiteralSupport` in its initial `initialize` request. CodeActionProvider *BooleanOrCodeActionOptions `json:"codeActionProvider,omitzero"` // The server provides code lens. CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitzero"` // The server provides document link support. DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitzero"` // The server provides color provider support. ColorProvider *BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions `json:"colorProvider,omitzero"` // The server provides workspace symbol support. WorkspaceSymbolProvider *BooleanOrWorkspaceSymbolOptions `json:"workspaceSymbolProvider,omitzero"` // The server provides document formatting. DocumentFormattingProvider *BooleanOrDocumentFormattingOptions `json:"documentFormattingProvider,omitzero"` // The server provides document range formatting. DocumentRangeFormattingProvider *BooleanOrDocumentRangeFormattingOptions `json:"documentRangeFormattingProvider,omitzero"` // The server provides document formatting on typing. DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitzero"` // The server provides rename support. RenameOptions may only be // specified if the client states that it supports // `prepareSupport` in its initial `initialize` request. RenameProvider *BooleanOrRenameOptions `json:"renameProvider,omitzero"` // The server provides folding provider support. FoldingRangeProvider *BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions `json:"foldingRangeProvider,omitzero"` // The server provides selection range support. SelectionRangeProvider *BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions `json:"selectionRangeProvider,omitzero"` // The server provides execute command support. ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitzero"` // The server provides call hierarchy support. // // Since: 3.16.0 CallHierarchyProvider *BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions `json:"callHierarchyProvider,omitzero"` // The server provides linked editing range support. // // Since: 3.16.0 LinkedEditingRangeProvider *BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions `json:"linkedEditingRangeProvider,omitzero"` // The server provides semantic tokens support. // // Since: 3.16.0 SemanticTokensProvider *SemanticTokensOptionsOrRegistrationOptions `json:"semanticTokensProvider,omitzero"` // The server provides moniker support. // // Since: 3.16.0 MonikerProvider *BooleanOrMonikerOptionsOrMonikerRegistrationOptions `json:"monikerProvider,omitzero"` // The server provides type hierarchy support. // // Since: 3.17.0 TypeHierarchyProvider *BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions `json:"typeHierarchyProvider,omitzero"` // The server provides inline values. // // Since: 3.17.0 InlineValueProvider *BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions `json:"inlineValueProvider,omitzero"` // The server provides inlay hints. // // Since: 3.17.0 InlayHintProvider *BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions `json:"inlayHintProvider,omitzero"` // The server has support for pull model diagnostics. // // Since: 3.17.0 DiagnosticProvider *DiagnosticOptionsOrRegistrationOptions `json:"diagnosticProvider,omitzero"` // Inline completion options used during static registration. // // Since: 3.18.0 InlineCompletionProvider *BooleanOrInlineCompletionOptions `json:"inlineCompletionProvider,omitzero"` // Workspace specific server capabilities. Workspace *WorkspaceOptions `json:"workspace,omitzero"` // Experimental server capabilities. Experimental *ExperimentalServerCapabilities `json:"experimental,omitzero"` // Provider options for the VS auto-insert feature via textDocument/_vs_onAutoInsert. VSOnAutoInsertProvider *VSOnAutoInsertOptions `json:"_vs_onAutoInsertProvider,omitzero"` // The server provides VS-specific grouped references via textDocument/_vs_references. VSReferencesProvider *bool `json:"_vs_referencesProvider,omitzero"` } var _ json.UnmarshalerFrom = (*ServerCapabilities)(nil) func (s *ServerCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Information about the server // // Since: 3.15.0 // // Since: 3.18.0 ServerInfo type name added. type ServerInfo struct { // The name of the server as defined by the server. Name string `json:"name" lsp:"required"` // The server's version as defined by the server. Version *string `json:"version,omitzero"` } var _ json.UnmarshalerFrom = (*ServerInfo)(nil) func (s *ServerInfo) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A text document identifier to denote a specific version of a text document. type VersionedTextDocumentIdentifier struct { // The text document's uri. Uri DocumentUri `json:"uri" lsp:"required"` // The version number of this document. Version int32 `json:"version" lsp:"required"` } var _ json.UnmarshalerFrom = (*VersionedTextDocumentIdentifier)(nil) func (s *VersionedTextDocumentIdentifier) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Save options. type SaveOptions struct { // The client is supposed to include the content on save. IncludeText *bool `json:"includeText,omitzero"` } var _ json.UnmarshalerFrom = (*SaveOptions)(nil) func (s *SaveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An event describing a file change. type FileEvent struct { // The file's uri. Uri DocumentUri `json:"uri" lsp:"required"` // The change type. Type FileChangeType `json:"type" lsp:"required"` } var _ json.UnmarshalerFrom = (*FileEvent)(nil) func (s *FileEvent) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type FileSystemWatcher struct { // The glob pattern to watch. See pattern for more detail. // // Since: 3.17.0 support for relative patterns. GlobPattern PatternOrRelativePattern `json:"globPattern" lsp:"required"` // The kind of events of interest. If omitted it defaults // to WatchKind.Create | WatchKind.Change | WatchKind.Delete // which is 7. Kind *WatchKind `json:"kind,omitzero"` } var _ json.UnmarshalerFrom = (*FileSystemWatcher)(nil) func (s *FileSystemWatcher) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a diagnostic, such as a compiler error or warning. Diagnostic objects // are only valid in the scope of a resource. type Diagnostic struct { // The range at which the message applies Range Range `json:"range" lsp:"required"` // The diagnostic's severity. To avoid interpretation mismatches when a // server is used with different clients it is highly recommended that servers // always provide a severity value. Severity *DiagnosticSeverity `json:"severity,omitzero"` // The diagnostic's code, which usually appear in the user interface. Code *IntegerOrString `json:"code,omitzero"` // An optional property to describe the error code. // Requires the code field (above) to be present/not null. // // Since: 3.16.0 CodeDescription *CodeDescription `json:"codeDescription,omitzero"` // A human-readable string describing the source of this // diagnostic, e.g. 'typescript' or 'super lint'. It usually // appears in the user interface. Source *string `json:"source,omitzero"` // The diagnostic's message. It usually appears in the user interface. // // Since: 3.18.0 - support for MarkupContent. This is guarded by the client // capability `textDocument.diagnostic.markupMessageSupport`. Message StringOrMarkupContent `json:"message" lsp:"required"` // Additional metadata about the diagnostic. // // Since: 3.15.0 Tags *[]DiagnosticTag `json:"tags,omitzero"` // An array of related diagnostic information, e.g. when symbol-names within // a scope collide all definitions can be marked via this property. RelatedInformation *[]*DiagnosticRelatedInformation `json:"relatedInformation,omitzero"` // A data entry field that is preserved between a `textDocument/publishDiagnostics` // notification and `textDocument/codeAction` request. // // Since: 3.16.0 Data *DiagnosticData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*Diagnostic)(nil) func (s *Diagnostic) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Contains additional information about the context in which a completion request is triggered. type CompletionContext struct { // How the completion was triggered. TriggerKind CompletionTriggerKind `json:"triggerKind" lsp:"required"` // The trigger character (a single character) that has trigger code complete. // Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` TriggerCharacter *string `json:"triggerCharacter,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionContext)(nil) func (s *CompletionContext) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Additional details for a completion item label. // // Since: 3.17.0 type CompletionItemLabelDetails struct { // An optional string which is rendered less prominently directly after label, // without any spacing. Should be used for function signatures and type annotations. Detail *string `json:"detail,omitzero"` // An optional string which is rendered less prominently after CompletionItem.detail. Should be used // for fully qualified names and file paths. Description *string `json:"description,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionItemLabelDetails)(nil) func (s *CompletionItemLabelDetails) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A special text edit to provide an insert and a replace operation. // // Since: 3.16.0 type InsertReplaceEdit struct { // The string to be inserted. NewText string `json:"newText" lsp:"required"` // The range if the insert is requested Insert Range `json:"insert" lsp:"required"` // The range if the replace is requested. Replace Range `json:"replace" lsp:"required"` } var _ json.UnmarshalerFrom = (*InsertReplaceEdit)(nil) func (s *InsertReplaceEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // In many cases the items of an actual completion result share the same // value for properties like `commitCharacters` or the range of a text // edit. A completion list can therefore define item defaults which will // be used if a completion item itself doesn't specify the value. // // If a completion list specifies a default value and a completion item // also specifies a corresponding value, the rules for combining these are // defined by `applyKinds` (if the client supports it), defaulting to // ApplyKind.Replace. // // Servers are only allowed to return default values if the client // signals support for this via the `completionList.itemDefaults` // capability. // // Since: 3.17.0 type CompletionItemDefaults struct { // A default commit character set. // // Since: 3.17.0 CommitCharacters *[]string `json:"commitCharacters,omitzero"` // A default edit range. // // Since: 3.17.0 EditRange *RangeOrEditRangeWithInsertReplace `json:"editRange,omitzero"` // A default insert text format. // // Since: 3.17.0 InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitzero"` // A default insert text mode. // // Since: 3.17.0 InsertTextMode *InsertTextMode `json:"insertTextMode,omitzero"` // A default data value. // // Since: 3.17.0 Data *CompletionItemDefaultsData `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionItemDefaults)(nil) func (s *CompletionItemDefaults) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Specifies how fields from a completion item should be combined with those // from `completionList.itemDefaults`. // // If unspecified, all fields will be treated as ApplyKind.Replace. // // If a field's value is ApplyKind.Replace, the value from a completion item (if // provided and not `null`) will always be used instead of the value from // `completionItem.itemDefaults`. // // If a field's value is ApplyKind.Merge, the values will be merged using the rules // defined against each field below. // // Servers are only allowed to return `applyKind` if the client // signals support for this via the `completionList.applyKindSupport` // capability. // // Since: 3.18.0 type CompletionItemApplyKinds struct { // Specifies whether commitCharacters on a completion will replace or be // merged with those in `completionList.itemDefaults.commitCharacters`. // // If ApplyKind.Replace, the commit characters from the completion item will // always be used unless not provided, in which case those from // `completionList.itemDefaults.commitCharacters` will be used. An // empty list can be used if a completion item does not have any commit // characters and also should not use those from // `completionList.itemDefaults.commitCharacters`. // // If ApplyKind.Merge the commitCharacters for the completion will be the // union of all values in both `completionList.itemDefaults.commitCharacters` // and the completion's own `commitCharacters`. // // Since: 3.18.0 CommitCharacters *ApplyKind `json:"commitCharacters,omitzero"` // Specifies whether the `data` field on a completion will replace or // be merged with data from `completionList.itemDefaults.data`. // // If ApplyKind.Replace, the data from the completion item will be used if // provided (and not `null`), otherwise // `completionList.itemDefaults.data` will be used. An empty object can // be used if a completion item does not have any data but also should // not use the value from `completionList.itemDefaults.data`. // // If ApplyKind.Merge, a shallow merge will be performed between // `completionList.itemDefaults.data` and the completion's own data // using the following rules: // // - If a completion's `data` field is not provided (or `null`), the // entire `data` field from `completionList.itemDefaults.data` will be // used as-is. // - If a completion's `data` field is provided, each field will // overwrite the field of the same name in // `completionList.itemDefaults.data` but no merging of nested fields // within that value will occur. // // Since: 3.18.0 Data *ApplyKind `json:"data,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionItemApplyKinds)(nil) func (s *CompletionItemApplyKinds) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Completion options. type CompletionOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Most tools trigger completion request automatically without explicitly requesting // it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user // starts to type an identifier. For example if the user types `c` in a JavaScript file // code complete will automatically pop up present `console` besides others as a // completion item. Characters that make up identifiers don't need to be listed here. // // If code complete should automatically be trigger on characters not being valid inside // an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. TriggerCharacters *[]string `json:"triggerCharacters,omitzero"` // The list of all possible characters that commit a completion. This field can be used // if clients don't support individual commit characters per completion item. See // `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` // // If a server provides both `allCommitCharacters` and commit characters on an individual // completion item the ones on the completion item win. // // Since: 3.2.0 AllCommitCharacters *[]string `json:"allCommitCharacters,omitzero"` // The server provides support to resolve additional // information for a completion item. ResolveProvider *bool `json:"resolveProvider,omitzero"` // The server supports the following `CompletionItem` specific // capabilities. // // Since: 3.17.0 CompletionItem *ServerCompletionItemOptions `json:"completionItem,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionOptions)(nil) func (s *CompletionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Hover options. type HoverOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*HoverOptions)(nil) func (s *HoverOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Additional information about the context in which a signature help request was triggered. // // Since: 3.15.0 type SignatureHelpContext struct { // Action that caused signature help to be triggered. TriggerKind SignatureHelpTriggerKind `json:"triggerKind" lsp:"required"` // Character that caused signature help to be triggered. // // This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter` TriggerCharacter *string `json:"triggerCharacter,omitzero"` // `true` if signature help was already showing when it was triggered. // // Retriggers occurs when the signature help is already active and can be caused by actions such as // typing a trigger character, a cursor move, or document content changes. IsRetrigger bool `json:"isRetrigger" lsp:"required"` // The currently active `SignatureHelp`. // // The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on // the user navigating through available signatures. ActiveSignatureHelp *SignatureHelp `json:"activeSignatureHelp,omitzero"` } var _ json.UnmarshalerFrom = (*SignatureHelpContext)(nil) func (s *SignatureHelpContext) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents the signature of something callable. A signature // can have a label, like a function-name, a doc-comment, and // a set of parameters. type SignatureInformation struct { // The label of this signature. Will be shown in // the UI. Label string `json:"label" lsp:"required"` // The human-readable doc-comment of this signature. Will be shown // in the UI but can be omitted. Documentation *StringOrMarkupContent `json:"documentation,omitzero"` // The parameters of this signature. Parameters *[]*ParameterInformation `json:"parameters,omitzero"` // The index of the active parameter. // // If `null`, no parameter of the signature is active (for example a named // argument that does not match any declared parameters). This is only valid // if the client specifies the client capability // `textDocument.signatureHelp.noActiveParameterSupport === true` // // If provided (or `null`), this is used in place of // `SignatureHelp.activeParameter`. // // Since: 3.16.0 ActiveParameter *UintegerOrNull `json:"activeParameter,omitzero" lsp:"nullable"` // A colorized label for the signature, providing classified text runs for VS syntax coloring. VSColorizedLabel *VSClassifiedTextElement `json:"_vs_colorizedLabel,omitzero"` } var _ json.UnmarshalerFrom = (*SignatureInformation)(nil) func (s *SignatureInformation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Server Capabilities for a SignatureHelpRequest. type SignatureHelpOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // List of characters that trigger signature help automatically. TriggerCharacters *[]string `json:"triggerCharacters,omitzero"` // List of characters that re-trigger signature help. // // These trigger characters are only active when signature help is already showing. All trigger characters // are also counted as re-trigger characters. // // Since: 3.15.0 RetriggerCharacters *[]string `json:"retriggerCharacters,omitzero"` } var _ json.UnmarshalerFrom = (*SignatureHelpOptions)(nil) func (s *SignatureHelpOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Server Capabilities for a DefinitionRequest. type DefinitionOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DefinitionOptions)(nil) func (s *DefinitionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Value-object that contains additional information when // requesting references. type ReferenceContext struct { // Include the declaration of the current symbol. IncludeDeclaration bool `json:"includeDeclaration" lsp:"required"` } var _ json.UnmarshalerFrom = (*ReferenceContext)(nil) func (s *ReferenceContext) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Reference options. type ReferenceOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*ReferenceOptions)(nil) func (s *ReferenceOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a DocumentHighlightRequest. type DocumentHighlightOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentHighlightOptions)(nil) func (s *DocumentHighlightOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A base for all symbol information. type BaseSymbolInformation struct { // The name of this symbol. Name string `json:"name" lsp:"required"` // The kind of this symbol. Kind SymbolKind `json:"kind" lsp:"required"` // Tags for this symbol. // // Since: 3.16.0 Tags *[]SymbolTag `json:"tags,omitzero"` // The name of the symbol containing this symbol. This information is for // user interface purposes (e.g. to render a qualifier in the user interface // if necessary). It can't be used to re-infer a hierarchy for the document // symbols. ContainerName *string `json:"containerName,omitzero"` } var _ json.UnmarshalerFrom = (*BaseSymbolInformation)(nil) func (s *BaseSymbolInformation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a DocumentSymbolRequest. type DocumentSymbolOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A human-readable string that is shown when multiple outlines trees // are shown for the same document. // // Since: 3.16.0 Label *string `json:"label,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentSymbolOptions)(nil) func (s *DocumentSymbolOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Contains additional diagnostic information about the context in which // a action is run. type CodeActionContext struct { // An array of diagnostics known on the client side overlapping the range provided to the // `textDocument/codeAction` request. They are provided so that the server knows which // errors are currently presented to the user for the given range. There is no guarantee // that these accurately reflect the error state of the resource. The primary parameter // to compute code actions is the provided range. Diagnostics []*Diagnostic `json:"diagnostics" lsp:"required"` // Requested kind of actions to return. // // Actions not of this kind are filtered out by the client before being shown. So servers // can omit computing them. Only *[]CodeActionKind `json:"only,omitzero"` // The reason why code actions were requested. // // Since: 3.17.0 TriggerKind *CodeActionTriggerKind `json:"triggerKind,omitzero"` } var _ json.UnmarshalerFrom = (*CodeActionContext)(nil) func (s *CodeActionContext) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Captures why the code action is currently disabled. // // Since: 3.18.0 type CodeActionDisabled struct { // Human readable description of why the code action is currently disabled. // // This is displayed in the code actions UI. Reason string `json:"reason" lsp:"required"` } var _ json.UnmarshalerFrom = (*CodeActionDisabled)(nil) func (s *CodeActionDisabled) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a CodeActionRequest. type CodeActionOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // CodeActionKinds that this server may return. // // The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server // may list out every specific kind they provide. CodeActionKinds *[]CodeActionKind `json:"codeActionKinds,omitzero"` // Static documentation for a class of code actions. // // Documentation from the provider should be shown in the code actions menu if either: // // - Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that // most closely matches the requested code action kind. For example, if a provider has documentation for // both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`, // the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`. // // - Any code actions of `kind` are returned by the provider. // // At most one documentation entry should be shown per provider. // // Since: 3.18.0 Documentation *[]*CodeActionKindDocumentation `json:"documentation,omitzero"` // The server provides support to resolve additional // information for a code action. // // Since: 3.16.0 ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*CodeActionOptions)(nil) func (s *CodeActionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Location with only uri and does not include range. // // Since: 3.18.0 type LocationUriOnly struct { Uri DocumentUri `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*LocationUriOnly)(nil) func (s *LocationUriOnly) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Server capabilities for a WorkspaceSymbolRequest. type WorkspaceSymbolOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The server provides support to resolve additional // information for a workspace symbol. // // Since: 3.17.0 ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceSymbolOptions)(nil) func (s *WorkspaceSymbolOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Code Lens provider options of a CodeLensRequest. type CodeLensOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Code lens has a resolve provider as well. ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*CodeLensOptions)(nil) func (s *CodeLensOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a DocumentLinkRequest. type DocumentLinkOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Document links have a resolve provider as well. ResolveProvider *bool `json:"resolveProvider,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentLinkOptions)(nil) func (s *DocumentLinkOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Value-object describing what options formatting should use. type FormattingOptions struct { // Size of a tab in spaces. TabSize uint32 `json:"tabSize" lsp:"required"` // Prefer spaces over tabs. InsertSpaces bool `json:"insertSpaces" lsp:"required"` // Trim trailing whitespace on a line. // // Since: 3.15.0 TrimTrailingWhitespace *bool `json:"trimTrailingWhitespace,omitzero"` // Insert a newline character at the end of the file if one does not exist. // // Since: 3.15.0 InsertFinalNewline *bool `json:"insertFinalNewline,omitzero"` // Trim all newlines after the final newline at the end of the file. // // Since: 3.15.0 TrimFinalNewlines *bool `json:"trimFinalNewlines,omitzero"` } var _ json.UnmarshalerFrom = (*FormattingOptions)(nil) func (s *FormattingOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a DocumentFormattingRequest. type DocumentFormattingOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentFormattingOptions)(nil) func (s *DocumentFormattingOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a DocumentRangeFormattingRequest. type DocumentRangeFormattingOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Whether the server supports formatting multiple ranges at once. // // Since: 3.18.0 RangesSupport *bool `json:"rangesSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentRangeFormattingOptions)(nil) func (s *DocumentRangeFormattingOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a DocumentOnTypeFormattingRequest. type DocumentOnTypeFormattingOptions struct { // A character on which formatting should be triggered, like `{`. FirstTriggerCharacter string `json:"firstTriggerCharacter" lsp:"required"` // More trigger characters. MoreTriggerCharacter *[]string `json:"moreTriggerCharacter,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentOnTypeFormattingOptions)(nil) func (s *DocumentOnTypeFormattingOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Provider options for a RenameRequest. type RenameOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Renames should be checked and tested before being executed. // // Since: version 3.12.0 PrepareProvider *bool `json:"prepareProvider,omitzero"` } var _ json.UnmarshalerFrom = (*RenameOptions)(nil) func (s *RenameOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type PrepareRenamePlaceholder struct { Range Range `json:"range" lsp:"required"` Placeholder string `json:"placeholder" lsp:"required"` } var _ json.UnmarshalerFrom = (*PrepareRenamePlaceholder)(nil) func (s *PrepareRenamePlaceholder) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type PrepareRenameDefaultBehavior struct { DefaultBehavior bool `json:"defaultBehavior" lsp:"required"` } var _ json.UnmarshalerFrom = (*PrepareRenameDefaultBehavior)(nil) func (s *PrepareRenameDefaultBehavior) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The server capabilities of a ExecuteCommandRequest. type ExecuteCommandOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // The commands to be executed on the server Commands []string `json:"commands" lsp:"required"` } var _ json.UnmarshalerFrom = (*ExecuteCommandOptions)(nil) func (s *ExecuteCommandOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Additional data about a workspace edit. // // Since: 3.18.0 type WorkspaceEditMetadata struct { // Signal to the editor that this edit is a refactoring. IsRefactoring *bool `json:"isRefactoring,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceEditMetadata)(nil) func (s *WorkspaceEditMetadata) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensLegend struct { // The token types a server uses. TokenTypes []string `json:"tokenTypes" lsp:"required"` // The token modifiers a server uses. TokenModifiers []string `json:"tokenModifiers" lsp:"required"` } var _ json.UnmarshalerFrom = (*SemanticTokensLegend)(nil) func (s *SemanticTokensLegend) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Semantic tokens options to support deltas for full documents // // Since: 3.18.0 type SemanticTokensFullDelta struct { // The server supports deltas for full documents. Delta *bool `json:"delta,omitzero"` } var _ json.UnmarshalerFrom = (*SemanticTokensFullDelta)(nil) func (s *SemanticTokensFullDelta) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A text document identifier to optionally denote a specific version of a text document. type OptionalVersionedTextDocumentIdentifier struct { // The text document's uri. Uri DocumentUri `json:"uri" lsp:"required"` // The version number of this document. If a versioned text document identifier // is sent from the server to the client and the file is not open in the editor // (the server has not received an open notification before) the server can send // `null` to indicate that the version is unknown and the content on disk is the // truth (as specified with document content ownership). Version IntegerOrNull `json:"version" lsp:"required"` } var _ json.UnmarshalerFrom = (*OptionalVersionedTextDocumentIdentifier)(nil) func (s *OptionalVersionedTextDocumentIdentifier) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A special text edit with an additional change annotation. // // Since: 3.16.0. type AnnotatedTextEdit 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" lsp:"required"` // The string to be inserted. For delete operations use an // empty string. NewText string `json:"newText" lsp:"required"` // The actual identifier of the change annotation AnnotationId string `json:"annotationId" lsp:"required"` } var _ json.UnmarshalerFrom = (*AnnotatedTextEdit)(nil) func (s *AnnotatedTextEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An interactive text edit. // // Since: 3.18.0 type SnippetTextEdit struct { // The range of the text document to be manipulated. Range Range `json:"range" lsp:"required"` // The snippet to be inserted. Snippet *StringValue `json:"snippet" lsp:"required"` // The actual identifier of the snippet edit. AnnotationId *string `json:"annotationId,omitzero"` } var _ json.UnmarshalerFrom = (*SnippetTextEdit)(nil) func (s *SnippetTextEdit) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A generic resource operation. type ResourceOperation struct { // The resource operation kind. Kind string `json:"kind" lsp:"required"` // An optional annotation identifier describing the operation. // // Since: 3.16.0 AnnotationId *string `json:"annotationId,omitzero"` } var _ json.UnmarshalerFrom = (*ResourceOperation)(nil) func (s *ResourceOperation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Options to create a file. type CreateFileOptions struct { // Overwrite existing file. Overwrite wins over `ignoreIfExists` Overwrite *bool `json:"overwrite,omitzero"` // Ignore if exists. IgnoreIfExists *bool `json:"ignoreIfExists,omitzero"` } var _ json.UnmarshalerFrom = (*CreateFileOptions)(nil) func (s *CreateFileOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Rename file options type RenameFileOptions struct { // Overwrite target if existing. Overwrite wins over `ignoreIfExists` Overwrite *bool `json:"overwrite,omitzero"` // Ignores if target exists. IgnoreIfExists *bool `json:"ignoreIfExists,omitzero"` } var _ json.UnmarshalerFrom = (*RenameFileOptions)(nil) func (s *RenameFileOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Delete file options type DeleteFileOptions struct { // Delete the content recursively if a folder is denoted. Recursive *bool `json:"recursive,omitzero"` // Ignore the operation if the file doesn't exist. IgnoreIfNotExists *bool `json:"ignoreIfNotExists,omitzero"` } var _ json.UnmarshalerFrom = (*DeleteFileOptions)(nil) func (s *DeleteFileOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A pattern to describe in which file operation requests or notifications // the server is interested in receiving. // // Since: 3.16.0 type FileOperationPattern struct { // The glob pattern to match. Glob patterns can have the following syntax: // - `*` to match zero or more characters in a path segment // - `?` to match on one character in a path segment // - `**` to match any number of path segments, including none // - `{}` to group sub patterns into an OR expression. (e.g. `**​ .{ts,js}` matches all TypeScript and JavaScript files) // - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) // - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) Glob string `json:"glob" lsp:"required"` // Whether to match files or folders with this pattern. // // Matches both if undefined. Matches *FileOperationPatternKind `json:"matches,omitzero"` // Additional options used during matching. Options *FileOperationPatternOptions `json:"options,omitzero"` } var _ json.UnmarshalerFrom = (*FileOperationPattern)(nil) func (s *FileOperationPattern) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A diagnostic report with a full set of problems. // // Since: 3.17.0 type FullDocumentDiagnosticReport struct { // A full document diagnostic report. Kind StringLiteralFull `json:"kind" lsp:"required"` // An optional result id. If provided it will // be sent on the next diagnostic request for the // same document. ResultId *string `json:"resultId,omitzero"` // The actual items. Items []*Diagnostic `json:"items" lsp:"required"` } var _ json.UnmarshalerFrom = (*FullDocumentDiagnosticReport)(nil) func (s *FullDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A diagnostic report indicating that the last returned // report is still accurate. // // Since: 3.17.0 type UnchangedDocumentDiagnosticReport struct { // A document diagnostic report indicating // no changes to the last result. A server can // only return `unchanged` if result ids are // provided. Kind StringLiteralUnchanged `json:"kind" lsp:"required"` // A result id which will be sent on the next // diagnostic request for the same document. ResultId string `json:"resultId" lsp:"required"` } var _ json.UnmarshalerFrom = (*UnchangedDocumentDiagnosticReport)(nil) func (s *UnchangedDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A full document diagnostic report for a workspace diagnostic result. // // Since: 3.17.0 type WorkspaceFullDocumentDiagnosticReport struct { // A full document diagnostic report. Kind StringLiteralFull `json:"kind" lsp:"required"` // An optional result id. If provided it will // be sent on the next diagnostic request for the // same document. ResultId *string `json:"resultId,omitzero"` // The actual items. Items []*Diagnostic `json:"items" lsp:"required"` // The URI for which diagnostic information is reported. Uri DocumentUri `json:"uri" lsp:"required"` // The version number for which the diagnostics are reported. // If the document is not marked as open `null` can be provided. Version IntegerOrNull `json:"version" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceFullDocumentDiagnosticReport)(nil) func (s *WorkspaceFullDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // An unchanged document diagnostic report for a workspace diagnostic result. // // Since: 3.17.0 type WorkspaceUnchangedDocumentDiagnosticReport struct { // A document diagnostic report indicating // no changes to the last result. A server can // only return `unchanged` if result ids are // provided. Kind StringLiteralUnchanged `json:"kind" lsp:"required"` // A result id which will be sent on the next // diagnostic request for the same document. ResultId string `json:"resultId" lsp:"required"` // The URI for which diagnostic information is reported. Uri DocumentUri `json:"uri" lsp:"required"` // The version number for which the diagnostics are reported. // If the document is not marked as open `null` can be provided. Version IntegerOrNull `json:"version" lsp:"required"` } var _ json.UnmarshalerFrom = (*WorkspaceUnchangedDocumentDiagnosticReport)(nil) func (s *WorkspaceUnchangedDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Describes the currently selected completion item. // // Since: 3.18.0 type SelectedCompletionInfo struct { // The range that will be replaced if this completion item is accepted. Range Range `json:"range" lsp:"required"` // The text the range will be replaced with if this completion is accepted. Text string `json:"text" lsp:"required"` } var _ json.UnmarshalerFrom = (*SelectedCompletionInfo)(nil) func (s *SelectedCompletionInfo) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Information about the client // // Since: 3.15.0 // // Since: 3.18.0 ClientInfo type name added. type ClientInfo struct { // The name of the client as defined by the client. Name string `json:"name" lsp:"required"` // The client's version as defined by the client. Version *string `json:"version,omitzero"` } var _ json.UnmarshalerFrom = (*ClientInfo)(nil) func (s *ClientInfo) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Defines the capabilities provided by the client. type ClientCapabilities struct { // Workspace specific client capabilities. Workspace *WorkspaceClientCapabilities `json:"workspace,omitzero"` // Text document specific client capabilities. TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitzero"` // Window specific client capabilities. Window *WindowClientCapabilities `json:"window,omitzero"` // General client capabilities. // // Since: 3.16.0 General *GeneralClientCapabilities `json:"general,omitzero"` // Experimental client capabilities. Experimental *ExperimentalClientCapabilities `json:"experimental,omitzero"` // Whether the client supports Visual Studio extensions. VSSupportsVisualStudioExtensions *bool `json:"_vs_supportsVisualStudioExtensions,omitzero"` // The snippet version supported by the client. VSSupportedSnippetVersion *int32 `json:"_vs_supportedSnippetVersion,omitzero"` // Whether the client supports not including text in textDocument/didOpen notifications. VSSupportsNotIncludingTextInTextDocumentDidOpen *bool `json:"_vs_supportsNotIncludingTextInTextDocumentDidOpen,omitzero"` // Whether the client supports icon extensions. VSSupportsIconExtensions *bool `json:"_vs_supportsIconExtensions,omitzero"` // Whether the client supports diagnostic requests. VSSupportsDiagnosticRequests *bool `json:"_vs_supportsDiagnosticRequests,omitzero"` } var _ json.UnmarshalerFrom = (*ClientCapabilities)(nil) func (s *ClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type TextDocumentSyncOptions struct { // Open and close notifications are sent to the server. If omitted open close notification should not // be sent. OpenClose *bool `json:"openClose,omitzero"` // Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full // and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None. Change *TextDocumentSyncKind `json:"change,omitzero"` // If present will save notifications are sent to the server. If omitted the notification should not be // sent. WillSave *bool `json:"willSave,omitzero"` // If present will save wait until requests are sent to the server. If omitted the request should not be // sent. WillSaveWaitUntil *bool `json:"willSaveWaitUntil,omitzero"` // If present save notifications are sent to the server. If omitted the notification should not be // sent. Save *BooleanOrSaveOptions `json:"save,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentSyncOptions)(nil) func (s *TextDocumentSyncOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Defines workspace specific capabilities of the server. // // Since: 3.18.0 type WorkspaceOptions struct { // The server supports workspace folder. // // Since: 3.6.0 WorkspaceFolders *WorkspaceFoldersServerCapabilities `json:"workspaceFolders,omitzero"` // The server is interested in notifications/requests for operations on files. // // Since: 3.16.0 FileOperations *FileOperationOptions `json:"fileOperations,omitzero"` // The server supports the `workspace/textDocumentContent` request. // // Since: 3.18.0 TextDocumentContent *TextDocumentContentOptionsOrRegistrationOptions `json:"textDocumentContent,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceOptions)(nil) func (s *WorkspaceOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type TextDocumentContentChangePartial struct { // The range of the document that changed. Range Range `json:"range" lsp:"required"` // The optional length of the range that got replaced. // // Deprecated: use range instead. RangeLength *uint32 `json:"rangeLength,omitzero"` // The new text for the provided range. Text string `json:"text" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentContentChangePartial)(nil) func (s *TextDocumentContentChangePartial) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type TextDocumentContentChangeWholeDocument struct { // The new text of the whole document. Text string `json:"text" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentContentChangeWholeDocument)(nil) func (s *TextDocumentContentChangeWholeDocument) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Structure to capture a description for an error code. // // Since: 3.16.0 type CodeDescription struct { // An URI to open with more information about the diagnostic error. Href URI `json:"href" lsp:"required"` } var _ json.UnmarshalerFrom = (*CodeDescription)(nil) func (s *CodeDescription) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a related message and source code location for a diagnostic. This should be // used to point to code locations that cause or related to a diagnostics, e.g when duplicating // a symbol in a scope. type DiagnosticRelatedInformation struct { // The location of this related diagnostic information. Location Location `json:"location" lsp:"required"` // The message of this related diagnostic information. Message string `json:"message" lsp:"required"` } var _ json.UnmarshalerFrom = (*DiagnosticRelatedInformation)(nil) func (s *DiagnosticRelatedInformation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Edit range variant that includes ranges for insert and replace operations. // // Since: 3.18.0 type EditRangeWithInsertReplace struct { Insert Range `json:"insert" lsp:"required"` Replace Range `json:"replace" lsp:"required"` } var _ json.UnmarshalerFrom = (*EditRangeWithInsertReplace)(nil) func (s *EditRangeWithInsertReplace) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ServerCompletionItemOptions struct { // The server has support for completion item label // details (see also `CompletionItemLabelDetails`) when // receiving a completion item in a resolve call. // // Since: 3.17.0 LabelDetailsSupport *bool `json:"labelDetailsSupport,omitzero"` } var _ json.UnmarshalerFrom = (*ServerCompletionItemOptions)(nil) func (s *ServerCompletionItemOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 // // Deprecated: use MarkupContent instead. type MarkedStringWithLanguage struct { Language string `json:"language" lsp:"required"` Value string `json:"value" lsp:"required"` } var _ json.UnmarshalerFrom = (*MarkedStringWithLanguage)(nil) func (s *MarkedStringWithLanguage) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Represents a parameter of a callable-signature. A parameter can // have a label and a doc-comment. type ParameterInformation struct { // The label of this parameter information. // // Either a string or an inclusive start and exclusive end offsets within its containing // signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 // string representation as `Position` and `Range` does. // // To avoid ambiguities a server should use the [start, end] offset value instead of using // a substring. Whether a client support this is controlled via `labelOffsetSupport` client // capability. // // *Note*: a label of type string should be a substring of its containing signature label. // Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`. Label StringOrTuple `json:"label" lsp:"required"` // The human-readable doc-comment of this parameter. Will be shown // in the UI but can be omitted. Documentation *StringOrMarkupContent `json:"documentation,omitzero"` } var _ json.UnmarshalerFrom = (*ParameterInformation)(nil) func (s *ParameterInformation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Documentation for a class of code actions. // // Since: 3.18.0 type CodeActionKindDocumentation struct { // The kind of the code action being documented. // // If the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any // refactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the // documentation will only be shown when extract refactoring code actions are returned. Kind CodeActionKind `json:"kind" lsp:"required"` // Command that is ued to display the documentation to the user. // // The title of this documentation code action is taken from Command.title Command *Command `json:"command" lsp:"required"` } var _ json.UnmarshalerFrom = (*CodeActionKindDocumentation)(nil) func (s *CodeActionKindDocumentation) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Matching options for the file operation pattern. // // Since: 3.16.0 type FileOperationPatternOptions struct { // The pattern should be matched ignoring casing. IgnoreCase *bool `json:"ignoreCase,omitzero"` } var _ json.UnmarshalerFrom = (*FileOperationPatternOptions)(nil) func (s *FileOperationPatternOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Workspace specific client capabilities. type WorkspaceClientCapabilities struct { // The client supports applying batch edits // to the workspace by supporting the request // 'workspace/applyEdit' ApplyEdit *bool `json:"applyEdit,omitzero"` // Capabilities specific to `WorkspaceEdit`s. WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitzero"` // Capabilities specific to the `workspace/didChangeConfiguration` notification. DidChangeConfiguration *DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitzero"` // Capabilities specific to the `workspace/didChangeWatchedFiles` notification. DidChangeWatchedFiles *DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitzero"` // Capabilities specific to the `workspace/symbol` request. Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitzero"` // Capabilities specific to the `workspace/executeCommand` request. ExecuteCommand *ExecuteCommandClientCapabilities `json:"executeCommand,omitzero"` // The client has support for workspace folders. // // Since: 3.6.0 WorkspaceFolders *bool `json:"workspaceFolders,omitzero"` // The client supports `workspace/configuration` requests. // // Since: 3.6.0 Configuration *bool `json:"configuration,omitzero"` // Capabilities specific to the semantic token requests scoped to the // workspace. // // Since: 3.16.0. SemanticTokens *SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitzero"` // Capabilities specific to the code lens requests scoped to the // workspace. // // Since: 3.16.0. CodeLens *CodeLensWorkspaceClientCapabilities `json:"codeLens,omitzero"` // The client has support for file notifications/requests for user operations on files. // // Since 3.16.0 FileOperations *FileOperationClientCapabilities `json:"fileOperations,omitzero"` // Capabilities specific to the inline values requests scoped to the // workspace. // // Since: 3.17.0. InlineValue *InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitzero"` // Capabilities specific to the inlay hint requests scoped to the // workspace. // // Since: 3.17.0. InlayHint *InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitzero"` // Capabilities specific to the diagnostic requests scoped to the // workspace. // // Since: 3.17.0. Diagnostics *DiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitzero"` // Capabilities specific to the folding range requests scoped to the workspace. // // Since: 3.18.0 FoldingRange *FoldingRangeWorkspaceClientCapabilities `json:"foldingRange,omitzero"` // Capabilities specific to the `workspace/textDocumentContent` request. // // Since: 3.18.0 TextDocumentContent *TextDocumentContentClientCapabilities `json:"textDocumentContent,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceClientCapabilities)(nil) func (s *WorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Text document specific client capabilities. type TextDocumentClientCapabilities struct { // Defines which synchronization capabilities the client supports. Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitzero"` // Defines which filters the client supports. // // Since: 3.18.0 Filters *TextDocumentFilterClientCapabilities `json:"filters,omitzero"` // Capabilities specific to the `textDocument/completion` request. Completion *CompletionClientCapabilities `json:"completion,omitzero"` // Capabilities specific to the `textDocument/hover` request. Hover *HoverClientCapabilities `json:"hover,omitzero"` // Capabilities specific to the `textDocument/signatureHelp` request. SignatureHelp *SignatureHelpClientCapabilities `json:"signatureHelp,omitzero"` // Capabilities specific to the `textDocument/declaration` request. // // Since: 3.14.0 Declaration *DeclarationClientCapabilities `json:"declaration,omitzero"` // Capabilities specific to the `textDocument/definition` request. Definition *DefinitionClientCapabilities `json:"definition,omitzero"` // Capabilities specific to the `textDocument/typeDefinition` request. // // Since: 3.6.0 TypeDefinition *TypeDefinitionClientCapabilities `json:"typeDefinition,omitzero"` // Capabilities specific to the `textDocument/implementation` request. // // Since: 3.6.0 Implementation *ImplementationClientCapabilities `json:"implementation,omitzero"` // Capabilities specific to the `textDocument/references` request. References *ReferenceClientCapabilities `json:"references,omitzero"` // Capabilities specific to the `textDocument/documentHighlight` request. DocumentHighlight *DocumentHighlightClientCapabilities `json:"documentHighlight,omitzero"` // Capabilities specific to the `textDocument/documentSymbol` request. DocumentSymbol *DocumentSymbolClientCapabilities `json:"documentSymbol,omitzero"` // Capabilities specific to the `textDocument/codeAction` request. CodeAction *CodeActionClientCapabilities `json:"codeAction,omitzero"` // Capabilities specific to the `textDocument/codeLens` request. CodeLens *CodeLensClientCapabilities `json:"codeLens,omitzero"` // Capabilities specific to the `textDocument/documentLink` request. DocumentLink *DocumentLinkClientCapabilities `json:"documentLink,omitzero"` // Capabilities specific to the `textDocument/documentColor` and the // `textDocument/colorPresentation` request. // // Since: 3.6.0 ColorProvider *DocumentColorClientCapabilities `json:"colorProvider,omitzero"` // Capabilities specific to the `textDocument/formatting` request. Formatting *DocumentFormattingClientCapabilities `json:"formatting,omitzero"` // Capabilities specific to the `textDocument/rangeFormatting` request. RangeFormatting *DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitzero"` // Capabilities specific to the `textDocument/onTypeFormatting` request. OnTypeFormatting *DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitzero"` // Capabilities specific to the `textDocument/rename` request. Rename *RenameClientCapabilities `json:"rename,omitzero"` // Capabilities specific to the `textDocument/foldingRange` request. // // Since: 3.10.0 FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitzero"` // Capabilities specific to the `textDocument/selectionRange` request. // // Since: 3.15.0 SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitzero"` // Capabilities specific to the `textDocument/publishDiagnostics` notification. PublishDiagnostics *PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitzero"` // Capabilities specific to the various call hierarchy requests. // // Since: 3.16.0 CallHierarchy *CallHierarchyClientCapabilities `json:"callHierarchy,omitzero"` // Capabilities specific to the various semantic token request. // // Since: 3.16.0 SemanticTokens *SemanticTokensClientCapabilities `json:"semanticTokens,omitzero"` // Capabilities specific to the `textDocument/linkedEditingRange` request. // // Since: 3.16.0 LinkedEditingRange *LinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitzero"` // Client capabilities specific to the `textDocument/moniker` request. // // Since: 3.16.0 Moniker *MonikerClientCapabilities `json:"moniker,omitzero"` // Capabilities specific to the various type hierarchy requests. // // Since: 3.17.0 TypeHierarchy *TypeHierarchyClientCapabilities `json:"typeHierarchy,omitzero"` // Capabilities specific to the `textDocument/inlineValue` request. // // Since: 3.17.0 InlineValue *InlineValueClientCapabilities `json:"inlineValue,omitzero"` // Capabilities specific to the `textDocument/inlayHint` request. // // Since: 3.17.0 InlayHint *InlayHintClientCapabilities `json:"inlayHint,omitzero"` // Capabilities specific to the diagnostic pull model. // // Since: 3.17.0 Diagnostic *DiagnosticClientCapabilities `json:"diagnostic,omitzero"` // Client capabilities specific to inline completions. // // Since: 3.18.0 InlineCompletion *InlineCompletionClientCapabilities `json:"inlineCompletion,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentClientCapabilities)(nil) func (s *TextDocumentClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WindowClientCapabilities struct { // It indicates whether the client supports server initiated // progress using the `window/workDoneProgress/create` request. // // The capability also controls Whether client supports handling // of progress notifications. If set servers are allowed to report a // `workDoneProgress` property in the request specific server // capabilities. // // Since: 3.15.0 WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // Capabilities specific to the showMessage request. // // Since: 3.16.0 ShowMessage *ShowMessageRequestClientCapabilities `json:"showMessage,omitzero"` // Capabilities specific to the showDocument request. // // Since: 3.16.0 ShowDocument *ShowDocumentClientCapabilities `json:"showDocument,omitzero"` } var _ json.UnmarshalerFrom = (*WindowClientCapabilities)(nil) func (s *WindowClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // General client capabilities. // // Since: 3.16.0 type GeneralClientCapabilities struct { // Client capability that signals how the client // handles stale requests (e.g. a request // for which the client will not process the response // anymore since the information is outdated). // // Since: 3.17.0 StaleRequestSupport *StaleRequestSupportOptions `json:"staleRequestSupport,omitzero"` // Client capabilities specific to regular expressions. // // Since: 3.16.0 RegularExpressions *RegularExpressionsClientCapabilities `json:"regularExpressions,omitzero"` // Client capabilities specific to the client's markdown parser. // // Since: 3.16.0 Markdown *MarkdownClientCapabilities `json:"markdown,omitzero"` // The position encodings supported by the client. Client and server // have to agree on the same position encoding to ensure that offsets // (e.g. character position in a line) are interpreted the same on both // sides. // // To keep the protocol backwards compatible the following applies: if // the value 'utf-16' is missing from the array of position encodings // servers can assume that the client supports UTF-16. UTF-16 is // therefore a mandatory encoding. // // If omitted it defaults to ['utf-16']. // // Implementation considerations: since the conversion from one encoding // into another requires the content of the file / line the conversion // is best done where the file is read which is usually on the server // side. // // Since: 3.17.0 PositionEncodings *[]PositionEncodingKind `json:"positionEncodings,omitzero"` } var _ json.UnmarshalerFrom = (*GeneralClientCapabilities)(nil) func (s *GeneralClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkspaceFoldersServerCapabilities struct { // The server has support for workspace folders Supported *bool `json:"supported,omitzero"` // Whether the server wants to receive workspace folder // change notifications. // // If a string is provided the string is treated as an ID // under which the notification is registered on the client // side. The ID can be used to unregister for these events // using the `client/unregisterCapability` request. ChangeNotifications *StringOrBoolean `json:"changeNotifications,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceFoldersServerCapabilities)(nil) func (s *WorkspaceFoldersServerCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Options for notifications/requests for user operations on files. // // Since: 3.16.0 type FileOperationOptions struct { // The server is interested in receiving didCreateFiles notifications. DidCreate *FileOperationRegistrationOptions `json:"didCreate,omitzero"` // The server is interested in receiving willCreateFiles requests. WillCreate *FileOperationRegistrationOptions `json:"willCreate,omitzero"` // The server is interested in receiving didRenameFiles notifications. DidRename *FileOperationRegistrationOptions `json:"didRename,omitzero"` // The server is interested in receiving willRenameFiles requests. WillRename *FileOperationRegistrationOptions `json:"willRename,omitzero"` // The server is interested in receiving didDeleteFiles file notifications. DidDelete *FileOperationRegistrationOptions `json:"didDelete,omitzero"` // The server is interested in receiving willDeleteFiles file requests. WillDelete *FileOperationRegistrationOptions `json:"willDelete,omitzero"` } var _ json.UnmarshalerFrom = (*FileOperationOptions)(nil) func (s *FileOperationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A relative pattern is a helper to construct glob patterns that are matched // relatively to a base URI. The common value for a `baseUri` is a workspace // folder root, but it can be another absolute URI as well. // // Since: 3.17.0 type RelativePattern struct { // A workspace folder or a base URI to which this pattern will be matched // against relatively. BaseUri WorkspaceFolderOrURI `json:"baseUri" lsp:"required"` // The actual glob pattern; Pattern string `json:"pattern" lsp:"required"` } var _ json.UnmarshalerFrom = (*RelativePattern)(nil) func (s *RelativePattern) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A document filter where `language` is required field. // // Since: 3.18.0 type TextDocumentFilterLanguage struct { // A language id, like `typescript`. Language string `json:"language" lsp:"required"` // A Uri scheme, like `file` or `untitled`. Scheme *string `json:"scheme,omitzero"` // A glob pattern, like **​ .{ts,js}. See TextDocumentFilter for examples. // // Since: 3.18.0 - support for relative patterns. Whether clients support // relative patterns depends on the client capability // `textDocuments.filters.relativePatternSupport`. Pattern *PatternOrRelativePattern `json:"pattern,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentFilterLanguage)(nil) func (s *TextDocumentFilterLanguage) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A document filter where `scheme` is required field. // // Since: 3.18.0 type TextDocumentFilterScheme struct { // A language id, like `typescript`. Language *string `json:"language,omitzero"` // A Uri scheme, like `file` or `untitled`. Scheme string `json:"scheme" lsp:"required"` // A glob pattern, like **​ .{ts,js}. See TextDocumentFilter for examples. // // Since: 3.18.0 - support for relative patterns. Whether clients support // relative patterns depends on the client capability // `textDocuments.filters.relativePatternSupport`. Pattern *PatternOrRelativePattern `json:"pattern,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentFilterScheme)(nil) func (s *TextDocumentFilterScheme) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A document filter where `pattern` is required field. // // Since: 3.18.0 type TextDocumentFilterPattern struct { // A language id, like `typescript`. Language *string `json:"language,omitzero"` // A Uri scheme, like `file` or `untitled`. Scheme *string `json:"scheme,omitzero"` // A glob pattern, like **​ .{ts,js}. See TextDocumentFilter for examples. // // Since: 3.18.0 - support for relative patterns. Whether clients support // relative patterns depends on the client capability // `textDocuments.filters.relativePatternSupport`. Pattern PatternOrRelativePattern `json:"pattern" lsp:"required"` } var _ json.UnmarshalerFrom = (*TextDocumentFilterPattern)(nil) func (s *TextDocumentFilterPattern) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type WorkspaceEditClientCapabilities struct { // The client supports versioned document changes in `WorkspaceEdit`s DocumentChanges *bool `json:"documentChanges,omitzero"` // The resource operations the client supports. Clients should at least // support 'create', 'rename' and 'delete' files and folders. // // Since: 3.13.0 ResourceOperations *[]ResourceOperationKind `json:"resourceOperations,omitzero"` // The failure handling strategy of a client if applying the workspace edit // fails. // // Since: 3.13.0 FailureHandling *FailureHandlingKind `json:"failureHandling,omitzero"` // Whether the client normalizes line endings to the client specific // setting. // If set to `true` the client will normalize line ending characters // in a workspace edit to the client-specified new line // character. // // Since: 3.16.0 NormalizesLineEndings *bool `json:"normalizesLineEndings,omitzero"` // Whether the client in general supports change annotations on text edits, // create file, rename file and delete file changes. // // Since: 3.16.0 ChangeAnnotationSupport *ChangeAnnotationsSupportOptions `json:"changeAnnotationSupport,omitzero"` // Whether the client supports `WorkspaceEditMetadata` in `WorkspaceEdit`s. // // Since: 3.18.0 MetadataSupport *bool `json:"metadataSupport,omitzero"` // Whether the client supports snippets as text edits. // // Since: 3.18.0 SnippetEditSupport *bool `json:"snippetEditSupport,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceEditClientCapabilities)(nil) func (s *WorkspaceEditClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DidChangeConfigurationClientCapabilities struct { // Did change configuration notification supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*DidChangeConfigurationClientCapabilities)(nil) func (s *DidChangeConfigurationClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DidChangeWatchedFilesClientCapabilities struct { // Did change watched files notification supports dynamic registration. Please note // that the current protocol doesn't support static configuration for file changes // from the server side. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Whether the client has support for pattern // or not. // // Since: 3.17.0 RelativePatternSupport *bool `json:"relativePatternSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DidChangeWatchedFilesClientCapabilities)(nil) func (s *DidChangeWatchedFilesClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities for a WorkspaceSymbolRequest. type WorkspaceSymbolClientCapabilities struct { // Symbol request supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. SymbolKind *ClientSymbolKindOptions `json:"symbolKind,omitzero"` // The client supports tags on `SymbolInformation`. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.16.0 TagSupport *ClientSymbolTagOptions `json:"tagSupport,omitzero"` // The client support partial workspace symbols. The client will send the // request `workspaceSymbol/resolve` to the server to resolve additional // properties. // // Since: 3.17.0 ResolveSupport *ClientSymbolResolveOptions `json:"resolveSupport,omitzero"` } var _ json.UnmarshalerFrom = (*WorkspaceSymbolClientCapabilities)(nil) func (s *WorkspaceSymbolClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The client capabilities of a ExecuteCommandRequest. type ExecuteCommandClientCapabilities struct { // Execute command supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*ExecuteCommandClientCapabilities)(nil) func (s *ExecuteCommandClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from // the server to the client. // // Note that this event is global and will force the client to refresh all // semantic tokens currently shown. It should be used with absolute care // and is useful for situation where a server for example detects a project // wide change that requires such a calculation. RefreshSupport *bool `json:"refreshSupport,omitzero"` } var _ json.UnmarshalerFrom = (*SemanticTokensWorkspaceClientCapabilities)(nil) func (s *SemanticTokensWorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type CodeLensWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from the // server to the client. // // Note that this event is global and will force the client to refresh all // code lenses currently shown. It should be used with absolute care and is // useful for situation where a server for example detect a project wide // change that requires such a calculation. RefreshSupport *bool `json:"refreshSupport,omitzero"` } var _ json.UnmarshalerFrom = (*CodeLensWorkspaceClientCapabilities)(nil) func (s *CodeLensWorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Capabilities relating to events from file operations by the user in the client. // // These events do not come from the file system, they come from user operations // like renaming a file in the UI. // // Since: 3.16.0 type FileOperationClientCapabilities struct { // Whether the client supports dynamic registration for file requests/notifications. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client has support for sending didCreateFiles notifications. DidCreate *bool `json:"didCreate,omitzero"` // The client has support for sending willCreateFiles requests. WillCreate *bool `json:"willCreate,omitzero"` // The client has support for sending didRenameFiles notifications. DidRename *bool `json:"didRename,omitzero"` // The client has support for sending willRenameFiles requests. WillRename *bool `json:"willRename,omitzero"` // The client has support for sending didDeleteFiles notifications. DidDelete *bool `json:"didDelete,omitzero"` // The client has support for sending willDeleteFiles requests. WillDelete *bool `json:"willDelete,omitzero"` } var _ json.UnmarshalerFrom = (*FileOperationClientCapabilities)(nil) func (s *FileOperationClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client workspace capabilities specific to inline values. // // Since: 3.17.0 type InlineValueWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from the // server to the client. // // Note that this event is global and will force the client to refresh all // inline values currently shown. It should be used with absolute care and is // useful for situation where a server for example detects a project wide // change that requires such a calculation. RefreshSupport *bool `json:"refreshSupport,omitzero"` } var _ json.UnmarshalerFrom = (*InlineValueWorkspaceClientCapabilities)(nil) func (s *InlineValueWorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client workspace capabilities specific to inlay hints. // // Since: 3.17.0 type InlayHintWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from // the server to the client. // // Note that this event is global and will force the client to refresh all // inlay hints currently shown. It should be used with absolute care and // is useful for situation where a server for example detects a project wide // change that requires such a calculation. RefreshSupport *bool `json:"refreshSupport,omitzero"` } var _ json.UnmarshalerFrom = (*InlayHintWorkspaceClientCapabilities)(nil) func (s *InlayHintWorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Workspace client capabilities specific to diagnostic pull requests. // // Since: 3.17.0 type DiagnosticWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from // the server to the client. // // Note that this event is global and will force the client to refresh all // pulled diagnostics currently shown. It should be used with absolute care and // is useful for situation where a server for example detects a project wide // change that requires such a calculation. RefreshSupport *bool `json:"refreshSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DiagnosticWorkspaceClientCapabilities)(nil) func (s *DiagnosticWorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client workspace capabilities specific to folding ranges // // Since: 3.18.0 type FoldingRangeWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from the // server to the client. // // Note that this event is global and will force the client to refresh all // folding ranges currently shown. It should be used with absolute care and is // useful for situation where a server for example detects a project wide // change that requires such a calculation. // // Since: 3.18.0 RefreshSupport *bool `json:"refreshSupport,omitzero"` } var _ json.UnmarshalerFrom = (*FoldingRangeWorkspaceClientCapabilities)(nil) func (s *FoldingRangeWorkspaceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities for a text document content provider. // // Since: 3.18.0 type TextDocumentContentClientCapabilities struct { // Text document content provider supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentContentClientCapabilities)(nil) func (s *TextDocumentContentClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type TextDocumentSyncClientCapabilities struct { // Whether text document synchronization supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports sending will save notifications. WillSave *bool `json:"willSave,omitzero"` // The client supports sending a will save request and // waits for a response providing text edits which will // be applied to the document before it is saved. WillSaveWaitUntil *bool `json:"willSaveWaitUntil,omitzero"` // The client supports did save notifications. DidSave *bool `json:"didSave,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentSyncClientCapabilities)(nil) func (s *TextDocumentSyncClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type TextDocumentFilterClientCapabilities struct { // The client supports Relative Patterns. // // Since: 3.18.0 RelativePatternSupport *bool `json:"relativePatternSupport,omitzero"` } var _ json.UnmarshalerFrom = (*TextDocumentFilterClientCapabilities)(nil) func (s *TextDocumentFilterClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Completion client capabilities type CompletionClientCapabilities struct { // Whether completion supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports the following `CompletionItem` specific // capabilities. CompletionItem *ClientCompletionItemOptions `json:"completionItem,omitzero"` // The client supports the following completion item kinds. CompletionItemKind *ClientCompletionItemOptionsKind `json:"completionItemKind,omitzero"` // Defines how the client handles whitespace and indentation // when accepting a completion item that uses multi line // text in either `insertText` or `textEdit`. // // Since: 3.17.0 InsertTextMode *InsertTextMode `json:"insertTextMode,omitzero"` // The client supports to send additional context information for a // `textDocument/completion` request. ContextSupport *bool `json:"contextSupport,omitzero"` // The client supports the following `CompletionList` specific // capabilities. // // Since: 3.17.0 CompletionList *CompletionListCapabilities `json:"completionList,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionClientCapabilities)(nil) func (s *CompletionClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type HoverClientCapabilities struct { // Whether hover supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Client supports the following content formats for the content // property. The order describes the preferred format of the client. ContentFormat *[]MarkupKind `json:"contentFormat,omitzero"` } var _ json.UnmarshalerFrom = (*HoverClientCapabilities)(nil) func (s *HoverClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client Capabilities for a SignatureHelpRequest. type SignatureHelpClientCapabilities struct { // Whether signature help supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports the following `SignatureInformation` // specific properties. SignatureInformation *ClientSignatureInformationOptions `json:"signatureInformation,omitzero"` // The client supports to send additional context information for a // `textDocument/signatureHelp` request. A client that opts into // contextSupport will also support the `retriggerCharacters` on // `SignatureHelpOptions`. // // Since: 3.15.0 ContextSupport *bool `json:"contextSupport,omitzero"` } var _ json.UnmarshalerFrom = (*SignatureHelpClientCapabilities)(nil) func (s *SignatureHelpClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.14.0 type DeclarationClientCapabilities struct { // Whether declaration supports dynamic registration. If this is set to `true` // the client supports the new `DeclarationRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of declaration links. LinkSupport *bool `json:"linkSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DeclarationClientCapabilities)(nil) func (s *DeclarationClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client Capabilities for a DefinitionRequest. type DefinitionClientCapabilities struct { // Whether definition supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of definition links. // // Since: 3.14.0 LinkSupport *bool `json:"linkSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DefinitionClientCapabilities)(nil) func (s *DefinitionClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since 3.6.0 type TypeDefinitionClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `TypeDefinitionRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of definition links. // // Since 3.14.0 LinkSupport *bool `json:"linkSupport,omitzero"` } var _ json.UnmarshalerFrom = (*TypeDefinitionClientCapabilities)(nil) func (s *TypeDefinitionClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.6.0 type ImplementationClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `ImplementationRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of definition links. // // Since: 3.14.0 LinkSupport *bool `json:"linkSupport,omitzero"` } var _ json.UnmarshalerFrom = (*ImplementationClientCapabilities)(nil) func (s *ImplementationClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client Capabilities for a ReferencesRequest. type ReferenceClientCapabilities struct { // Whether references supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*ReferenceClientCapabilities)(nil) func (s *ReferenceClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client Capabilities for a DocumentHighlightRequest. type DocumentHighlightClientCapabilities struct { // Whether document highlight supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentHighlightClientCapabilities)(nil) func (s *DocumentHighlightClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client Capabilities for a DocumentSymbolRequest. type DocumentSymbolClientCapabilities struct { // Whether document symbol supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Specific capabilities for the `SymbolKind` in the // `textDocument/documentSymbol` request. SymbolKind *ClientSymbolKindOptions `json:"symbolKind,omitzero"` // The client supports hierarchical document symbols. HierarchicalDocumentSymbolSupport *bool `json:"hierarchicalDocumentSymbolSupport,omitzero"` // The client supports tags on `SymbolInformation`. Tags are supported on // `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.16.0 TagSupport *ClientSymbolTagOptions `json:"tagSupport,omitzero"` // The client supports an additional label presented in the UI when // registering a document symbol provider. // // Since: 3.16.0 LabelSupport *bool `json:"labelSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentSymbolClientCapabilities)(nil) func (s *DocumentSymbolClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The Client Capabilities of a CodeActionRequest. type CodeActionClientCapabilities struct { // Whether code action supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The client support code action literals of type `CodeAction` as a valid // response of the `textDocument/codeAction` request. If the property is not // set the request can only return `Command` literals. // // Since: 3.8.0 CodeActionLiteralSupport *ClientCodeActionLiteralOptions `json:"codeActionLiteralSupport,omitzero"` // Whether code action supports the `isPreferred` property. // // Since: 3.15.0 IsPreferredSupport *bool `json:"isPreferredSupport,omitzero"` // Whether code action supports the `disabled` property. // // Since: 3.16.0 DisabledSupport *bool `json:"disabledSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/codeAction` and a // `codeAction/resolve` request. // // Since: 3.16.0 DataSupport *bool `json:"dataSupport,omitzero"` // Whether the client supports resolving additional code action // properties via a separate `codeAction/resolve` request. // // Since: 3.16.0 ResolveSupport *ClientCodeActionResolveOptions `json:"resolveSupport,omitzero"` // Whether the client honors the change annotations in // text edits and resource operations returned via the // `CodeAction#edit` property by for example presenting // the workspace edit in the user interface and asking // for confirmation. // // Since: 3.16.0 HonorsChangeAnnotations *bool `json:"honorsChangeAnnotations,omitzero"` // Whether the client supports documentation for a class of // code actions. // // Since: 3.18.0 DocumentationSupport *bool `json:"documentationSupport,omitzero"` // Client supports the tag property on a code action. Clients // supporting tags have to handle unknown tags gracefully. // // Since: 3.18.0 - proposed TagSupport *CodeActionTagOptions `json:"tagSupport,omitzero"` } var _ json.UnmarshalerFrom = (*CodeActionClientCapabilities)(nil) func (s *CodeActionClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The client capabilities of a CodeLensRequest. type CodeLensClientCapabilities struct { // Whether code lens supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Whether the client supports resolving additional code lens // properties via a separate `codeLens/resolve` request. // // Since: 3.18.0 ResolveSupport *ClientCodeLensResolveOptions `json:"resolveSupport,omitzero"` } var _ json.UnmarshalerFrom = (*CodeLensClientCapabilities)(nil) func (s *CodeLensClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The client capabilities of a DocumentLinkRequest. type DocumentLinkClientCapabilities struct { // Whether document link supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Whether the client supports the `tooltip` property on `DocumentLink`. // // Since: 3.15.0 TooltipSupport *bool `json:"tooltipSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentLinkClientCapabilities)(nil) func (s *DocumentLinkClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type DocumentColorClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `DocumentColorRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentColorClientCapabilities)(nil) func (s *DocumentColorClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities of a DocumentFormattingRequest. type DocumentFormattingClientCapabilities struct { // Whether formatting supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentFormattingClientCapabilities)(nil) func (s *DocumentFormattingClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities of a DocumentRangeFormattingRequest. type DocumentRangeFormattingClientCapabilities struct { // Whether range formatting supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Whether the client supports formatting multiple ranges at once. // // Since: 3.18.0 RangesSupport *bool `json:"rangesSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentRangeFormattingClientCapabilities)(nil) func (s *DocumentRangeFormattingClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities of a DocumentOnTypeFormattingRequest. type DocumentOnTypeFormattingClientCapabilities struct { // Whether on type formatting supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*DocumentOnTypeFormattingClientCapabilities)(nil) func (s *DocumentOnTypeFormattingClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type RenameClientCapabilities struct { // Whether rename supports dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Client supports testing for validity of rename operations // before execution. // // Since: 3.12.0 PrepareSupport *bool `json:"prepareSupport,omitzero"` // Client supports the default behavior result. // // The value indicates the default behavior used by the // client. // // Since: 3.16.0 PrepareSupportDefaultBehavior *PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitzero"` // Whether the client honors the change annotations in // text edits and resource operations returned via the // rename request's workspace edit by for example presenting // the workspace edit in the user interface and asking // for confirmation. // // Since: 3.16.0 HonorsChangeAnnotations *bool `json:"honorsChangeAnnotations,omitzero"` } var _ json.UnmarshalerFrom = (*RenameClientCapabilities)(nil) func (s *RenameClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type FoldingRangeClientCapabilities struct { // Whether implementation supports dynamic registration for folding range // providers. If this is set to `true` the client supports the new // `FoldingRangeRegistrationOptions` return value for the corresponding // server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // The maximum number of folding ranges that the client prefers to receive // per document. The value serves as a hint, servers are free to follow the // limit. RangeLimit *uint32 `json:"rangeLimit,omitzero"` // If set, the client signals that it only supports folding complete lines. // If set, client will ignore specified `startCharacter` and `endCharacter` // properties in a FoldingRange. LineFoldingOnly *bool `json:"lineFoldingOnly,omitzero"` // Specific options for the folding range kind. // // Since: 3.17.0 FoldingRangeKind *ClientFoldingRangeKindOptions `json:"foldingRangeKind,omitzero"` // Specific options for the folding range. // // Since: 3.17.0 FoldingRange *ClientFoldingRangeOptions `json:"foldingRange,omitzero"` } var _ json.UnmarshalerFrom = (*FoldingRangeClientCapabilities)(nil) func (s *FoldingRangeClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type SelectionRangeClientCapabilities struct { // Whether implementation supports dynamic registration for selection range providers. If this is set to `true` // the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server // capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*SelectionRangeClientCapabilities)(nil) func (s *SelectionRangeClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The publish diagnostic client capabilities. type PublishDiagnosticsClientCapabilities struct { // Whether the clients accepts diagnostics with related information. RelatedInformation *bool `json:"relatedInformation,omitzero"` // Client supports the tag property to provide meta data about a diagnostic. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.15.0 TagSupport *ClientDiagnosticsTagOptions `json:"tagSupport,omitzero"` // Client supports a codeDescription property // // Since: 3.16.0 CodeDescriptionSupport *bool `json:"codeDescriptionSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/publishDiagnostics` and // `textDocument/codeAction` request. // // Since: 3.16.0 DataSupport *bool `json:"dataSupport,omitzero"` // Whether the client interprets the version property of the // `textDocument/publishDiagnostics` notification's parameter. // // Since: 3.15.0 VersionSupport *bool `json:"versionSupport,omitzero"` } var _ json.UnmarshalerFrom = (*PublishDiagnosticsClientCapabilities)(nil) func (s *PublishDiagnosticsClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type CallHierarchyClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*CallHierarchyClientCapabilities)(nil) func (s *CallHierarchyClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.16.0 type SemanticTokensClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Which requests the client supports and might send to the server // depending on the server's capability. Please note that clients might not // show semantic tokens or degrade some of the user experience if a range // or full request is advertised by the client but not provided by the // server. If for example the client capability `requests.full` and // `request.range` are both set to true but the server only provides a // range provider the client might not render a minimap correctly or might // even decide to not show any semantic tokens at all. Requests *ClientSemanticTokensRequestOptions `json:"requests" lsp:"required"` // The token types that the client supports. TokenTypes []string `json:"tokenTypes" lsp:"required"` // The token modifiers that the client supports. TokenModifiers []string `json:"tokenModifiers" lsp:"required"` // The token formats the clients supports. Formats []TokenFormat `json:"formats" lsp:"required"` // Whether the client supports tokens that can overlap each other. OverlappingTokenSupport *bool `json:"overlappingTokenSupport,omitzero"` // Whether the client supports tokens that can span multiple lines. MultilineTokenSupport *bool `json:"multilineTokenSupport,omitzero"` // Whether the client allows the server to actively cancel a // semantic token request, e.g. supports returning // LSPErrorCodes.ServerCancelled. If a server does the client // needs to retrigger the request. // // Since: 3.17.0 ServerCancelSupport *bool `json:"serverCancelSupport,omitzero"` // Whether the client uses semantic tokens to augment existing // syntax tokens. If set to `true` client side created syntax // tokens and semantic tokens are both used for colorization. If // set to `false` the client only uses the returned semantic tokens // for colorization. // // If the value is `undefined` then the client behavior is not // specified. // // Since: 3.17.0 AugmentsSyntaxTokens *bool `json:"augmentsSyntaxTokens,omitzero"` } var _ json.UnmarshalerFrom = (*SemanticTokensClientCapabilities)(nil) func (s *SemanticTokensClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities for the linked editing range request. // // Since: 3.16.0 type LinkedEditingRangeClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*LinkedEditingRangeClientCapabilities)(nil) func (s *LinkedEditingRangeClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities specific to the moniker request. // // Since: 3.16.0 type MonikerClientCapabilities struct { // Whether moniker supports dynamic registration. If this is set to `true` // the client supports the new `MonikerRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*MonikerClientCapabilities)(nil) func (s *MonikerClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.17.0 type TypeHierarchyClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*TypeHierarchyClientCapabilities)(nil) func (s *TypeHierarchyClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities specific to inline values. // // Since: 3.17.0 type InlineValueClientCapabilities struct { // Whether implementation supports dynamic registration for inline value providers. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*InlineValueClientCapabilities)(nil) func (s *InlineValueClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Inlay hint client capabilities. // // Since: 3.17.0 type InlayHintClientCapabilities struct { // Whether inlay hints support dynamic registration. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Indicates which properties a client can resolve lazily on an inlay // hint. ResolveSupport *ClientInlayHintResolveOptions `json:"resolveSupport,omitzero"` } var _ json.UnmarshalerFrom = (*InlayHintClientCapabilities)(nil) func (s *InlayHintClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities specific to diagnostic pull requests. // // Since: 3.17.0 type DiagnosticClientCapabilities struct { // Whether the clients accepts diagnostics with related information. RelatedInformation *bool `json:"relatedInformation,omitzero"` // Client supports the tag property to provide meta data about a diagnostic. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.15.0 TagSupport *ClientDiagnosticsTagOptions `json:"tagSupport,omitzero"` // Client supports a codeDescription property // // Since: 3.16.0 CodeDescriptionSupport *bool `json:"codeDescriptionSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/publishDiagnostics` and // `textDocument/codeAction` request. // // Since: 3.16.0 DataSupport *bool `json:"dataSupport,omitzero"` // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` // Whether the clients supports related documents for document diagnostic pulls. RelatedDocumentSupport *bool `json:"relatedDocumentSupport,omitzero"` // Whether the client supports `MarkupContent` in diagnostic messages. // // Since: 3.18.0 MarkupMessageSupport *bool `json:"markupMessageSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DiagnosticClientCapabilities)(nil) func (s *DiagnosticClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities specific to inline completions. // // Since: 3.18.0 type InlineCompletionClientCapabilities struct { // Whether implementation supports dynamic registration for inline completion providers. DynamicRegistration *bool `json:"dynamicRegistration,omitzero"` } var _ json.UnmarshalerFrom = (*InlineCompletionClientCapabilities)(nil) func (s *InlineCompletionClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Show message request client capabilities type ShowMessageRequestClientCapabilities struct { // Capabilities specific to the `MessageActionItem` type. MessageActionItem *ClientShowMessageActionItemOptions `json:"messageActionItem,omitzero"` } var _ json.UnmarshalerFrom = (*ShowMessageRequestClientCapabilities)(nil) func (s *ShowMessageRequestClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities for the showDocument request. // // Since: 3.16.0 type ShowDocumentClientCapabilities struct { // The client has support for the showDocument // request. Support bool `json:"support" lsp:"required"` } var _ json.UnmarshalerFrom = (*ShowDocumentClientCapabilities)(nil) func (s *ShowDocumentClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type StaleRequestSupportOptions struct { // The client will actively cancel the request. Cancel bool `json:"cancel" lsp:"required"` // The list of requests for which the client // will retry the request if it receives a // response with error code `ContentModified` RetryOnContentModified []string `json:"retryOnContentModified" lsp:"required"` } var _ json.UnmarshalerFrom = (*StaleRequestSupportOptions)(nil) func (s *StaleRequestSupportOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities specific to regular expressions. // // Since: 3.16.0 type RegularExpressionsClientCapabilities struct { // The engine's name. Engine string `json:"engine" lsp:"required"` // The engine's version. Version *string `json:"version,omitzero"` } var _ json.UnmarshalerFrom = (*RegularExpressionsClientCapabilities)(nil) func (s *RegularExpressionsClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Client capabilities specific to the used markdown parser. // // Since: 3.16.0 type MarkdownClientCapabilities struct { // The name of the parser. Parser string `json:"parser" lsp:"required"` // The version of the parser. Version *string `json:"version,omitzero"` // A list of HTML tags that the client allows / supports in // Markdown. // // Since: 3.17.0 AllowedTags *[]string `json:"allowedTags,omitzero"` } var _ json.UnmarshalerFrom = (*MarkdownClientCapabilities)(nil) func (s *MarkdownClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ChangeAnnotationsSupportOptions struct { // Whether the client groups edits with equal labels into tree nodes, // for instance all edits labelled with "Changes in Strings" would // be a tree node. GroupsOnLabel *bool `json:"groupsOnLabel,omitzero"` } var _ json.UnmarshalerFrom = (*ChangeAnnotationsSupportOptions)(nil) func (s *ChangeAnnotationsSupportOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSymbolKindOptions struct { // The symbol kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. // // If this property is not present the client only supports // the symbol kinds from `File` to `Array` as defined in // the initial version of the protocol. ValueSet *[]SymbolKind `json:"valueSet,omitzero"` } var _ json.UnmarshalerFrom = (*ClientSymbolKindOptions)(nil) func (s *ClientSymbolKindOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSymbolTagOptions struct { // The tags supported by the client. ValueSet []SymbolTag `json:"valueSet" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientSymbolTagOptions)(nil) func (s *ClientSymbolTagOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSymbolResolveOptions struct { // The properties that a client can resolve lazily. Usually // `location.range` Properties []string `json:"properties" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientSymbolResolveOptions)(nil) func (s *ClientSymbolResolveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCompletionItemOptions struct { // Client supports snippets as insert text. // // A snippet can define tab stops and placeholders with `$1`, `$2` // and `${3:foo}`. `$0` defines the final tab stop, it defaults to // the end of the snippet. Placeholders with equal identifiers are linked, // that is typing in one will update others too. SnippetSupport *bool `json:"snippetSupport,omitzero"` // Client supports commit characters on a completion item. CommitCharactersSupport *bool `json:"commitCharactersSupport,omitzero"` // Client supports the following content formats for the documentation // property. The order describes the preferred format of the client. DocumentationFormat *[]MarkupKind `json:"documentationFormat,omitzero"` // Client supports the deprecated property on a completion item. DeprecatedSupport *bool `json:"deprecatedSupport,omitzero"` // Client supports the preselect property on a completion item. PreselectSupport *bool `json:"preselectSupport,omitzero"` // Client supports the tag property on a completion item. Clients supporting // tags have to handle unknown tags gracefully. Clients especially need to // preserve unknown tags when sending a completion item back to the server in // a resolve call. // // Since: 3.15.0 TagSupport *CompletionItemTagOptions `json:"tagSupport,omitzero"` // Client support insert replace edit to control different behavior if a // completion item is inserted in the text or should replace text. // // Since: 3.16.0 InsertReplaceSupport *bool `json:"insertReplaceSupport,omitzero"` // Indicates which properties a client can resolve lazily on a completion // item. Before version 3.16.0 only the predefined properties `documentation` // and `details` could be resolved lazily. // // Since: 3.16.0 ResolveSupport *ClientCompletionItemResolveOptions `json:"resolveSupport,omitzero"` // The client supports the `insertTextMode` property on // a completion item to override the whitespace handling mode // as defined by the client (see `insertTextMode`). // // Since: 3.16.0 InsertTextModeSupport *ClientCompletionItemInsertTextModeOptions `json:"insertTextModeSupport,omitzero"` // The client has support for completion item label // details (see also `CompletionItemLabelDetails`). // // Since: 3.17.0 LabelDetailsSupport *bool `json:"labelDetailsSupport,omitzero"` } var _ json.UnmarshalerFrom = (*ClientCompletionItemOptions)(nil) func (s *ClientCompletionItemOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCompletionItemOptionsKind struct { // The completion item kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. // // If this property is not present the client only supports // the completion items kinds from `Text` to `Reference` as defined in // the initial version of the protocol. ValueSet *[]CompletionItemKind `json:"valueSet,omitzero"` } var _ json.UnmarshalerFrom = (*ClientCompletionItemOptionsKind)(nil) func (s *ClientCompletionItemOptionsKind) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // The client supports the following `CompletionList` specific // capabilities. // // Since: 3.17.0 type CompletionListCapabilities struct { // The client supports the following itemDefaults on // a completion list. // // The value lists the supported property names of the // `CompletionList.itemDefaults` object. If omitted // no properties are supported. // // Since: 3.17.0 ItemDefaults *[]string `json:"itemDefaults,omitzero"` // Specifies whether the client supports `CompletionList.applyKind` to // indicate how supported values from `completionList.itemDefaults` // and `completion` will be combined. // // If a client supports `applyKind` it must support it for all fields // that it supports that are listed in `CompletionList.applyKind`. This // means when clients add support for new/future fields in completion // items the MUST also support merge for them if those fields are // defined in `CompletionList.applyKind`. // // Since: 3.18.0 ApplyKindSupport *bool `json:"applyKindSupport,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionListCapabilities)(nil) func (s *CompletionListCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSignatureInformationOptions struct { // Client supports the following content formats for the documentation // property. The order describes the preferred format of the client. DocumentationFormat *[]MarkupKind `json:"documentationFormat,omitzero"` // Client capabilities specific to parameter information. ParameterInformation *ClientSignatureParameterInformationOptions `json:"parameterInformation,omitzero"` // The client supports the `activeParameter` property on `SignatureInformation` // literal. // // Since: 3.16.0 ActiveParameterSupport *bool `json:"activeParameterSupport,omitzero"` // The client supports the `activeParameter` property on // `SignatureHelp`/`SignatureInformation` being set to `null` to // indicate that no parameter should be active. // // Since: 3.18.0 NoActiveParameterSupport *bool `json:"noActiveParameterSupport,omitzero"` } var _ json.UnmarshalerFrom = (*ClientSignatureInformationOptions)(nil) func (s *ClientSignatureInformationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCodeActionLiteralOptions struct { // The code action kind is support with the following value // set. CodeActionKind *ClientCodeActionKindOptions `json:"codeActionKind" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientCodeActionLiteralOptions)(nil) func (s *ClientCodeActionLiteralOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCodeActionResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientCodeActionResolveOptions)(nil) func (s *ClientCodeActionResolveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 - proposed type CodeActionTagOptions struct { // The tags supported by the client. ValueSet []CodeActionTag `json:"valueSet" lsp:"required"` } var _ json.UnmarshalerFrom = (*CodeActionTagOptions)(nil) func (s *CodeActionTagOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCodeLensResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientCodeLensResolveOptions)(nil) func (s *ClientCodeLensResolveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientFoldingRangeKindOptions struct { // The folding range kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. ValueSet *[]FoldingRangeKind `json:"valueSet,omitzero"` } var _ json.UnmarshalerFrom = (*ClientFoldingRangeKindOptions)(nil) func (s *ClientFoldingRangeKindOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientFoldingRangeOptions struct { // If set, the client signals that it supports setting collapsedText on // folding ranges to display custom labels instead of the default text. // // Since: 3.17.0 CollapsedText *bool `json:"collapsedText,omitzero"` } var _ json.UnmarshalerFrom = (*ClientFoldingRangeOptions)(nil) func (s *ClientFoldingRangeOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // General diagnostics capabilities for pull and push model. type DiagnosticsCapabilities struct { // Whether the clients accepts diagnostics with related information. RelatedInformation *bool `json:"relatedInformation,omitzero"` // Client supports the tag property to provide meta data about a diagnostic. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.15.0 TagSupport *ClientDiagnosticsTagOptions `json:"tagSupport,omitzero"` // Client supports a codeDescription property // // Since: 3.16.0 CodeDescriptionSupport *bool `json:"codeDescriptionSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/publishDiagnostics` and // `textDocument/codeAction` request. // // Since: 3.16.0 DataSupport *bool `json:"dataSupport,omitzero"` } var _ json.UnmarshalerFrom = (*DiagnosticsCapabilities)(nil) func (s *DiagnosticsCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSemanticTokensRequestOptions struct { // The client will send the `textDocument/semanticTokens/range` request if // the server provides a corresponding handler. Range *BooleanOrEmptyObject `json:"range,omitzero"` // The client will send the `textDocument/semanticTokens/full` request if // the server provides a corresponding handler. Full *BooleanOrClientSemanticTokensRequestFullDelta `json:"full,omitzero"` } var _ json.UnmarshalerFrom = (*ClientSemanticTokensRequestOptions)(nil) func (s *ClientSemanticTokensRequestOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientInlayHintResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientInlayHintResolveOptions)(nil) func (s *ClientInlayHintResolveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientShowMessageActionItemOptions struct { // Whether the client supports additional attributes which // are preserved and send back to the server in the // request's response. AdditionalPropertiesSupport *bool `json:"additionalPropertiesSupport,omitzero"` } var _ json.UnmarshalerFrom = (*ClientShowMessageActionItemOptions)(nil) func (s *ClientShowMessageActionItemOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type CompletionItemTagOptions struct { // The tags supported by the client. ValueSet []CompletionItemTag `json:"valueSet" lsp:"required"` } var _ json.UnmarshalerFrom = (*CompletionItemTagOptions)(nil) func (s *CompletionItemTagOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCompletionItemResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientCompletionItemResolveOptions)(nil) func (s *ClientCompletionItemResolveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCompletionItemInsertTextModeOptions struct { ValueSet []InsertTextMode `json:"valueSet" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientCompletionItemInsertTextModeOptions)(nil) func (s *ClientCompletionItemInsertTextModeOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSignatureParameterInformationOptions struct { // The client supports processing label offsets instead of a // simple label string. // // Since: 3.14.0 LabelOffsetSupport *bool `json:"labelOffsetSupport,omitzero"` } var _ json.UnmarshalerFrom = (*ClientSignatureParameterInformationOptions)(nil) func (s *ClientSignatureParameterInformationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientCodeActionKindOptions struct { // The code action kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. ValueSet []CodeActionKind `json:"valueSet" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientCodeActionKindOptions)(nil) func (s *ClientCodeActionKindOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientDiagnosticsTagOptions struct { // The tags supported by the client. ValueSet []DiagnosticTag `json:"valueSet" lsp:"required"` } var _ json.UnmarshalerFrom = (*ClientDiagnosticsTagOptions)(nil) func (s *ClientDiagnosticsTagOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Since: 3.18.0 type ClientSemanticTokensRequestFullDelta struct { // The client will send the `textDocument/semanticTokens/full/delta` request if // the server provides a corresponding handler. Delta *bool `json:"delta,omitzero"` } var _ json.UnmarshalerFrom = (*ClientSemanticTokensRequestFullDelta)(nil) func (s *ClientSemanticTokensRequestFullDelta) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // InitializationOptions contains user-provided initialization options. type InitializationOptions struct { // DisablePushDiagnostics disables automatic pushing of diagnostics to the client. DisablePushDiagnostics *bool `json:"disablePushDiagnostics,omitzero"` // The client-side command name that resolved references/implementations `CodeLens` should trigger. Arguments passed will be `(DocumentUri, Position, Location[])`. CodeLensShowLocationsCommandName *string `json:"codeLensShowLocationsCommandName,omitzero"` // userPreferences and/or formatting options if provided at initialization. UserPreferences *any `json:"userPreferences,omitzero" lsp:"nullable"` // EnableTelemetry enables sending telemetry events from the server to the client. EnableTelemetry *bool `json:"enableTelemetry,omitzero"` // The initial log verbosity level, matching the client's output channel log level at startup. Subsequent changes are sent via custom/setLogVerbosity. LogVerbosity *LogVerbosity `json:"logVerbosity,omitzero"` } var _ json.UnmarshalerFrom = (*InitializationOptions)(nil) func (s *InitializationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // AutoImportFix contains information about an auto-import suggestion. type AutoImportFix struct { Kind AutoImportFixKind `json:"kind,omitzero" lsp:"nullable"` Name string `json:"name,omitzero" lsp:"nullable"` ImportKind ImportKind `json:"importKind" lsp:"required"` UseRequire bool `json:"useRequire,omitzero" lsp:"nullable"` AddAsTypeOnly AddAsTypeOnly `json:"addAsTypeOnly" lsp:"required"` // The module specifier for this auto-import. ModuleSpecifier string `json:"moduleSpecifier,omitzero" lsp:"nullable"` // Index of the import to modify when adding to an existing import declaration. ImportIndex int32 `json:"importIndex" lsp:"required"` UsagePosition *Position `json:"usagePosition,omitzero"` NamespacePrefix string `json:"namespacePrefix,omitzero" lsp:"nullable"` } var _ json.UnmarshalerFrom = (*AutoImportFix)(nil) func (s *AutoImportFix) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // CompletionItemData is preserved on a CompletionItem between CompletionRequest and CompletionResolveRequest. type CompletionItemData struct { // The file name where the completion was requested. FileName string `json:"fileName,omitzero" lsp:"nullable"` // The position where the completion was requested. Position int32 `json:"position,omitzero" lsp:"nullable"` // Special source value for disambiguation. Source string `json:"source,omitzero" lsp:"nullable"` // The name of the completion item. Name string `json:"name,omitzero" lsp:"nullable"` // Auto-import data for this completion item. AutoImport *AutoImportFix `json:"autoImport,omitzero"` } var _ json.UnmarshalerFrom = (*CompletionItemData)(nil) func (s *CompletionItemData) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } type CodeLensData struct { // The kind of the code lens ("references" or "implementations"). Kind CodeLensKind `json:"kind" lsp:"required"` // The document in which the code lens and its range are located. Uri DocumentUri `json:"uri" lsp:"required"` } var _ json.UnmarshalerFrom = (*CodeLensData)(nil) func (s *CodeLensData) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // ExperimentalServerCapabilities contains experimental capabilities under development. type ExperimentalServerCapabilities struct { // The server provides source definition support via custom/textDocument/sourceDefinition. CustomSourceDefinitionProvider *bool `json:"customSourceDefinitionProvider,omitzero"` // The server provides multi-document highlight support via custom/textDocument/multiDocumentHighlight. CustomMultiDocumentHighlightProvider *bool `json:"customMultiDocumentHighlightProvider,omitzero"` } var _ json.UnmarshalerFrom = (*ExperimentalServerCapabilities)(nil) func (s *ExperimentalServerCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // ExperimentalClientCapabilities contains experimental capabilities under development. type ExperimentalClientCapabilities struct { // The client supports hover verbosityLevel requests and canIncreaseVerbosity responses. HoverVerbosityLevel *bool `json:"hoverVerbosityLevel,omitzero"` } var _ json.UnmarshalerFrom = (*ExperimentalClientCapabilities)(nil) func (s *ExperimentalClientCapabilities) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Options for the textDocument/_vs_onAutoInsert provider capability. type VSOnAutoInsertOptions struct { // List of trigger characters that trigger auto-insert. VSTriggerCharacters []string `json:"_vs_triggerCharacters" lsp:"required"` } var _ json.UnmarshalerFrom = (*VSOnAutoInsertOptions)(nil) func (s *VSOnAutoInsertOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A VS-specific reference item with grouping support for Find All References. type VSReferenceItem struct { // Unique identifier for this reference item. VSId int32 `json:"_vs_id" lsp:"required"` // The ID of the definition item this reference belongs to. Absent for definition items themselves. VSDefinitionId *int32 `json:"_vs_definitionId,omitzero"` // The kind(s) of this reference (read, write, etc.). VSKind *[]VSReferenceKind `json:"_vs_kind,omitzero"` // The location of this reference. VSLocation Location `json:"_vs_location" lsp:"required"` // Classified display text for the definition (used for grouping headers in the UI). VSDefinitionText *VSClassifiedTextElement `json:"_vs_definitionText,omitzero"` // The project name for this reference. VSProjectName *string `json:"_vs_projectName,omitzero"` // The containing type for this reference. VSContainingType *string `json:"_vs_containingType,omitzero"` } var _ json.UnmarshalerFrom = (*VSReferenceItem)(nil) func (s *VSReferenceItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the textDocument/_vs_onAutoInsert request. type VSOnAutoInsertParams struct { // The text document. VSTextDocument TextDocumentIdentifier `json:"_vs_textDocument" lsp:"required"` // The position inside the text document. VSPosition Position `json:"_vs_position" lsp:"required"` // The character that triggered the auto-insert. VSCh string `json:"_vs_ch" lsp:"required"` } func (s *VSOnAutoInsertParams) TextDocumentURI() DocumentUri { return s.VSTextDocument.Uri } func (s *VSOnAutoInsertParams) TextDocumentPosition() Position { return s.VSPosition } var _ json.UnmarshalerFrom = (*VSOnAutoInsertParams)(nil) func (s *VSOnAutoInsertParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Response item for the textDocument/_vs_onAutoInsert request. type VSOnAutoInsertResponseItem struct { // The format of the text edit (plaintext or snippet). VSTextEditFormat InsertTextFormat `json:"_vs_textEditFormat" lsp:"required"` // The text edit to apply for the auto-insertion. VSTextEdit *TextEdit `json:"_vs_textEdit" lsp:"required"` } var _ json.UnmarshalerFrom = (*VSOnAutoInsertResponseItem)(nil) func (s *VSOnAutoInsertResponseItem) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A RequestFailureTelemetryEvent is sent when a request fails and the server recovers. type RequestFailureTelemetryEvent struct { // The name of the telemetry event. EventName StringLiteralLanguageServerErrorResponse `json:"eventName" lsp:"required"` // Indicates whether the reason for generating the event (e.g. general usage telemetry or errors). TelemetryPurpose StringLiteralError `json:"telemetryPurpose" lsp:"required"` // The properties associated with the event. Properties *RequestFailureTelemetryProperties `json:"properties" lsp:"required"` } var _ json.UnmarshalerFrom = (*RequestFailureTelemetryEvent)(nil) func (s *RequestFailureTelemetryEvent) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // RequestFailureTelemetryProperties contains failure information when an LSP request manages to recover. type RequestFailureTelemetryProperties struct { // The error code associated with the event. ErrorCode string `json:"errorCode" lsp:"required"` // The method of the request that caused the event. RequestMethod string `json:"requestMethod" lsp:"required"` // The stack trace associated with the event. Stack string `json:"stack" lsp:"required"` } var _ json.UnmarshalerFrom = (*RequestFailureTelemetryProperties)(nil) func (s *RequestFailureTelemetryProperties) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for profiling requests. type ProfileParams struct { // The directory path where the profile should be saved. Dir string `json:"dir" lsp:"required"` } var _ json.UnmarshalerFrom = (*ProfileParams)(nil) func (s *ProfileParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Result of a profiling request. type ProfileResult struct { // The file path where the profile was saved. File string `json:"file" lsp:"required"` } var _ json.UnmarshalerFrom = (*ProfileResult)(nil) func (s *ProfileResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the initializeAPISession request. type InitializeAPISessionParams struct { // Optional path to use for the named pipe or Unix domain socket. If not provided, a unique path will be generated. Pipe *string `json:"pipe,omitzero"` } var _ json.UnmarshalerFrom = (*InitializeAPISessionParams)(nil) func (s *InitializeAPISessionParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Result for the initializeAPISession request. type InitializeAPISessionResult struct { // The unique identifier for this API session. SessionId string `json:"sessionId" lsp:"required"` // The path to the named pipe or Unix domain socket for API communication. Pipe string `json:"pipe" lsp:"required"` } var _ json.UnmarshalerFrom = (*InitializeAPISessionResult)(nil) func (s *InitializeAPISessionResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the custom/projectInfo request. type ProjectInfoParams struct { // The text document to get project info for. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` } func (s *ProjectInfoParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } var _ json.UnmarshalerFrom = (*ProjectInfoParams)(nil) func (s *ProjectInfoParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Result for the custom/projectInfo request. type ProjectInfoResult struct { // The absolute path to the config file (e.g. /path/to/tsconfig.json) for the project that contains this file, or an empty string if the file is in an inferred project. ConfigFilePath string `json:"configFilePath" lsp:"required"` } var _ json.UnmarshalerFrom = (*ProjectInfoResult)(nil) func (s *ProjectInfoResult) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the custom/setLogVerbosity notification. type SetLogVerbosityParams struct { // The log verbosity level. Verbosity LogVerbosity `json:"verbosity" lsp:"required"` } var _ json.UnmarshalerFrom = (*SetLogVerbosityParams)(nil) func (s *SetLogVerbosityParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A PerformanceStatsTelemetryEvent is sent periodically with performance and resource usage statistics. type PerformanceStatsTelemetryEvent struct { // The name of the telemetry event. EventName StringLiteralLanguageServerPerformanceStats `json:"eventName" lsp:"required"` // Indicates this is a usage telemetry event. TelemetryPurpose StringLiteralUsage `json:"telemetryPurpose" lsp:"required"` // Numeric measurements for this telemetry event. Measurements *PerformanceStatsTelemetryMeasurements `json:"measurements" lsp:"required"` } var _ json.UnmarshalerFrom = (*PerformanceStatsTelemetryEvent)(nil) func (s *PerformanceStatsTelemetryEvent) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Numeric measurements for PerformanceStatsTelemetryEvent. type PerformanceStatsTelemetryMeasurements struct { // Number of files currently open in the editor. OpenFileCount float64 `json:"openFileCount,omitzero" lsp:"nullable"` // Seconds since the session was initialized. UptimeSeconds float64 `json:"uptimeSeconds,omitzero" lsp:"nullable"` // Number of loaded projects. ProjectCount float64 `json:"projectCount,omitzero" lsp:"nullable"` // Number of loaded config files. ConfigCount float64 `json:"configCount,omitzero" lsp:"nullable"` // Number of files cached from disk. CachedDiskFileCount float64 `json:"cachedDiskFileCount,omitzero" lsp:"nullable"` // Total memory mapped by the Go runtime in bytes. MemoryUsedBytes float64 `json:"memoryUsedBytes,omitzero" lsp:"nullable"` // GOMEMLIMIT value in bytes, or 0 if not set. GoMemLimit float64 `json:"goMemLimit,omitzero" lsp:"nullable"` // GOGC percentage value configured for the GC. GoGCPercent float64 `json:"goGCPercent,omitzero" lsp:"nullable"` // Heap size target the GC is working toward in bytes. HeapGoalBytes float64 `json:"heapGoalBytes,omitzero" lsp:"nullable"` // Bytes of live (reachable) heap objects. HeapLiveBytes float64 `json:"heapLiveBytes,omitzero" lsp:"nullable"` // Number of live or unswept objects occupying heap memory. HeapObjectCount float64 `json:"heapObjectCount,omitzero" lsp:"nullable"` // Heap memory reserved for goroutine stacks. HeapStackBytes float64 `json:"heapStackBytes,omitzero" lsp:"nullable"` // Heap memory returned to the OS. HeapReleasedBytes float64 `json:"heapReleasedBytes,omitzero" lsp:"nullable"` // Heap memory that is free and eligible to be returned to the OS. HeapFreeBytes float64 `json:"heapFreeBytes,omitzero" lsp:"nullable"` // Total scannable heap bytes — how much the GC must traverse. GcScanHeapBytes float64 `json:"gcScanHeapBytes,omitzero" lsp:"nullable"` // The current GOMAXPROCS value. GoMaxProcs float64 `json:"goMaxProcs,omitzero" lsp:"nullable"` // Current number of goroutines. GoroutineCount float64 `json:"goroutineCount,omitzero" lsp:"nullable"` // Total completed GC cycles. GcCyclesTotal float64 `json:"gcCyclesTotal,omitzero" lsp:"nullable"` // Cumulative CPU time spent in GC in seconds. GcCPUSeconds float64 `json:"gcCPUSeconds,omitzero" lsp:"nullable"` // Cumulative CPU time spent in user Go code in seconds. UserCPUSeconds float64 `json:"userCPUSeconds,omitzero" lsp:"nullable"` // Total physical memory on the system in bytes. SystemMemTotal float64 `json:"systemMemTotal,omitzero" lsp:"nullable"` // Used physical memory on the system in bytes. SystemMemUsed float64 `json:"systemMemUsed,omitzero" lsp:"nullable"` // Number of auto-import project buckets. AutoImportProjectBucketCount float64 `json:"autoImportProjectBucketCount,omitzero" lsp:"nullable"` // Number of auto-import node_modules buckets. AutoImportNodeModulesBucketCount float64 `json:"autoImportNodeModulesBucketCount,omitzero" lsp:"nullable"` // Unique packages across all node_modules buckets. AutoImportUniquePackageCount float64 `json:"autoImportUniquePackageCount,omitzero" lsp:"nullable"` // Total indexed exports from project files. AutoImportProjectExportCount float64 `json:"autoImportProjectExportCount,omitzero" lsp:"nullable"` // Total indexed exports from node_modules. AutoImportNodeModulesExportCount float64 `json:"autoImportNodeModulesExportCount,omitzero" lsp:"nullable"` // Total files tracked across project buckets. AutoImportProjectFileCount float64 `json:"autoImportProjectFileCount,omitzero" lsp:"nullable"` // Total files tracked across node_modules buckets. AutoImportNodeModulesFileCount float64 `json:"autoImportNodeModulesFileCount,omitzero" lsp:"nullable"` // Number of node_modules buckets with no package.json filter. AutoImportNodeModulesUnfilteredBucketCount float64 `json:"autoImportNodeModulesUnfilteredBucketCount,omitzero" lsp:"nullable"` } // A ProjectInfoTelemetryEvent is sent once per project when it is first loaded. type ProjectInfoTelemetryEvent struct { // The name of the telemetry event. EventName StringLiteralLanguageServerProjectInfo `json:"eventName" lsp:"required"` // Indicates this is a usage telemetry event. TelemetryPurpose StringLiteralUsage `json:"telemetryPurpose" lsp:"required"` // String properties for this telemetry event. Complex values (compilerOptions, fileStats) are JSON-stringified. Properties map[string]string `json:"properties" lsp:"required"` // Numeric measurements for this telemetry event. Measurements *ProjectInfoTelemetryMeasurements `json:"measurements" lsp:"required"` } var _ json.UnmarshalerFrom = (*ProjectInfoTelemetryEvent)(nil) func (s *ProjectInfoTelemetryEvent) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Numeric measurements for ProjectInfoTelemetryEvent. type ProjectInfoTelemetryMeasurements struct { JsFileCount float64 `json:"jsFileCount,omitzero" lsp:"nullable"` JsFileSize float64 `json:"jsFileSize,omitzero" lsp:"nullable"` JsxFileCount float64 `json:"jsxFileCount,omitzero" lsp:"nullable"` JsxFileSize float64 `json:"jsxFileSize,omitzero" lsp:"nullable"` TsFileCount float64 `json:"tsFileCount,omitzero" lsp:"nullable"` TsFileSize float64 `json:"tsFileSize,omitzero" lsp:"nullable"` TsxFileCount float64 `json:"tsxFileCount,omitzero" lsp:"nullable"` TsxFileSize float64 `json:"tsxFileSize,omitzero" lsp:"nullable"` DtsFileCount float64 `json:"dtsFileCount,omitzero" lsp:"nullable"` DtsFileSize float64 `json:"dtsFileSize,omitzero" lsp:"nullable"` } // Represents a collection of document highlights from a single document, used in multi-document highlight responses. type MultiDocumentHighlight struct { // The URI of the document containing the highlights. Uri DocumentUri `json:"uri" lsp:"required"` // The highlights for the document. Highlights []*DocumentHighlight `json:"highlights" lsp:"required"` } var _ json.UnmarshalerFrom = (*MultiDocumentHighlight)(nil) func (s *MultiDocumentHighlight) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Parameters for the custom/textDocument/multiDocumentHighlight request. type MultiDocumentHighlightParams struct { // The text document. TextDocument TextDocumentIdentifier `json:"textDocument" lsp:"required"` // The position inside the text document. Position Position `json:"position" lsp:"required"` // The list of file URIs to search for highlights across. FilesToSearch []DocumentUri `json:"filesToSearch" lsp:"required"` } func (s *MultiDocumentHighlightParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } func (s *MultiDocumentHighlightParams) TextDocumentPosition() Position { return s.Position } var _ json.UnmarshalerFrom = (*MultiDocumentHighlightParams)(nil) func (s *MultiDocumentHighlightParams) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A classified text run with text and classification type, used for colorized display in VS. type VSClassifiedTextRun struct { // The classification type name (e.g. 'keyword', 'class name', 'parameter name'). ClassificationTypeName string `json:"ClassificationTypeName" lsp:"required"` // The text content of this run. Text string `json:"Text" lsp:"required"` // Optional marker tag type. MarkerTagType *string `json:"MarkerTagType,omitzero"` // The style of this text run. Style int32 `json:"Style,omitzero" lsp:"nullable"` // VS type discriminator required by ObjectContentConverter for deserialization. VSType StringLiteralClassifiedTextRun `json:"_vs_type" lsp:"required"` } var _ json.UnmarshalerFrom = (*VSClassifiedTextRun)(nil) func (s *VSClassifiedTextRun) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // A classified text element containing an array of classified text runs, used for colorized labels in VS. type VSClassifiedTextElement struct { // The classified text runs that make up this element. Runs []*VSClassifiedTextRun `json:"Runs" lsp:"required"` // VS type discriminator required by ObjectContentConverter for deserialization. VSType StringLiteralClassifiedTextElement `json:"_vs_type" lsp:"required"` } var _ json.UnmarshalerFrom = (*VSClassifiedTextElement)(nil) func (s *VSClassifiedTextElement) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // CallHierarchyItemData is a placeholder for custom data preserved on a CallHierarchyItem. type CallHierarchyItemData struct{} // TypeHierarchyItemData is a placeholder for custom data preserved on a TypeHierarchyItem. type TypeHierarchyItemData struct{} // InlayHintData is a placeholder for custom data preserved on a InlayHint. type InlayHintData struct{} // CodeActionData is a placeholder for custom data preserved on a CodeAction. type CodeActionData struct{} // WorkspaceSymbolData is a placeholder for custom data preserved on a WorkspaceSymbol. type WorkspaceSymbolData struct{} // DocumentLinkData is a placeholder for custom data preserved on a DocumentLink. type DocumentLinkData struct{} // DiagnosticData is a placeholder for custom data preserved on a Diagnostic. type DiagnosticData struct{} // CompletionItemDefaultsData is a placeholder for custom data preserved on a CompletionItemDefaults. type CompletionItemDefaultsData struct{} // Registration options for textDocument/colorPresentation. type ColorPresentationRegistrationOptions struct { WorkDoneProgress *bool `json:"workDoneProgress,omitzero"` // A document selector to identify the scope of the registration. If set to null // the document selector provided on the client side will be used. DocumentSelector DocumentSelectorOrNull `json:"documentSelector" lsp:"required"` } var _ json.UnmarshalerFrom = (*ColorPresentationRegistrationOptions)(nil) func (s *ColorPresentationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { return unmarshalStruct(s, dec) } // Enumerations // A set of predefined token types. This set is not fixed // an clients can specify additional token types via the // corresponding client capabilities. // // Since: 3.16.0 type SemanticTokenType string const ( SemanticTokenTypeNamespace SemanticTokenType = "namespace" // Represents a generic type. Acts as a fallback for types which can't be mapped to // a specific type like class or enum. SemanticTokenTypeType SemanticTokenType = "type" SemanticTokenTypeClass SemanticTokenType = "class" SemanticTokenTypeEnum SemanticTokenType = "enum" SemanticTokenTypeInterface SemanticTokenType = "interface" SemanticTokenTypeStruct SemanticTokenType = "struct" SemanticTokenTypeTypeParameter SemanticTokenType = "typeParameter" SemanticTokenTypeParameter SemanticTokenType = "parameter" SemanticTokenTypeVariable SemanticTokenType = "variable" SemanticTokenTypeProperty SemanticTokenType = "property" SemanticTokenTypeEnumMember SemanticTokenType = "enumMember" SemanticTokenTypeEvent SemanticTokenType = "event" SemanticTokenTypeFunction SemanticTokenType = "function" SemanticTokenTypeMethod SemanticTokenType = "method" SemanticTokenTypeMacro SemanticTokenType = "macro" SemanticTokenTypeKeyword SemanticTokenType = "keyword" SemanticTokenTypeModifier SemanticTokenType = "modifier" SemanticTokenTypeComment SemanticTokenType = "comment" SemanticTokenTypeString SemanticTokenType = "string" SemanticTokenTypeNumber SemanticTokenType = "number" SemanticTokenTypeRegexp SemanticTokenType = "regexp" SemanticTokenTypeOperator SemanticTokenType = "operator" // Since: 3.17.0 SemanticTokenTypeDecorator SemanticTokenType = "decorator" // Since: 3.18.0 SemanticTokenTypeLabel SemanticTokenType = "label" ) // A set of predefined token modifiers. This set is not fixed // an clients can specify additional token types via the // corresponding client capabilities. // // Since: 3.16.0 type SemanticTokenModifier string const ( SemanticTokenModifierDeclaration SemanticTokenModifier = "declaration" SemanticTokenModifierDefinition SemanticTokenModifier = "definition" SemanticTokenModifierReadonly SemanticTokenModifier = "readonly" SemanticTokenModifierStatic SemanticTokenModifier = "static" SemanticTokenModifierDeprecated SemanticTokenModifier = "deprecated" SemanticTokenModifierAbstract SemanticTokenModifier = "abstract" SemanticTokenModifierAsync SemanticTokenModifier = "async" SemanticTokenModifierModification SemanticTokenModifier = "modification" SemanticTokenModifierDocumentation SemanticTokenModifier = "documentation" SemanticTokenModifierDefaultLibrary SemanticTokenModifier = "defaultLibrary" ) // The document diagnostic report kinds. // // Since: 3.17.0 type DocumentDiagnosticReportKind string const ( // A diagnostic report with a full // set of problems. DocumentDiagnosticReportKindFull DocumentDiagnosticReportKind = "full" // A report indicating that the last // returned report is still accurate. DocumentDiagnosticReportKindUnchanged DocumentDiagnosticReportKind = "unchanged" ) // Predefined error codes. type ErrorCode int32 const ( ErrorCodeParseError ErrorCode = -32700 ErrorCodeInvalidRequest ErrorCode = -32600 ErrorCodeMethodNotFound ErrorCode = -32601 ErrorCodeInvalidParams ErrorCode = -32602 ErrorCodeInternalError ErrorCode = -32603 // Error code indicating that a server received a notification or // request before the server has received the `initialize` request. ErrorCodeServerNotInitialized ErrorCode = -32002 ErrorCodeUnknownErrorCode ErrorCode = -32001 // A request failed but it was syntactically correct, e.g the // method name was known and the parameters were valid. The error // message should contain human readable information about why // the request failed. // // Since: 3.17.0 ErrorCodeRequestFailed ErrorCode = -32803 // The server cancelled the request. This error code should // only be used for requests that explicitly support being // server cancellable. // // Since: 3.17.0 ErrorCodeServerCancelled ErrorCode = -32802 // The server detected that the content of a document got // modified outside normal conditions. A server should // NOT send this error code if it detects a content change // in it unprocessed messages. The result even computed // on an older state might still be useful for the client. // // If a client decides that a result is not of any use anymore // the client should cancel the request. ErrorCodeContentModified ErrorCode = -32801 // The client has canceled a request and a server has detected // the cancel. ErrorCodeRequestCancelled ErrorCode = -32800 ) const _ErrorCode_name = "RequestFailedServerCancelledContentModifiedRequestCancelledParseErrorInternalErrorInvalidParamsMethodNotFoundInvalidRequestServerNotInitializedUnknownErrorCode" var ( _ErrorCode_index_0 = [...]uint16{0, 13, 28, 43, 59} _ErrorCode_index_1 = [...]uint16{0, 10} _ErrorCode_index_2 = [...]uint16{0, 13, 26, 40, 54} _ErrorCode_index_3 = [...]uint16{0, 20, 36} ) func (e ErrorCode) String() string { switch { case -32803 <= e && e <= -32800: i := int(e) - -32803 return _ErrorCode_name[0+_ErrorCode_index_0[i] : 0+_ErrorCode_index_0[i+1]] case e == -32700: return _ErrorCode_name[59:69] case -32603 <= e && e <= -32600: i := int(e) - -32603 return _ErrorCode_name[69+_ErrorCode_index_2[i] : 69+_ErrorCode_index_2[i+1]] case -32002 <= e && e <= -32001: i := int(e) - -32002 return _ErrorCode_name[123+_ErrorCode_index_3[i] : 123+_ErrorCode_index_3[i+1]] default: return fmt.Sprintf("ErrorCode(%d)", e) } } func (e ErrorCode) Error() string { return e.String() } // A set of predefined range kinds. type FoldingRangeKind string const ( // Folding range for a comment FoldingRangeKindComment FoldingRangeKind = "comment" // Folding range for an import or include FoldingRangeKindImports FoldingRangeKind = "imports" // Folding range for a region (e.g. `#region`) FoldingRangeKindRegion FoldingRangeKind = "region" ) // A symbol kind. type SymbolKind uint32 const ( SymbolKindFile SymbolKind = 1 SymbolKindModule SymbolKind = 2 SymbolKindNamespace SymbolKind = 3 SymbolKindPackage SymbolKind = 4 SymbolKindClass SymbolKind = 5 SymbolKindMethod SymbolKind = 6 SymbolKindProperty SymbolKind = 7 SymbolKindField SymbolKind = 8 SymbolKindConstructor SymbolKind = 9 SymbolKindEnum SymbolKind = 10 SymbolKindInterface SymbolKind = 11 SymbolKindFunction SymbolKind = 12 SymbolKindVariable SymbolKind = 13 SymbolKindConstant SymbolKind = 14 SymbolKindString SymbolKind = 15 SymbolKindNumber SymbolKind = 16 SymbolKindBoolean SymbolKind = 17 SymbolKindArray SymbolKind = 18 SymbolKindObject SymbolKind = 19 SymbolKindKey SymbolKind = 20 SymbolKindNull SymbolKind = 21 SymbolKindEnumMember SymbolKind = 22 SymbolKindStruct SymbolKind = 23 SymbolKindEvent SymbolKind = 24 SymbolKindOperator SymbolKind = 25 SymbolKindTypeParameter SymbolKind = 26 ) const _SymbolKind_name = "FileModuleNamespacePackageClassMethodPropertyFieldConstructorEnumInterfaceFunctionVariableConstantStringNumberBooleanArrayObjectKeyNullEnumMemberStructEventOperatorTypeParameter" var _SymbolKind_index = [...]uint16{0, 4, 10, 19, 26, 31, 37, 45, 50, 61, 65, 74, 82, 90, 98, 104, 110, 117, 122, 128, 131, 135, 145, 151, 156, 164, 177} func (e SymbolKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_SymbolKind_index)-1 { return fmt.Sprintf("SymbolKind(%d)", e) } return _SymbolKind_name[_SymbolKind_index[i]:_SymbolKind_index[i+1]] } // Symbol tags are extra annotations that tweak the rendering of a symbol. // // Since: 3.16 type SymbolTag uint32 const ( // Render a symbol as obsolete, usually using a strike-out. SymbolTagDeprecated SymbolTag = 1 ) const _SymbolTag_name = "Deprecated" var _SymbolTag_index = [...]uint16{0, 10} func (e SymbolTag) String() string { i := int(e) - 1 if i < 0 || i >= len(_SymbolTag_index)-1 { return fmt.Sprintf("SymbolTag(%d)", e) } return _SymbolTag_name[_SymbolTag_index[i]:_SymbolTag_index[i+1]] } // Moniker uniqueness level to define scope of the moniker. // // Since: 3.16.0 type UniquenessLevel string const ( // The moniker is only unique inside a document UniquenessLevelDocument UniquenessLevel = "document" // The moniker is unique inside a project for which a dump got created UniquenessLevelProject UniquenessLevel = "project" // The moniker is unique inside the group to which a project belongs UniquenessLevelGroup UniquenessLevel = "group" // The moniker is unique inside the moniker scheme. UniquenessLevelScheme UniquenessLevel = "scheme" // The moniker is globally unique UniquenessLevelGlobal UniquenessLevel = "global" ) // The moniker kind. // // Since: 3.16.0 type MonikerKind string const ( // The moniker represent a symbol that is imported into a project MonikerKindImport MonikerKind = "import" // The moniker represents a symbol that is exported from a project MonikerKindExport MonikerKind = "export" // The moniker represents a symbol that is local to a project (e.g. a local // variable of a function, a class not visible outside the project, ...) MonikerKindLocal MonikerKind = "local" ) // Inlay hint kinds. // // Since: 3.17.0 type InlayHintKind uint32 const ( // An inlay hint that for a type annotation. InlayHintKindType InlayHintKind = 1 // An inlay hint that is for a parameter. InlayHintKindParameter InlayHintKind = 2 ) const _InlayHintKind_name = "TypeParameter" var _InlayHintKind_index = [...]uint16{0, 4, 13} func (e InlayHintKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_InlayHintKind_index)-1 { return fmt.Sprintf("InlayHintKind(%d)", e) } return _InlayHintKind_name[_InlayHintKind_index[i]:_InlayHintKind_index[i+1]] } // The message type type MessageType uint32 const ( // An error message. MessageTypeError MessageType = 1 // A warning message. MessageTypeWarning MessageType = 2 // An information message. MessageTypeInfo MessageType = 3 // A log message. MessageTypeLog MessageType = 4 // A debug message. // // Since: 3.18.0 MessageTypeDebug MessageType = 5 ) const _MessageType_name = "ErrorWarningInfoLogDebug" var _MessageType_index = [...]uint16{0, 5, 12, 16, 19, 24} func (e MessageType) String() string { i := int(e) - 1 if i < 0 || i >= len(_MessageType_index)-1 { return fmt.Sprintf("MessageType(%d)", e) } return _MessageType_name[_MessageType_index[i]:_MessageType_index[i+1]] } // Defines how the host (editor) should sync // document changes to the language server. type TextDocumentSyncKind uint32 const ( // Documents should not be synced at all. TextDocumentSyncKindNone TextDocumentSyncKind = 0 // Documents are synced by always sending the full content // of the document. TextDocumentSyncKindFull TextDocumentSyncKind = 1 // Documents are synced by sending the full content on open. // After that only incremental updates to the document are // send. TextDocumentSyncKindIncremental TextDocumentSyncKind = 2 ) const _TextDocumentSyncKind_name = "NoneFullIncremental" var _TextDocumentSyncKind_index = [...]uint16{0, 4, 8, 19} func (e TextDocumentSyncKind) String() string { i := int(e) - 0 if i < 0 || i >= len(_TextDocumentSyncKind_index)-1 { return fmt.Sprintf("TextDocumentSyncKind(%d)", e) } return _TextDocumentSyncKind_name[_TextDocumentSyncKind_index[i]:_TextDocumentSyncKind_index[i+1]] } // Represents reasons why a text document is saved. type TextDocumentSaveReason uint32 const ( // Manually triggered, e.g. by the user pressing save, by starting debugging, // or by an API call. TextDocumentSaveReasonManual TextDocumentSaveReason = 1 // Automatic after a delay. TextDocumentSaveReasonAfterDelay TextDocumentSaveReason = 2 // When the editor lost focus. TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3 ) const _TextDocumentSaveReason_name = "ManualAfterDelayFocusOut" var _TextDocumentSaveReason_index = [...]uint16{0, 6, 16, 24} func (e TextDocumentSaveReason) String() string { i := int(e) - 1 if i < 0 || i >= len(_TextDocumentSaveReason_index)-1 { return fmt.Sprintf("TextDocumentSaveReason(%d)", e) } return _TextDocumentSaveReason_name[_TextDocumentSaveReason_index[i]:_TextDocumentSaveReason_index[i+1]] } // The kind of a completion entry. type CompletionItemKind uint32 const ( CompletionItemKindText CompletionItemKind = 1 CompletionItemKindMethod CompletionItemKind = 2 CompletionItemKindFunction CompletionItemKind = 3 CompletionItemKindConstructor CompletionItemKind = 4 CompletionItemKindField CompletionItemKind = 5 CompletionItemKindVariable CompletionItemKind = 6 CompletionItemKindClass CompletionItemKind = 7 CompletionItemKindInterface CompletionItemKind = 8 CompletionItemKindModule CompletionItemKind = 9 CompletionItemKindProperty CompletionItemKind = 10 CompletionItemKindUnit CompletionItemKind = 11 CompletionItemKindValue CompletionItemKind = 12 CompletionItemKindEnum CompletionItemKind = 13 CompletionItemKindKeyword CompletionItemKind = 14 CompletionItemKindSnippet CompletionItemKind = 15 CompletionItemKindColor CompletionItemKind = 16 CompletionItemKindFile CompletionItemKind = 17 CompletionItemKindReference CompletionItemKind = 18 CompletionItemKindFolder CompletionItemKind = 19 CompletionItemKindEnumMember CompletionItemKind = 20 CompletionItemKindConstant CompletionItemKind = 21 CompletionItemKindStruct CompletionItemKind = 22 CompletionItemKindEvent CompletionItemKind = 23 CompletionItemKindOperator CompletionItemKind = 24 CompletionItemKindTypeParameter CompletionItemKind = 25 ) const _CompletionItemKind_name = "TextMethodFunctionConstructorFieldVariableClassInterfaceModulePropertyUnitValueEnumKeywordSnippetColorFileReferenceFolderEnumMemberConstantStructEventOperatorTypeParameter" var _CompletionItemKind_index = [...]uint16{0, 4, 10, 18, 29, 34, 42, 47, 56, 62, 70, 74, 79, 83, 90, 97, 102, 106, 115, 121, 131, 139, 145, 150, 158, 171} func (e CompletionItemKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_CompletionItemKind_index)-1 { return fmt.Sprintf("CompletionItemKind(%d)", e) } return _CompletionItemKind_name[_CompletionItemKind_index[i]:_CompletionItemKind_index[i+1]] } // Completion item tags are extra annotations that tweak the rendering of a completion // item. // // Since: 3.15.0 type CompletionItemTag uint32 const ( // Render a completion as obsolete, usually using a strike-out. CompletionItemTagDeprecated CompletionItemTag = 1 ) const _CompletionItemTag_name = "Deprecated" var _CompletionItemTag_index = [...]uint16{0, 10} func (e CompletionItemTag) String() string { i := int(e) - 1 if i < 0 || i >= len(_CompletionItemTag_index)-1 { return fmt.Sprintf("CompletionItemTag(%d)", e) } return _CompletionItemTag_name[_CompletionItemTag_index[i]:_CompletionItemTag_index[i+1]] } // Defines whether the insert text in a completion item should be interpreted as // plain text or a snippet. type InsertTextFormat uint32 const ( // The primary text to be inserted is treated as a plain string. InsertTextFormatPlainText InsertTextFormat = 1 // The primary text to be inserted is treated as a snippet. // // A snippet can define tab stops and placeholders with `$1`, `$2` // and `${3:foo}`. `$0` defines the final tab stop, it defaults to // the end of the snippet. Placeholders with equal identifiers are linked, // that is typing in one will update others too. // // See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax InsertTextFormatSnippet InsertTextFormat = 2 ) const _InsertTextFormat_name = "PlainTextSnippet" var _InsertTextFormat_index = [...]uint16{0, 9, 16} func (e InsertTextFormat) String() string { i := int(e) - 1 if i < 0 || i >= len(_InsertTextFormat_index)-1 { return fmt.Sprintf("InsertTextFormat(%d)", e) } return _InsertTextFormat_name[_InsertTextFormat_index[i]:_InsertTextFormat_index[i+1]] } // How whitespace and indentation is handled during completion // item insertion. // // Since: 3.16.0 type InsertTextMode uint32 const ( // The insertion or replace strings is taken as it is. If the // value is multi line the lines below the cursor will be // inserted using the indentation defined in the string value. // The client will not apply any kind of adjustments to the // string. InsertTextModeAsIs InsertTextMode = 1 // The editor adjusts leading whitespace of new lines so that // they match the indentation up to the cursor of the line for // which the item is accepted. // // Consider a line like this: <2tabs><3tabs>foo. Accepting a // multi line completion item is indented using 2 tabs and all // following lines inserted will be indented using 2 tabs as well. InsertTextModeAdjustIndentation InsertTextMode = 2 ) const _InsertTextMode_name = "asIsadjustIndentation" var _InsertTextMode_index = [...]uint16{0, 4, 21} func (e InsertTextMode) String() string { i := int(e) - 1 if i < 0 || i >= len(_InsertTextMode_index)-1 { return fmt.Sprintf("InsertTextMode(%d)", e) } return _InsertTextMode_name[_InsertTextMode_index[i]:_InsertTextMode_index[i+1]] } // A document highlight kind. type DocumentHighlightKind uint32 const ( // A textual occurrence. DocumentHighlightKindText DocumentHighlightKind = 1 // Read-access of a symbol, like reading a variable. DocumentHighlightKindRead DocumentHighlightKind = 2 // Write-access of a symbol, like writing to a variable. DocumentHighlightKindWrite DocumentHighlightKind = 3 ) const _DocumentHighlightKind_name = "TextReadWrite" var _DocumentHighlightKind_index = [...]uint16{0, 4, 8, 13} func (e DocumentHighlightKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_DocumentHighlightKind_index)-1 { return fmt.Sprintf("DocumentHighlightKind(%d)", e) } return _DocumentHighlightKind_name[_DocumentHighlightKind_index[i]:_DocumentHighlightKind_index[i+1]] } // A set of predefined code action kinds type CodeActionKind string const ( // Empty kind. CodeActionKindEmpty CodeActionKind = "" // Base kind for quickfix actions: 'quickfix' CodeActionKindQuickFix CodeActionKind = "quickfix" // Base kind for refactoring actions: 'refactor' CodeActionKindRefactor CodeActionKind = "refactor" // Base kind for refactoring extraction actions: 'refactor.extract' // // Example extract actions: // // - Extract method // - Extract function // - Extract variable // - Extract interface from class // - ... CodeActionKindRefactorExtract CodeActionKind = "refactor.extract" // Base kind for refactoring inline actions: 'refactor.inline' // // Example inline actions: // // - Inline function // - Inline variable // - Inline constant // - ... CodeActionKindRefactorInline CodeActionKind = "refactor.inline" // Base kind for refactoring move actions: `refactor.move` // // Example move actions: // // - Move a function to a new file // - Move a property between classes // - Move method to base class // - ... // // Since: 3.18.0 CodeActionKindRefactorMove CodeActionKind = "refactor.move" // Base kind for refactoring rewrite actions: 'refactor.rewrite' // // Example rewrite actions: // // - Convert JavaScript function to class // - Add or remove parameter // - Encapsulate field // - Make method static // - Move method to base class // - ... CodeActionKindRefactorRewrite CodeActionKind = "refactor.rewrite" // Base kind for source actions: `source` // // Source code actions apply to the entire file. CodeActionKindSource CodeActionKind = "source" // Base kind for an organize imports source action: `source.organizeImports` CodeActionKindSourceOrganizeImports CodeActionKind = "source.organizeImports" // Base kind for auto-fix source actions: `source.fixAll`. // // Fix all actions automatically fix errors that have a clear fix that do not require user input. // They should not suppress errors or perform unsafe fixes such as generating new types or classes. // // Since: 3.15.0 CodeActionKindSourceFixAll CodeActionKind = "source.fixAll" ) // Code action tags are extra annotations that tweak the behavior of a code action. // // Since: 3.18.0 - proposed type CodeActionTag uint32 const ( // Marks the code action as LLM-generated. CodeActionTagLLMGenerated CodeActionTag = 1 ) const _CodeActionTag_name = "LLMGenerated" var _CodeActionTag_index = [...]uint16{0, 12} func (e CodeActionTag) String() string { i := int(e) - 1 if i < 0 || i >= len(_CodeActionTag_index)-1 { return fmt.Sprintf("CodeActionTag(%d)", e) } return _CodeActionTag_name[_CodeActionTag_index[i]:_CodeActionTag_index[i+1]] } type TraceValue string const ( // Turn tracing off. TraceValueOff TraceValue = "off" // Trace messages only. TraceValueMessages TraceValue = "messages" // Verbose message tracing. TraceValueVerbose TraceValue = "verbose" ) // Describes the content type that a client supports in various // result literals like `Hover`, `ParameterInfo` or `CompletionItem`. // // Please note that `MarkupKinds` must not start with a `$`. This kinds // are reserved for internal usage. type MarkupKind string const ( // Plain text is supported as a content format MarkupKindPlainText MarkupKind = "plaintext" // Markdown is supported as a content format MarkupKindMarkdown MarkupKind = "markdown" ) // Predefined Language kinds // // Since: 3.18.0 type LanguageKind string const ( LanguageKindABAP LanguageKind = "abap" LanguageKindWindowsBat LanguageKind = "bat" LanguageKindBibTeX LanguageKind = "bibtex" LanguageKindClojure LanguageKind = "clojure" LanguageKindCoffeescript LanguageKind = "coffeescript" LanguageKindC LanguageKind = "c" LanguageKindCPP LanguageKind = "cpp" LanguageKindCSharp LanguageKind = "csharp" LanguageKindCSS LanguageKind = "css" // Since: 3.18.0 LanguageKindD LanguageKind = "d" // Since: 3.18.0 LanguageKindDelphi LanguageKind = "pascal" LanguageKindDiff LanguageKind = "diff" LanguageKindDart LanguageKind = "dart" LanguageKindDockerfile LanguageKind = "dockerfile" LanguageKindElixir LanguageKind = "elixir" LanguageKindErlang LanguageKind = "erlang" LanguageKindFSharp LanguageKind = "fsharp" LanguageKindGitCommit LanguageKind = "git-commit" LanguageKindGitRebase LanguageKind = "git-rebase" LanguageKindGo LanguageKind = "go" LanguageKindGroovy LanguageKind = "groovy" LanguageKindHandlebars LanguageKind = "handlebars" LanguageKindHaskell LanguageKind = "haskell" LanguageKindHTML LanguageKind = "html" LanguageKindIni LanguageKind = "ini" LanguageKindJava LanguageKind = "java" LanguageKindJavaScript LanguageKind = "javascript" LanguageKindJavaScriptReact LanguageKind = "javascriptreact" LanguageKindJSON LanguageKind = "json" LanguageKindLaTeX LanguageKind = "latex" LanguageKindLess LanguageKind = "less" LanguageKindLua LanguageKind = "lua" LanguageKindMakefile LanguageKind = "makefile" LanguageKindMarkdown LanguageKind = "markdown" LanguageKindObjectiveC LanguageKind = "objective-c" LanguageKindObjectiveCPP LanguageKind = "objective-cpp" // Since: 3.18.0 LanguageKindPascal LanguageKind = "pascal" LanguageKindPerl LanguageKind = "perl" LanguageKindPerl6 LanguageKind = "perl6" LanguageKindPHP LanguageKind = "php" LanguageKindPlaintext LanguageKind = "plaintext" LanguageKindPowershell LanguageKind = "powershell" LanguageKindPug LanguageKind = "jade" LanguageKindPython LanguageKind = "python" LanguageKindR LanguageKind = "r" LanguageKindRazor LanguageKind = "razor" LanguageKindRuby LanguageKind = "ruby" LanguageKindRust LanguageKind = "rust" LanguageKindSCSS LanguageKind = "scss" LanguageKindSASS LanguageKind = "sass" LanguageKindScala LanguageKind = "scala" LanguageKindShaderLab LanguageKind = "shaderlab" LanguageKindShellScript LanguageKind = "shellscript" LanguageKindSQL LanguageKind = "sql" LanguageKindSwift LanguageKind = "swift" LanguageKindTypeScript LanguageKind = "typescript" LanguageKindTypeScriptReact LanguageKind = "typescriptreact" LanguageKindTeX LanguageKind = "tex" LanguageKindVisualBasic LanguageKind = "vb" LanguageKindXML LanguageKind = "xml" LanguageKindXSL LanguageKind = "xsl" LanguageKindYAML LanguageKind = "yaml" ) // Describes how an provider was triggered. // // Since: 3.18.0 type InlineCompletionTriggerKind uint32 const ( // Completion was triggered explicitly by a user gesture. InlineCompletionTriggerKindInvoked InlineCompletionTriggerKind = 1 // Completion was triggered automatically while editing. InlineCompletionTriggerKindAutomatic InlineCompletionTriggerKind = 2 ) const _InlineCompletionTriggerKind_name = "InvokedAutomatic" var _InlineCompletionTriggerKind_index = [...]uint16{0, 7, 16} func (e InlineCompletionTriggerKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_InlineCompletionTriggerKind_index)-1 { return fmt.Sprintf("InlineCompletionTriggerKind(%d)", e) } return _InlineCompletionTriggerKind_name[_InlineCompletionTriggerKind_index[i]:_InlineCompletionTriggerKind_index[i+1]] } // A set of predefined position encoding kinds. // // Since: 3.17.0 type PositionEncodingKind string const ( // Character offsets count UTF-8 code units (e.g. bytes). PositionEncodingKindUTF8 PositionEncodingKind = "utf-8" // Character offsets count UTF-16 code units. // // This is the default and must always be supported // by servers PositionEncodingKindUTF16 PositionEncodingKind = "utf-16" // Character offsets count UTF-32 code units. // // Implementation note: these are the same as Unicode codepoints, // so this `PositionEncodingKind` may also be used for an // encoding-agnostic representation of character offsets. PositionEncodingKindUTF32 PositionEncodingKind = "utf-32" ) // The file event type type FileChangeType uint32 const ( // The file got created. FileChangeTypeCreated FileChangeType = 1 // The file got changed. FileChangeTypeChanged FileChangeType = 2 // The file got deleted. FileChangeTypeDeleted FileChangeType = 3 ) const _FileChangeType_name = "CreatedChangedDeleted" var _FileChangeType_index = [...]uint16{0, 7, 14, 21} func (e FileChangeType) String() string { i := int(e) - 1 if i < 0 || i >= len(_FileChangeType_index)-1 { return fmt.Sprintf("FileChangeType(%d)", e) } return _FileChangeType_name[_FileChangeType_index[i]:_FileChangeType_index[i+1]] } type WatchKind uint32 const ( // Interested in create events. WatchKindCreate WatchKind = 1 // Interested in change events WatchKindChange WatchKind = 2 // Interested in delete events WatchKindDelete WatchKind = 4 ) const _WatchKind_name = "CreateChangeDelete" var _WatchKind_index = [...]uint16{0, 6, 12, 18} func (e WatchKind) String() string { if e == 0 { return "0" } var parts []string if e&1 != 0 { parts = append(parts, _WatchKind_name[_WatchKind_index[0]:_WatchKind_index[1]]) } if e&2 != 0 { parts = append(parts, _WatchKind_name[_WatchKind_index[1]:_WatchKind_index[2]]) } if e&4 != 0 { parts = append(parts, _WatchKind_name[_WatchKind_index[2]:_WatchKind_index[3]]) } if len(parts) == 0 { return fmt.Sprintf("WatchKind(%d)", e) } return strings.Join(parts, "|") } // The diagnostic's severity. type DiagnosticSeverity uint32 const ( // Reports an error. DiagnosticSeverityError DiagnosticSeverity = 1 // Reports a warning. DiagnosticSeverityWarning DiagnosticSeverity = 2 // Reports an information. DiagnosticSeverityInformation DiagnosticSeverity = 3 // Reports a hint. DiagnosticSeverityHint DiagnosticSeverity = 4 ) const _DiagnosticSeverity_name = "ErrorWarningInformationHint" var _DiagnosticSeverity_index = [...]uint16{0, 5, 12, 23, 27} func (e DiagnosticSeverity) String() string { i := int(e) - 1 if i < 0 || i >= len(_DiagnosticSeverity_index)-1 { return fmt.Sprintf("DiagnosticSeverity(%d)", e) } return _DiagnosticSeverity_name[_DiagnosticSeverity_index[i]:_DiagnosticSeverity_index[i+1]] } // The diagnostic tags. // // Since: 3.15.0 type DiagnosticTag uint32 const ( // Unused or unnecessary code. // // Clients are allowed to render diagnostics with this tag faded out instead of having // an error squiggle. DiagnosticTagUnnecessary DiagnosticTag = 1 // Deprecated or obsolete code. // // Clients are allowed to rendered diagnostics with this tag strike through. DiagnosticTagDeprecated DiagnosticTag = 2 ) const _DiagnosticTag_name = "UnnecessaryDeprecated" var _DiagnosticTag_index = [...]uint16{0, 11, 21} func (e DiagnosticTag) String() string { i := int(e) - 1 if i < 0 || i >= len(_DiagnosticTag_index)-1 { return fmt.Sprintf("DiagnosticTag(%d)", e) } return _DiagnosticTag_name[_DiagnosticTag_index[i]:_DiagnosticTag_index[i+1]] } // How a completion was triggered type CompletionTriggerKind uint32 const ( // Completion was triggered by typing an identifier (24x7 code // complete), manual invocation (e.g Ctrl+Space) or via API. CompletionTriggerKindInvoked CompletionTriggerKind = 1 // Completion was triggered by a trigger character specified by // the `triggerCharacters` properties of the `CompletionRegistrationOptions`. CompletionTriggerKindTriggerCharacter CompletionTriggerKind = 2 // Completion was re-triggered as current completion list is incomplete CompletionTriggerKindTriggerForIncompleteCompletions CompletionTriggerKind = 3 ) const _CompletionTriggerKind_name = "InvokedTriggerCharacterTriggerForIncompleteCompletions" var _CompletionTriggerKind_index = [...]uint16{0, 7, 23, 54} func (e CompletionTriggerKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_CompletionTriggerKind_index)-1 { return fmt.Sprintf("CompletionTriggerKind(%d)", e) } return _CompletionTriggerKind_name[_CompletionTriggerKind_index[i]:_CompletionTriggerKind_index[i+1]] } // Defines how values from a set of defaults and an individual item will be // merged. // // Since: 3.18.0 type ApplyKind uint32 const ( // The value from the individual item (if provided and not `null`) will be // used instead of the default. ApplyKindReplace ApplyKind = 1 // The value from the item will be merged with the default. // // The specific rules for mergeing values are defined against each field // that supports merging. ApplyKindMerge ApplyKind = 2 ) const _ApplyKind_name = "ReplaceMerge" var _ApplyKind_index = [...]uint16{0, 7, 12} func (e ApplyKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_ApplyKind_index)-1 { return fmt.Sprintf("ApplyKind(%d)", e) } return _ApplyKind_name[_ApplyKind_index[i]:_ApplyKind_index[i+1]] } // How a signature help was triggered. // // Since: 3.15.0 type SignatureHelpTriggerKind uint32 const ( // Signature help was invoked manually by the user or by a command. SignatureHelpTriggerKindInvoked SignatureHelpTriggerKind = 1 // Signature help was triggered by a trigger character. SignatureHelpTriggerKindTriggerCharacter SignatureHelpTriggerKind = 2 // Signature help was triggered by the cursor moving or by the document content changing. SignatureHelpTriggerKindContentChange SignatureHelpTriggerKind = 3 ) const _SignatureHelpTriggerKind_name = "InvokedTriggerCharacterContentChange" var _SignatureHelpTriggerKind_index = [...]uint16{0, 7, 23, 36} func (e SignatureHelpTriggerKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_SignatureHelpTriggerKind_index)-1 { return fmt.Sprintf("SignatureHelpTriggerKind(%d)", e) } return _SignatureHelpTriggerKind_name[_SignatureHelpTriggerKind_index[i]:_SignatureHelpTriggerKind_index[i+1]] } // The reason why code actions were requested. // // Since: 3.17.0 type CodeActionTriggerKind uint32 const ( // Code actions were explicitly requested by the user or by an extension. CodeActionTriggerKindInvoked CodeActionTriggerKind = 1 // Code actions were requested automatically. // // This typically happens when current selection in a file changes, but can // also be triggered when file content changes. CodeActionTriggerKindAutomatic CodeActionTriggerKind = 2 ) const _CodeActionTriggerKind_name = "InvokedAutomatic" var _CodeActionTriggerKind_index = [...]uint16{0, 7, 16} func (e CodeActionTriggerKind) String() string { i := int(e) - 1 if i < 0 || i >= len(_CodeActionTriggerKind_index)-1 { return fmt.Sprintf("CodeActionTriggerKind(%d)", e) } return _CodeActionTriggerKind_name[_CodeActionTriggerKind_index[i]:_CodeActionTriggerKind_index[i+1]] } // A pattern kind describing if a glob pattern matches a file a folder or // both. // // Since: 3.16.0 type FileOperationPatternKind string const ( // The pattern matches a file only. FileOperationPatternKindFile FileOperationPatternKind = "file" // The pattern matches a folder only. FileOperationPatternKindFolder FileOperationPatternKind = "folder" ) type ResourceOperationKind string const ( // Supports creating new files and folders. ResourceOperationKindCreate ResourceOperationKind = "create" // Supports renaming existing files and folders. ResourceOperationKindRename ResourceOperationKind = "rename" // Supports deleting existing files and folders. ResourceOperationKindDelete ResourceOperationKind = "delete" ) type FailureHandlingKind string const ( // Applying the workspace change is simply aborted if one of the changes provided // fails. All operations executed before the failing operation stay executed. FailureHandlingKindAbort FailureHandlingKind = "abort" // All operations are executed transactional. That means they either all // succeed or no changes at all are applied to the workspace. FailureHandlingKindTransactional FailureHandlingKind = "transactional" // If the workspace edit contains only textual file changes they are executed transactional. // If resource changes (create, rename or delete file) are part of the change the failure // handling strategy is abort. FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional" // The client tries to undo the operations already executed. But there is no // guarantee that this is succeeding. FailureHandlingKindUndo FailureHandlingKind = "undo" ) type PrepareSupportDefaultBehavior uint32 const ( // The client's default behavior is to select the identifier // according the to language's syntax rule. PrepareSupportDefaultBehaviorIdentifier PrepareSupportDefaultBehavior = 1 ) const _PrepareSupportDefaultBehavior_name = "Identifier" var _PrepareSupportDefaultBehavior_index = [...]uint16{0, 10} func (e PrepareSupportDefaultBehavior) String() string { i := int(e) - 1 if i < 0 || i >= len(_PrepareSupportDefaultBehavior_index)-1 { return fmt.Sprintf("PrepareSupportDefaultBehavior(%d)", e) } return _PrepareSupportDefaultBehavior_name[_PrepareSupportDefaultBehavior_index[i]:_PrepareSupportDefaultBehavior_index[i+1]] } type TokenFormat string const ( TokenFormatRelative TokenFormat = "relative" ) // Log verbosity level, mirroring the VS Code LogLevel enum values. type LogVerbosity int32 const ( // All logging disabled. LogVerbosityOff LogVerbosity = 0 // Most verbose; includes LSP request/response traces. LogVerbosityTrace LogVerbosity = 1 // Verbose server logs. LogVerbosityDebug LogVerbosity = 2 // Normal server logs. LogVerbosityInfo LogVerbosity = 3 // Warnings only. LogVerbosityWarning LogVerbosity = 4 // Errors only. LogVerbosityError LogVerbosity = 5 ) const _LogVerbosity_name = "OffTraceDebugInfoWarningError" var _LogVerbosity_index = [...]uint16{0, 3, 8, 13, 17, 24, 29} func (e LogVerbosity) String() string { i := int(e) - 0 if i < 0 || i >= len(_LogVerbosity_index)-1 { return fmt.Sprintf("LogVerbosity(%d)", e) } return _LogVerbosity_name[_LogVerbosity_index[i]:_LogVerbosity_index[i+1]] } type VSReferenceKind int32 const ( VSReferenceKindInactive VSReferenceKind = 0 VSReferenceKindComment VSReferenceKind = 1 VSReferenceKindString VSReferenceKind = 2 VSReferenceKindRead VSReferenceKind = 3 VSReferenceKindWrite VSReferenceKind = 4 VSReferenceKindReference VSReferenceKind = 5 VSReferenceKindName VSReferenceKind = 6 VSReferenceKindQualified VSReferenceKind = 7 VSReferenceKindTypeArgument VSReferenceKind = 8 VSReferenceKindTypeConstraint VSReferenceKind = 9 VSReferenceKindBaseType VSReferenceKind = 10 VSReferenceKindConstructor VSReferenceKind = 11 VSReferenceKindDestructor VSReferenceKind = 12 VSReferenceKindImport VSReferenceKind = 13 VSReferenceKindDeclaration VSReferenceKind = 14 VSReferenceKindAddressOf VSReferenceKind = 15 VSReferenceKindNotReference VSReferenceKind = 16 VSReferenceKindUnknown VSReferenceKind = 17 ) const _VSReferenceKind_name = "InactiveCommentStringReadWriteReferenceNameQualifiedTypeArgumentTypeConstraintBaseTypeConstructorDestructorImportDeclarationAddressOfNotReferenceUnknown" var _VSReferenceKind_index = [...]uint16{0, 8, 15, 21, 25, 30, 39, 43, 52, 64, 78, 86, 97, 107, 113, 124, 133, 145, 152} func (e VSReferenceKind) String() string { i := int(e) - 0 if i < 0 || i >= len(_VSReferenceKind_index)-1 { return fmt.Sprintf("VSReferenceKind(%d)", e) } return _VSReferenceKind_name[_VSReferenceKind_index[i]:_VSReferenceKind_index[i+1]] } type CodeLensKind string const ( CodeLensKindReferences CodeLensKind = "references" CodeLensKindImplementations CodeLensKind = "implementations" ) type AutoImportFixKind int32 const ( // Augment an existing namespace import. AutoImportFixKindUseNamespace AutoImportFixKind = 0 // Add a JSDoc-only type import. AutoImportFixKindJsdocTypeImport AutoImportFixKind = 1 // Insert into an existing import declaration. AutoImportFixKindAddToExisting AutoImportFixKind = 2 // Create a fresh import statement. AutoImportFixKindAddNew AutoImportFixKind = 3 // Promote a type-only import when necessary. AutoImportFixKindPromoteTypeOnly AutoImportFixKind = 4 ) const _AutoImportFixKind_name = "UseNamespaceJsdocTypeImportAddToExistingAddNewPromoteTypeOnly" var _AutoImportFixKind_index = [...]uint16{0, 12, 27, 40, 46, 61} func (e AutoImportFixKind) String() string { i := int(e) - 0 if i < 0 || i >= len(_AutoImportFixKind_index)-1 { return fmt.Sprintf("AutoImportFixKind(%d)", e) } return _AutoImportFixKind_name[_AutoImportFixKind_index[i]:_AutoImportFixKind_index[i+1]] } type ImportKind int32 const ( // Adds a named import. ImportKindNamed ImportKind = 0 // Adds a default import. ImportKindDefault ImportKind = 1 // Adds a namespace import. ImportKindNamespace ImportKind = 2 // Adds a CommonJS import assignment. ImportKindCommonJS ImportKind = 3 ) const _ImportKind_name = "NamedDefaultNamespaceCommonJS" var _ImportKind_index = [...]uint16{0, 5, 12, 21, 29} func (e ImportKind) String() string { i := int(e) - 0 if i < 0 || i >= len(_ImportKind_index)-1 { return fmt.Sprintf("ImportKind(%d)", e) } return _ImportKind_name[_ImportKind_index[i]:_ImportKind_index[i+1]] } type AddAsTypeOnly int32 const ( // Import may be marked type-only if needed. AddAsTypeOnlyAllowed AddAsTypeOnly = 1 // Import must be marked type-only. AddAsTypeOnlyRequired AddAsTypeOnly = 2 // Import cannot be marked type-only. AddAsTypeOnlyNotAllowed AddAsTypeOnly = 4 ) const _AddAsTypeOnly_name = "AllowedRequiredNotAllowed" var ( _AddAsTypeOnly_index_0 = [...]uint16{0, 7, 15} _AddAsTypeOnly_index_1 = [...]uint16{0, 10} ) func (e AddAsTypeOnly) String() string { switch { case 1 <= e && e <= 2: i := int(e) - 1 return _AddAsTypeOnly_name[0+_AddAsTypeOnly_index_0[i] : 0+_AddAsTypeOnly_index_0[i+1]] case e == 4: return _AddAsTypeOnly_name[15:25] default: return fmt.Sprintf("AddAsTypeOnly(%d)", e) } } // Roslyn classification type names used by VS for syntax coloring in tooltips and other UI elements. type ClassificationTypeName string const ( // Language keyword (e.g., function, const, class). ClassificationTypeNameKeyword ClassificationTypeName = "keyword" // Punctuation characters (e.g., parentheses, commas, semicolons). ClassificationTypeNamePunctuation ClassificationTypeName = "punctuation" // Operators (e.g., =, +, ?). ClassificationTypeNameOperator ClassificationTypeName = "operator" // Whitespace including spaces and line breaks. ClassificationTypeNameWhiteSpace ClassificationTypeName = "whitespace" // Plain text with no special classification. ClassificationTypeNameText ClassificationTypeName = "text" // String and literal values. ClassificationTypeNameString ClassificationTypeName = "string" // Numeric literal values. ClassificationTypeNameNumber ClassificationTypeName = "number" // Comment text. ClassificationTypeNameComment ClassificationTypeName = "comment" // Class names. ClassificationTypeNameClassName ClassificationTypeName = "class name" // Interface names. ClassificationTypeNameInterfaceName ClassificationTypeName = "interface name" // Enum names. ClassificationTypeNameEnumName ClassificationTypeName = "enum name" // Module/namespace names. ClassificationTypeNameModuleName ClassificationTypeName = "module name" // Method and function names. ClassificationTypeNameMethodName ClassificationTypeName = "method name" // Parameter names. ClassificationTypeNameParameterName ClassificationTypeName = "parameter name" // Property and accessor names. ClassificationTypeNamePropertyName ClassificationTypeName = "property name" // Field names (e.g., enum members). ClassificationTypeNameFieldName ClassificationTypeName = "field name" // Local variable names. ClassificationTypeNameLocalName ClassificationTypeName = "local name" // Type parameter names. ClassificationTypeNameTypeParameterName ClassificationTypeName = "type parameter name" // General identifiers (e.g., type aliases, imports). ClassificationTypeNameIdentifier ClassificationTypeName = "identifier" ) // Methods const ( // A request to resolve the implementation locations of a symbol at a given text // document position. The request's parameter is of type TextDocumentPositionParams // the response is of type Definition or a Thenable that resolves to such. MethodTextDocumentImplementation Method = "textDocument/implementation" // A request to resolve the type definition locations of a symbol at a given text // document position. The request's parameter is of type TextDocumentPositionParams // the response is of type Definition or a Thenable that resolves to such. MethodTextDocumentTypeDefinition Method = "textDocument/typeDefinition" // The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders. MethodWorkspaceWorkspaceFolders Method = "workspace/workspaceFolders" // The 'workspace/configuration' request is sent from the server to the client to fetch a certain // configuration setting. // // This pull model replaces the old push model were the client signaled configuration change via an // event. If the server still needs to react to configuration changes (since the server caches the // result of `workspace/configuration` requests) the server should register for an empty configuration // change event and empty the cache if such an event is received. MethodWorkspaceConfiguration Method = "workspace/configuration" // A request to list all color symbols found in a given text document. The request's // parameter is of type DocumentColorParams the // response is of type ColorInformation[] or a Thenable // that resolves to such. MethodTextDocumentDocumentColor Method = "textDocument/documentColor" // A request to list all presentation for a color. The request's // parameter is of type ColorPresentationParams the // response is of type ColorPresentation[] or a Thenable // that resolves to such. MethodTextDocumentColorPresentation Method = "textDocument/colorPresentation" // A request to provide folding ranges in a document. The request's // parameter is of type FoldingRangeParams, the // response is of type FoldingRangeList or a Thenable // that resolves to such. MethodTextDocumentFoldingRange Method = "textDocument/foldingRange" // A request to refresh the folding ranges in a document. // // Since: 3.18.0 MethodWorkspaceFoldingRangeRefresh Method = "workspace/foldingRange/refresh" // A request to resolve the type definition locations of a symbol at a given text // document position. The request's parameter is of type TextDocumentPositionParams // the response is of type Declaration or a typed array of DeclarationLink // or a Thenable that resolves to such. MethodTextDocumentDeclaration Method = "textDocument/declaration" // A request to provide selection ranges in a document. The request's // parameter is of type SelectionRangeParams, the // response is of type SelectionRange[] or a Thenable // that resolves to such. MethodTextDocumentSelectionRange Method = "textDocument/selectionRange" // The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress // reporting from the server. MethodWindowWorkDoneProgressCreate Method = "window/workDoneProgress/create" // A request to result a `CallHierarchyItem` in a document at a given position. // Can be used as an input to an incoming or outgoing call hierarchy. // // Since: 3.16.0 MethodTextDocumentPrepareCallHierarchy Method = "textDocument/prepareCallHierarchy" // A request to resolve the incoming calls for a given `CallHierarchyItem`. // // Since: 3.16.0 MethodCallHierarchyIncomingCalls Method = "callHierarchy/incomingCalls" // A request to resolve the outgoing calls for a given `CallHierarchyItem`. // // Since: 3.16.0 MethodCallHierarchyOutgoingCalls Method = "callHierarchy/outgoingCalls" // Since: 3.16.0 MethodTextDocumentSemanticTokensFull Method = "textDocument/semanticTokens/full" // Since: 3.16.0 MethodTextDocumentSemanticTokensFullDelta Method = "textDocument/semanticTokens/full/delta" // Since: 3.16.0 MethodTextDocumentSemanticTokensRange Method = "textDocument/semanticTokens/range" // Since: 3.16.0 MethodWorkspaceSemanticTokensRefresh Method = "workspace/semanticTokens/refresh" // A request to show a document. This request might open an // external program depending on the value of the URI to open. // For example a request to open `https://code.visualstudio.com/` // will very likely open the URI in a WEB browser. // // Since: 3.16.0 MethodWindowShowDocument Method = "window/showDocument" // A request to provide ranges that can be edited together. // // Since: 3.16.0 MethodTextDocumentLinkedEditingRange Method = "textDocument/linkedEditingRange" // The will create files request is sent from the client to the server before files are actually // created as long as the creation is triggered from within the client. // // The request can return a `WorkspaceEdit` which will be applied to workspace before the // files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file // to be created. // // Since: 3.16.0 MethodWorkspaceWillCreateFiles Method = "workspace/willCreateFiles" // The will rename files request is sent from the client to the server before files are actually // renamed as long as the rename is triggered from within the client. // // Since: 3.16.0 MethodWorkspaceWillRenameFiles Method = "workspace/willRenameFiles" // The did delete files notification is sent from the client to the server when // files were deleted from within the client. // // Since: 3.16.0 MethodWorkspaceWillDeleteFiles Method = "workspace/willDeleteFiles" // A request to get the moniker of a symbol at a given text document position. // The request parameter is of type TextDocumentPositionParams. // The response is of type Moniker[] or `null`. MethodTextDocumentMoniker Method = "textDocument/moniker" // A request to result a `TypeHierarchyItem` in a document at a given position. // Can be used as an input to a subtypes or supertypes type hierarchy. // // Since: 3.17.0 MethodTextDocumentPrepareTypeHierarchy Method = "textDocument/prepareTypeHierarchy" // A request to resolve the supertypes for a given `TypeHierarchyItem`. // // Since: 3.17.0 MethodTypeHierarchySupertypes Method = "typeHierarchy/supertypes" // A request to resolve the subtypes for a given `TypeHierarchyItem`. // // Since: 3.17.0 MethodTypeHierarchySubtypes Method = "typeHierarchy/subtypes" // A request to provide inline values in a document. The request's parameter is of // type InlineValueParams, the response is of type // InlineValue[] or a Thenable that resolves to such. // // Since: 3.17.0 MethodTextDocumentInlineValue Method = "textDocument/inlineValue" // Since: 3.17.0 MethodWorkspaceInlineValueRefresh Method = "workspace/inlineValue/refresh" // A request to provide inlay hints in a document. The request's parameter is of // type InlayHintsParams, the response is of type // InlayHint[] or a Thenable that resolves to such. // // Since: 3.17.0 MethodTextDocumentInlayHint Method = "textDocument/inlayHint" // A request to resolve additional properties for an inlay hint. // The request's parameter is of type InlayHint, the response is // of type InlayHint or a Thenable that resolves to such. // // Since: 3.17.0 MethodInlayHintResolve Method = "inlayHint/resolve" // Since: 3.17.0 MethodWorkspaceInlayHintRefresh Method = "workspace/inlayHint/refresh" // The document diagnostic request definition. // // Since: 3.17.0 MethodTextDocumentDiagnostic Method = "textDocument/diagnostic" // The workspace diagnostic request definition. // // Since: 3.17.0 MethodWorkspaceDiagnostic Method = "workspace/diagnostic" // The diagnostic refresh request definition. // // Since: 3.17.0 MethodWorkspaceDiagnosticRefresh Method = "workspace/diagnostic/refresh" // A request to provide inline completions in a document. The request's parameter is of // type InlineCompletionParams, the response is of type // InlineCompletion[] or a Thenable that resolves to such. // // Since: 3.18.0 MethodTextDocumentInlineCompletion Method = "textDocument/inlineCompletion" // The `workspace/textDocumentContent` request is sent from the client to the // server to request the content of a text document. // // Since: 3.18.0 MethodWorkspaceTextDocumentContent Method = "workspace/textDocumentContent" // The `workspace/textDocumentContent` request is sent from the server to the client to refresh // the content of a specific text document. // // Since: 3.18.0 MethodWorkspaceTextDocumentContentRefresh Method = "workspace/textDocumentContent/refresh" // The `client/registerCapability` request is sent from the server to the client to register a new capability // handler on the client side. MethodClientRegisterCapability Method = "client/registerCapability" // The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability // handler on the client side. MethodClientUnregisterCapability Method = "client/unregisterCapability" // The initialize request is sent from the client to the server. // It is sent once as the request after starting up the server. // The requests parameter is of type InitializeParams // the response if of type InitializeResult of a Thenable that // resolves to such. MethodInitialize Method = "initialize" // A shutdown request is sent from the client to the server. // It is sent once when the client decides to shutdown the // server. The only notification that is sent after a shutdown request // is the exit event. MethodShutdown Method = "shutdown" // The show message request is sent from the server to the client to show a message // and a set of options actions to the user. MethodWindowShowMessageRequest Method = "window/showMessageRequest" // A document will save request is sent from the client to the server before // the document is actually saved. The request can return an array of TextEdits // which will be applied to the text document before it is saved. Please note that // clients might drop results if computing the text edits took too long or if a // server constantly fails on this request. This is done to keep the save fast and // reliable. MethodTextDocumentWillSaveWaitUntil Method = "textDocument/willSaveWaitUntil" // Request to request completion at a given text document position. The request's // parameter is of type TextDocumentPosition the response // is of type CompletionItem[] or CompletionList // or a Thenable that resolves to such. // // The request can delay the computation of the `detail` // and `documentation` properties to the `completionItem/resolve` // request. However, properties that are needed for the initial sorting and filtering, like `sortText`, // `filterText`, `insertText`, and `textEdit`, must not be changed during resolve. MethodTextDocumentCompletion Method = "textDocument/completion" // Request to resolve additional information for a given completion item.The request's // parameter is of type CompletionItem the response // is of type CompletionItem or a Thenable that resolves to such. MethodCompletionItemResolve Method = "completionItem/resolve" // Request to request hover information at a given text document position. The request's // parameter is of type TextDocumentPosition the response is of // type Hover or a Thenable that resolves to such. MethodTextDocumentHover Method = "textDocument/hover" MethodTextDocumentSignatureHelp Method = "textDocument/signatureHelp" // A request to resolve the definition location of a symbol at a given text // document position. The request's parameter is of type TextDocumentPosition // the response is of either type Definition or a typed array of // DefinitionLink or a Thenable that resolves to such. MethodTextDocumentDefinition Method = "textDocument/definition" // A request to resolve project-wide references for the symbol denoted // by the given text document position. The request's parameter is of // type ReferenceParams the response is of type // Location[] or a Thenable that resolves to such. MethodTextDocumentReferences Method = "textDocument/references" // Request to resolve a DocumentHighlight for a given // text document position. The request's parameter is of type TextDocumentPosition // the request response is an array of type DocumentHighlight // or a Thenable that resolves to such. MethodTextDocumentDocumentHighlight Method = "textDocument/documentHighlight" // A request to list all symbols found in a given text document. The request's // parameter is of type TextDocumentIdentifier the // response is of type SymbolInformation[] or a Thenable // that resolves to such. MethodTextDocumentDocumentSymbol Method = "textDocument/documentSymbol" // A request to provide commands for the given text document and range. MethodTextDocumentCodeAction Method = "textDocument/codeAction" // Request to resolve additional information for a given code action.The request's // parameter is of type CodeAction the response // is of type CodeAction or a Thenable that resolves to such. MethodCodeActionResolve Method = "codeAction/resolve" // A request to list project-wide symbols matching the query string given // by the WorkspaceSymbolParams. The response is // of type SymbolInformation[] or a Thenable that // resolves to such. // // Since: 3.17.0 - support for WorkspaceSymbol in the returned data. Clients // need to advertise support for WorkspaceSymbols via the client capability // `workspace.symbol.resolveSupport`. MethodWorkspaceSymbol Method = "workspace/symbol" // A request to resolve the range inside the workspace // symbol's location. // // Since: 3.17.0 MethodWorkspaceSymbolResolve Method = "workspaceSymbol/resolve" // A request to provide code lens for the given text document. MethodTextDocumentCodeLens Method = "textDocument/codeLens" // A request to resolve a command for a given code lens. MethodCodeLensResolve Method = "codeLens/resolve" // A request to refresh all code actions // // Since: 3.16.0 MethodWorkspaceCodeLensRefresh Method = "workspace/codeLens/refresh" // A request to provide document links MethodTextDocumentDocumentLink Method = "textDocument/documentLink" // Request to resolve additional information for a given document link. The request's // parameter is of type DocumentLink the response // is of type DocumentLink or a Thenable that resolves to such. MethodDocumentLinkResolve Method = "documentLink/resolve" // A request to format a whole document. MethodTextDocumentFormatting Method = "textDocument/formatting" // A request to format a range in a document. MethodTextDocumentRangeFormatting Method = "textDocument/rangeFormatting" // A request to format ranges in a document. // // Since: 3.18.0 MethodTextDocumentRangesFormatting Method = "textDocument/rangesFormatting" // A request to format a document on type. MethodTextDocumentOnTypeFormatting Method = "textDocument/onTypeFormatting" // A request to rename a symbol. MethodTextDocumentRename Method = "textDocument/rename" // A request to test and perform the setup necessary for a rename. // // Since: 3.16 - support for default behavior MethodTextDocumentPrepareRename Method = "textDocument/prepareRename" // A request send from the client to the server to execute a command. The request might return // a workspace edit which the client will apply to the workspace. MethodWorkspaceExecuteCommand Method = "workspace/executeCommand" // A request sent from the server to the client to modified certain resources. MethodWorkspaceApplyEdit Method = "workspace/applyEdit" // Triggers garbage collection in the language server. MethodCustomRunGC Method = "custom/runGC" // Saves a heap profile to the specified directory. MethodCustomSaveHeapProfile Method = "custom/saveHeapProfile" // Saves an allocation profile to the specified directory. MethodCustomSaveAllocProfile Method = "custom/saveAllocProfile" // Starts CPU profiling, writing to the specified directory when stopped. MethodCustomStartCPUProfile Method = "custom/startCPUProfile" // Stops CPU profiling and saves the profile. MethodCustomStopCPUProfile Method = "custom/stopCPUProfile" // Custom request to initialize an API session. MethodCustomInitializeAPISession Method = "custom/initializeAPISession" // Returns project information (e.g. the tsconfig.json path) for a given text document. MethodCustomProjectInfo Method = "custom/projectInfo" // Request to get source definitions for a position. MethodCustomTextDocumentSourceDefinition Method = "custom/textDocument/sourceDefinition" // Request to get document highlights across multiple files. MethodCustomTextDocumentMultiDocumentHighlight Method = "custom/textDocument/multiDocumentHighlight" // Request for auto-insert when a trigger character is typed (VS-specific). MethodTextDocumentVSOnAutoInsert Method = "textDocument/_vs_onAutoInsert" // VS-specific request for Find All References with grouped reference items. MethodTextDocumentVSReferences Method = "textDocument/_vs_references" // The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace // folder configuration changes. MethodWorkspaceDidChangeWorkspaceFolders Method = "workspace/didChangeWorkspaceFolders" // The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress // initiated on the server side. MethodWindowWorkDoneProgressCancel Method = "window/workDoneProgress/cancel" // The did create files notification is sent from the client to the server when // files were created from within the client. // // Since: 3.16.0 MethodWorkspaceDidCreateFiles Method = "workspace/didCreateFiles" // The did rename files notification is sent from the client to the server when // files were renamed from within the client. // // Since: 3.16.0 MethodWorkspaceDidRenameFiles Method = "workspace/didRenameFiles" // The will delete files request is sent from the client to the server before files are actually // deleted as long as the deletion is triggered from within the client. // // Since: 3.16.0 MethodWorkspaceDidDeleteFiles Method = "workspace/didDeleteFiles" // The initialized notification is sent from the client to the // server after the client is fully initialized and the server // is allowed to send requests from the server to the client. MethodInitialized Method = "initialized" // The exit event is sent from the client to the server to // ask the server to exit its process. MethodExit Method = "exit" // The configuration change notification is sent from the client to the server // when the client's configuration has changed. The notification contains // the changed configuration as defined by the language client. MethodWorkspaceDidChangeConfiguration Method = "workspace/didChangeConfiguration" // The show message notification is sent from a server to a client to ask // the client to display a particular message in the user interface. MethodWindowShowMessage Method = "window/showMessage" // The log message notification is sent from the server to the client to ask // the client to log a particular message. MethodWindowLogMessage Method = "window/logMessage" // The telemetry event notification is sent from the server to the client to ask // the client to log telemetry data. MethodTelemetryEvent Method = "telemetry/event" // The document open notification is sent from the client to the server to signal // newly opened text documents. The document's truth is now managed by the client // and the server must not try to read the document's truth using the document's // uri. Open in this sense means it is managed by the client. It doesn't necessarily // mean that its content is presented in an editor. An open notification must not // be sent more than once without a corresponding close notification send before. // This means open and close notification must be balanced and the max open count // is one. MethodTextDocumentDidOpen Method = "textDocument/didOpen" // The document change notification is sent from the client to the server to signal // changes to a text document. MethodTextDocumentDidChange Method = "textDocument/didChange" // The document close notification is sent from the client to the server when // the document got closed in the client. The document's truth now exists where // the document's uri points to (e.g. if the document's uri is a file uri the // truth now exists on disk). As with the open notification the close notification // is about managing the document's content. Receiving a close notification // doesn't mean that the document was open in an editor before. A close // notification requires a previous open notification to be sent. MethodTextDocumentDidClose Method = "textDocument/didClose" // The document save notification is sent from the client to the server when // the document got saved in the client. MethodTextDocumentDidSave Method = "textDocument/didSave" // A document will save notification is sent from the client to the server before // the document is actually saved. MethodTextDocumentWillSave Method = "textDocument/willSave" // The watched files notification is sent from the client to the server when // the client detects changes to file watched by the language client. MethodWorkspaceDidChangeWatchedFiles Method = "workspace/didChangeWatchedFiles" // Diagnostics notification are sent from the server to the client to signal // results of validation runs. MethodTextDocumentPublishDiagnostics Method = "textDocument/publishDiagnostics" MethodSetTrace Method = "$/setTrace" MethodLogTrace Method = "$/logTrace" MethodCancelRequest Method = "$/cancelRequest" MethodProgress Method = "$/progress" // Notification to set the server's log verbosity level based on the output channel's log level. MethodCustomSetLogVerbosity Method = "custom/setLogVerbosity" // Registration-only method for textDocument/semanticTokens. MethodTextDocumentSemanticTokens Method = "textDocument/semanticTokens" ) // Request response types // Response type for `textDocument/implementation` type ImplementationResponse = LocationOrLocationsOrDefinitionLinksOrNull // Type mapping info for `textDocument/implementation` var TextDocumentImplementationInfo = RequestInfo[*ImplementationParams, ImplementationResponse]{Method: MethodTextDocumentImplementation} // Response type for `textDocument/typeDefinition` type TypeDefinitionResponse = LocationOrLocationsOrDefinitionLinksOrNull // Type mapping info for `textDocument/typeDefinition` var TextDocumentTypeDefinitionInfo = RequestInfo[*TypeDefinitionParams, TypeDefinitionResponse]{Method: MethodTextDocumentTypeDefinition} // Response type for `workspace/workspaceFolders` type WorkspaceFoldersResponse = WorkspaceFoldersOrNull // Type mapping info for `workspace/workspaceFolders` var WorkspaceWorkspaceFoldersInfo = RequestInfo[NoParams, WorkspaceFoldersResponse]{Method: MethodWorkspaceWorkspaceFolders} // Response type for `workspace/configuration` type ConfigurationResponse = []any // Type mapping info for `workspace/configuration` var WorkspaceConfigurationInfo = RequestInfo[*ConfigurationParams, ConfigurationResponse]{Method: MethodWorkspaceConfiguration} // Response type for `textDocument/documentColor` type DocumentColorResponse = []*ColorInformation // Type mapping info for `textDocument/documentColor` var TextDocumentDocumentColorInfo = RequestInfo[*DocumentColorParams, DocumentColorResponse]{Method: MethodTextDocumentDocumentColor} // Response type for `textDocument/colorPresentation` type ColorPresentationResponse = []*ColorPresentation // Type mapping info for `textDocument/colorPresentation` var TextDocumentColorPresentationInfo = RequestInfo[*ColorPresentationParams, ColorPresentationResponse]{Method: MethodTextDocumentColorPresentation} // Response type for `textDocument/foldingRange` type FoldingRangeResponse = FoldingRangesOrNull // Type mapping info for `textDocument/foldingRange` var TextDocumentFoldingRangeInfo = RequestInfo[*FoldingRangeParams, FoldingRangeResponse]{Method: MethodTextDocumentFoldingRange} // Response type for `workspace/foldingRange/refresh` type FoldingRangeRefreshResponse = Null // Type mapping info for `workspace/foldingRange/refresh` var WorkspaceFoldingRangeRefreshInfo = RequestInfo[NoParams, FoldingRangeRefreshResponse]{Method: MethodWorkspaceFoldingRangeRefresh} // Response type for `textDocument/declaration` type DeclarationResponse = LocationOrLocationsOrDeclarationLinksOrNull // Type mapping info for `textDocument/declaration` var TextDocumentDeclarationInfo = RequestInfo[*DeclarationParams, DeclarationResponse]{Method: MethodTextDocumentDeclaration} // Response type for `textDocument/selectionRange` type SelectionRangeResponse = SelectionRangesOrNull // Type mapping info for `textDocument/selectionRange` var TextDocumentSelectionRangeInfo = RequestInfo[*SelectionRangeParams, SelectionRangeResponse]{Method: MethodTextDocumentSelectionRange} // Response type for `window/workDoneProgress/create` type WorkDoneProgressCreateResponse = Null // Type mapping info for `window/workDoneProgress/create` var WindowWorkDoneProgressCreateInfo = RequestInfo[*WorkDoneProgressCreateParams, WorkDoneProgressCreateResponse]{Method: MethodWindowWorkDoneProgressCreate} // Response type for `textDocument/prepareCallHierarchy` type CallHierarchyPrepareResponse = CallHierarchyItemsOrNull // Type mapping info for `textDocument/prepareCallHierarchy` var TextDocumentPrepareCallHierarchyInfo = RequestInfo[*CallHierarchyPrepareParams, CallHierarchyPrepareResponse]{Method: MethodTextDocumentPrepareCallHierarchy} // Response type for `callHierarchy/incomingCalls` type CallHierarchyIncomingCallsResponse = CallHierarchyIncomingCallsOrNull // Type mapping info for `callHierarchy/incomingCalls` var CallHierarchyIncomingCallsInfo = RequestInfo[*CallHierarchyIncomingCallsParams, CallHierarchyIncomingCallsResponse]{Method: MethodCallHierarchyIncomingCalls} // Response type for `callHierarchy/outgoingCalls` type CallHierarchyOutgoingCallsResponse = CallHierarchyOutgoingCallsOrNull // Type mapping info for `callHierarchy/outgoingCalls` var CallHierarchyOutgoingCallsInfo = RequestInfo[*CallHierarchyOutgoingCallsParams, CallHierarchyOutgoingCallsResponse]{Method: MethodCallHierarchyOutgoingCalls} // Response type for `textDocument/semanticTokens/full` type SemanticTokensResponse = SemanticTokensOrNull // Type mapping info for `textDocument/semanticTokens/full` var TextDocumentSemanticTokensFullInfo = RequestInfo[*SemanticTokensParams, SemanticTokensResponse]{Method: MethodTextDocumentSemanticTokensFull} // Response type for `textDocument/semanticTokens/full/delta` type SemanticTokensDeltaResponse = SemanticTokensOrSemanticTokensDeltaOrNull // Type mapping info for `textDocument/semanticTokens/full/delta` var TextDocumentSemanticTokensFullDeltaInfo = RequestInfo[*SemanticTokensDeltaParams, SemanticTokensDeltaResponse]{Method: MethodTextDocumentSemanticTokensFullDelta} // Response type for `textDocument/semanticTokens/range` type SemanticTokensRangeResponse = SemanticTokensOrNull // Type mapping info for `textDocument/semanticTokens/range` var TextDocumentSemanticTokensRangeInfo = RequestInfo[*SemanticTokensRangeParams, SemanticTokensRangeResponse]{Method: MethodTextDocumentSemanticTokensRange} // Response type for `workspace/semanticTokens/refresh` type SemanticTokensRefreshResponse = Null // Type mapping info for `workspace/semanticTokens/refresh` var WorkspaceSemanticTokensRefreshInfo = RequestInfo[NoParams, SemanticTokensRefreshResponse]{Method: MethodWorkspaceSemanticTokensRefresh} // Response type for `window/showDocument` type ShowDocumentResponse = *ShowDocumentResult // Type mapping info for `window/showDocument` var WindowShowDocumentInfo = RequestInfo[*ShowDocumentParams, ShowDocumentResponse]{Method: MethodWindowShowDocument} // Response type for `textDocument/linkedEditingRange` type LinkedEditingRangeResponse = LinkedEditingRangesOrNull // Type mapping info for `textDocument/linkedEditingRange` var TextDocumentLinkedEditingRangeInfo = RequestInfo[*LinkedEditingRangeParams, LinkedEditingRangeResponse]{Method: MethodTextDocumentLinkedEditingRange} // Response type for `workspace/willCreateFiles` type WillCreateFilesResponse = WorkspaceEditOrNull // Type mapping info for `workspace/willCreateFiles` var WorkspaceWillCreateFilesInfo = RequestInfo[*CreateFilesParams, WillCreateFilesResponse]{Method: MethodWorkspaceWillCreateFiles} // Response type for `workspace/willRenameFiles` type WillRenameFilesResponse = WorkspaceEditOrNull // Type mapping info for `workspace/willRenameFiles` var WorkspaceWillRenameFilesInfo = RequestInfo[*RenameFilesParams, WillRenameFilesResponse]{Method: MethodWorkspaceWillRenameFiles} // Response type for `workspace/willDeleteFiles` type WillDeleteFilesResponse = WorkspaceEditOrNull // Type mapping info for `workspace/willDeleteFiles` var WorkspaceWillDeleteFilesInfo = RequestInfo[*DeleteFilesParams, WillDeleteFilesResponse]{Method: MethodWorkspaceWillDeleteFiles} // Response type for `textDocument/moniker` type MonikerResponse = MonikersOrNull // Type mapping info for `textDocument/moniker` var TextDocumentMonikerInfo = RequestInfo[*MonikerParams, MonikerResponse]{Method: MethodTextDocumentMoniker} // Response type for `textDocument/prepareTypeHierarchy` type TypeHierarchyPrepareResponse = TypeHierarchyItemsOrNull // Type mapping info for `textDocument/prepareTypeHierarchy` var TextDocumentPrepareTypeHierarchyInfo = RequestInfo[*TypeHierarchyPrepareParams, TypeHierarchyPrepareResponse]{Method: MethodTextDocumentPrepareTypeHierarchy} // Response type for `typeHierarchy/supertypes` type TypeHierarchySupertypesResponse = TypeHierarchyItemsOrNull // Type mapping info for `typeHierarchy/supertypes` var TypeHierarchySupertypesInfo = RequestInfo[*TypeHierarchySupertypesParams, TypeHierarchySupertypesResponse]{Method: MethodTypeHierarchySupertypes} // Response type for `typeHierarchy/subtypes` type TypeHierarchySubtypesResponse = TypeHierarchyItemsOrNull // Type mapping info for `typeHierarchy/subtypes` var TypeHierarchySubtypesInfo = RequestInfo[*TypeHierarchySubtypesParams, TypeHierarchySubtypesResponse]{Method: MethodTypeHierarchySubtypes} // Response type for `textDocument/inlineValue` type InlineValueResponse = InlineValuesOrNull // Type mapping info for `textDocument/inlineValue` var TextDocumentInlineValueInfo = RequestInfo[*InlineValueParams, InlineValueResponse]{Method: MethodTextDocumentInlineValue} // Response type for `workspace/inlineValue/refresh` type InlineValueRefreshResponse = Null // Type mapping info for `workspace/inlineValue/refresh` var WorkspaceInlineValueRefreshInfo = RequestInfo[NoParams, InlineValueRefreshResponse]{Method: MethodWorkspaceInlineValueRefresh} // Response type for `textDocument/inlayHint` type InlayHintResponse = InlayHintsOrNull // Type mapping info for `textDocument/inlayHint` var TextDocumentInlayHintInfo = RequestInfo[*InlayHintParams, InlayHintResponse]{Method: MethodTextDocumentInlayHint} // Response type for `inlayHint/resolve` type InlayHintResolveResponse = *InlayHint // Type mapping info for `inlayHint/resolve` var InlayHintResolveInfo = RequestInfo[*InlayHint, InlayHintResolveResponse]{Method: MethodInlayHintResolve} // Response type for `workspace/inlayHint/refresh` type InlayHintRefreshResponse = Null // Type mapping info for `workspace/inlayHint/refresh` var WorkspaceInlayHintRefreshInfo = RequestInfo[NoParams, InlayHintRefreshResponse]{Method: MethodWorkspaceInlayHintRefresh} // Response type for `textDocument/diagnostic` type DocumentDiagnosticResponse = RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport // Type mapping info for `textDocument/diagnostic` var TextDocumentDiagnosticInfo = RequestInfo[*DocumentDiagnosticParams, DocumentDiagnosticResponse]{Method: MethodTextDocumentDiagnostic} // Response type for `workspace/diagnostic` type WorkspaceDiagnosticResponse = *WorkspaceDiagnosticReport // Type mapping info for `workspace/diagnostic` var WorkspaceDiagnosticInfo = RequestInfo[*WorkspaceDiagnosticParams, WorkspaceDiagnosticResponse]{Method: MethodWorkspaceDiagnostic} // Response type for `workspace/diagnostic/refresh` type DiagnosticRefreshResponse = Null // Type mapping info for `workspace/diagnostic/refresh` var WorkspaceDiagnosticRefreshInfo = RequestInfo[NoParams, DiagnosticRefreshResponse]{Method: MethodWorkspaceDiagnosticRefresh} // Response type for `textDocument/inlineCompletion` type InlineCompletionResponse = InlineCompletionListOrItemsOrNull // Type mapping info for `textDocument/inlineCompletion` var TextDocumentInlineCompletionInfo = RequestInfo[*InlineCompletionParams, InlineCompletionResponse]{Method: MethodTextDocumentInlineCompletion} // Response type for `workspace/textDocumentContent` type TextDocumentContentResponse = *TextDocumentContentResult // Type mapping info for `workspace/textDocumentContent` var WorkspaceTextDocumentContentInfo = RequestInfo[*TextDocumentContentParams, TextDocumentContentResponse]{Method: MethodWorkspaceTextDocumentContent} // Response type for `workspace/textDocumentContent/refresh` type TextDocumentContentRefreshResponse = Null // Type mapping info for `workspace/textDocumentContent/refresh` var WorkspaceTextDocumentContentRefreshInfo = RequestInfo[*TextDocumentContentRefreshParams, TextDocumentContentRefreshResponse]{Method: MethodWorkspaceTextDocumentContentRefresh} // Response type for `client/registerCapability` type RegistrationResponse = Null // Type mapping info for `client/registerCapability` var ClientRegisterCapabilityInfo = RequestInfo[*RegistrationParams, RegistrationResponse]{Method: MethodClientRegisterCapability} // Response type for `client/unregisterCapability` type UnregistrationResponse = Null // Type mapping info for `client/unregisterCapability` var ClientUnregisterCapabilityInfo = RequestInfo[*UnregistrationParams, UnregistrationResponse]{Method: MethodClientUnregisterCapability} // Response type for `initialize` type InitializeResponse = *InitializeResult // Type mapping info for `initialize` var InitializeInfo = RequestInfo[*InitializeParams, InitializeResponse]{Method: MethodInitialize} // Response type for `shutdown` type ShutdownResponse = Null // Type mapping info for `shutdown` var ShutdownInfo = RequestInfo[NoParams, ShutdownResponse]{Method: MethodShutdown} // Response type for `window/showMessageRequest` type ShowMessageResponse = MessageActionItemOrNull // Type mapping info for `window/showMessageRequest` var WindowShowMessageRequestInfo = RequestInfo[*ShowMessageRequestParams, ShowMessageResponse]{Method: MethodWindowShowMessageRequest} // Response type for `textDocument/willSaveWaitUntil` type WillSaveTextDocumentWaitUntilResponse = TextEditsOrNull // Type mapping info for `textDocument/willSaveWaitUntil` var TextDocumentWillSaveWaitUntilInfo = RequestInfo[*WillSaveTextDocumentParams, WillSaveTextDocumentWaitUntilResponse]{Method: MethodTextDocumentWillSaveWaitUntil} // Response type for `textDocument/completion` type CompletionResponse = CompletionItemsOrListOrNull // Type mapping info for `textDocument/completion` var TextDocumentCompletionInfo = RequestInfo[*CompletionParams, CompletionResponse]{Method: MethodTextDocumentCompletion} // Response type for `completionItem/resolve` type CompletionResolveResponse = *CompletionItem // Type mapping info for `completionItem/resolve` var CompletionItemResolveInfo = RequestInfo[*CompletionItem, CompletionResolveResponse]{Method: MethodCompletionItemResolve} // Response type for `textDocument/hover` type HoverResponse = HoverOrNull // Type mapping info for `textDocument/hover` var TextDocumentHoverInfo = RequestInfo[*HoverParams, HoverResponse]{Method: MethodTextDocumentHover} // Response type for `textDocument/signatureHelp` type SignatureHelpResponse = SignatureHelpOrNull // Type mapping info for `textDocument/signatureHelp` var TextDocumentSignatureHelpInfo = RequestInfo[*SignatureHelpParams, SignatureHelpResponse]{Method: MethodTextDocumentSignatureHelp} // Response type for `textDocument/definition` type DefinitionResponse = LocationOrLocationsOrDefinitionLinksOrNull // Type mapping info for `textDocument/definition` var TextDocumentDefinitionInfo = RequestInfo[*DefinitionParams, DefinitionResponse]{Method: MethodTextDocumentDefinition} // Response type for `textDocument/references` type ReferencesResponse = LocationsOrNull // Type mapping info for `textDocument/references` var TextDocumentReferencesInfo = RequestInfo[*ReferenceParams, ReferencesResponse]{Method: MethodTextDocumentReferences} // Response type for `textDocument/documentHighlight` type DocumentHighlightResponse = DocumentHighlightsOrNull // Type mapping info for `textDocument/documentHighlight` var TextDocumentDocumentHighlightInfo = RequestInfo[*DocumentHighlightParams, DocumentHighlightResponse]{Method: MethodTextDocumentDocumentHighlight} // Response type for `textDocument/documentSymbol` type DocumentSymbolResponse = SymbolInformationsOrDocumentSymbolsOrNull // Type mapping info for `textDocument/documentSymbol` var TextDocumentDocumentSymbolInfo = RequestInfo[*DocumentSymbolParams, DocumentSymbolResponse]{Method: MethodTextDocumentDocumentSymbol} // Response type for `textDocument/codeAction` type CodeActionResponse = CommandOrCodeActionArrayOrNull // Type mapping info for `textDocument/codeAction` var TextDocumentCodeActionInfo = RequestInfo[*CodeActionParams, CodeActionResponse]{Method: MethodTextDocumentCodeAction} // Response type for `codeAction/resolve` type CodeActionResolveResponse = *CodeAction // Type mapping info for `codeAction/resolve` var CodeActionResolveInfo = RequestInfo[*CodeAction, CodeActionResolveResponse]{Method: MethodCodeActionResolve} // Response type for `workspace/symbol` type WorkspaceSymbolResponse = SymbolInformationsOrWorkspaceSymbolsOrNull // Type mapping info for `workspace/symbol` var WorkspaceSymbolInfo = RequestInfo[*WorkspaceSymbolParams, WorkspaceSymbolResponse]{Method: MethodWorkspaceSymbol} // Response type for `workspaceSymbol/resolve` type WorkspaceSymbolResolveResponse = *WorkspaceSymbol // Type mapping info for `workspaceSymbol/resolve` var WorkspaceSymbolResolveInfo = RequestInfo[*WorkspaceSymbol, WorkspaceSymbolResolveResponse]{Method: MethodWorkspaceSymbolResolve} // Response type for `textDocument/codeLens` type CodeLensResponse = CodeLensesOrNull // Type mapping info for `textDocument/codeLens` var TextDocumentCodeLensInfo = RequestInfo[*CodeLensParams, CodeLensResponse]{Method: MethodTextDocumentCodeLens} // Response type for `codeLens/resolve` type CodeLensResolveResponse = *CodeLens // Type mapping info for `codeLens/resolve` var CodeLensResolveInfo = RequestInfo[*CodeLens, CodeLensResolveResponse]{Method: MethodCodeLensResolve} // Response type for `workspace/codeLens/refresh` type CodeLensRefreshResponse = Null // Type mapping info for `workspace/codeLens/refresh` var WorkspaceCodeLensRefreshInfo = RequestInfo[NoParams, CodeLensRefreshResponse]{Method: MethodWorkspaceCodeLensRefresh} // Response type for `textDocument/documentLink` type DocumentLinkResponse = DocumentLinksOrNull // Type mapping info for `textDocument/documentLink` var TextDocumentDocumentLinkInfo = RequestInfo[*DocumentLinkParams, DocumentLinkResponse]{Method: MethodTextDocumentDocumentLink} // Response type for `documentLink/resolve` type DocumentLinkResolveResponse = *DocumentLink // Type mapping info for `documentLink/resolve` var DocumentLinkResolveInfo = RequestInfo[*DocumentLink, DocumentLinkResolveResponse]{Method: MethodDocumentLinkResolve} // Response type for `textDocument/formatting` type DocumentFormattingResponse = TextEditsOrNull // Type mapping info for `textDocument/formatting` var TextDocumentFormattingInfo = RequestInfo[*DocumentFormattingParams, DocumentFormattingResponse]{Method: MethodTextDocumentFormatting} // Response type for `textDocument/rangeFormatting` type DocumentRangeFormattingResponse = TextEditsOrNull // Type mapping info for `textDocument/rangeFormatting` var TextDocumentRangeFormattingInfo = RequestInfo[*DocumentRangeFormattingParams, DocumentRangeFormattingResponse]{Method: MethodTextDocumentRangeFormatting} // Response type for `textDocument/rangesFormatting` type DocumentRangesFormattingResponse = TextEditsOrNull // Type mapping info for `textDocument/rangesFormatting` var TextDocumentRangesFormattingInfo = RequestInfo[*DocumentRangesFormattingParams, DocumentRangesFormattingResponse]{Method: MethodTextDocumentRangesFormatting} // Response type for `textDocument/onTypeFormatting` type DocumentOnTypeFormattingResponse = TextEditsOrNull // Type mapping info for `textDocument/onTypeFormatting` var TextDocumentOnTypeFormattingInfo = RequestInfo[*DocumentOnTypeFormattingParams, DocumentOnTypeFormattingResponse]{Method: MethodTextDocumentOnTypeFormatting} // Response type for `textDocument/rename` type RenameResponse = WorkspaceEditOrNull // Type mapping info for `textDocument/rename` var TextDocumentRenameInfo = RequestInfo[*RenameParams, RenameResponse]{Method: MethodTextDocumentRename} // Response type for `textDocument/prepareRename` type PrepareRenameResponse = RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull // Type mapping info for `textDocument/prepareRename` var TextDocumentPrepareRenameInfo = RequestInfo[*PrepareRenameParams, PrepareRenameResponse]{Method: MethodTextDocumentPrepareRename} // Response type for `workspace/executeCommand` type ExecuteCommandResponse = LSPAnyOrNull // Type mapping info for `workspace/executeCommand` var WorkspaceExecuteCommandInfo = RequestInfo[*ExecuteCommandParams, ExecuteCommandResponse]{Method: MethodWorkspaceExecuteCommand} // Response type for `workspace/applyEdit` type ApplyWorkspaceEditResponse = *ApplyWorkspaceEditResult // Type mapping info for `workspace/applyEdit` var WorkspaceApplyEditInfo = RequestInfo[*ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse]{Method: MethodWorkspaceApplyEdit} // Response type for `custom/runGC` type RunGCResponse = Null // Type mapping info for `custom/runGC` var CustomRunGCInfo = RequestInfo[NoParams, RunGCResponse]{Method: MethodCustomRunGC} // Response type for `custom/saveHeapProfile` type SaveHeapProfileResponse = *ProfileResult // Type mapping info for `custom/saveHeapProfile` var CustomSaveHeapProfileInfo = RequestInfo[*ProfileParams, SaveHeapProfileResponse]{Method: MethodCustomSaveHeapProfile} // Response type for `custom/saveAllocProfile` type SaveAllocProfileResponse = *ProfileResult // Type mapping info for `custom/saveAllocProfile` var CustomSaveAllocProfileInfo = RequestInfo[*ProfileParams, SaveAllocProfileResponse]{Method: MethodCustomSaveAllocProfile} // Response type for `custom/startCPUProfile` type StartCPUProfileResponse = Null // Type mapping info for `custom/startCPUProfile` var CustomStartCPUProfileInfo = RequestInfo[*ProfileParams, StartCPUProfileResponse]{Method: MethodCustomStartCPUProfile} // Response type for `custom/stopCPUProfile` type StopCPUProfileResponse = *ProfileResult // Type mapping info for `custom/stopCPUProfile` var CustomStopCPUProfileInfo = RequestInfo[NoParams, StopCPUProfileResponse]{Method: MethodCustomStopCPUProfile} // Response type for `custom/initializeAPISession` type CustomInitializeAPISessionResponse = *InitializeAPISessionResult // Type mapping info for `custom/initializeAPISession` var CustomInitializeAPISessionInfo = RequestInfo[*InitializeAPISessionParams, CustomInitializeAPISessionResponse]{Method: MethodCustomInitializeAPISession} // Response type for `custom/projectInfo` type CustomProjectInfoResponse = *ProjectInfoResult // Type mapping info for `custom/projectInfo` var CustomProjectInfoInfo = RequestInfo[*ProjectInfoParams, CustomProjectInfoResponse]{Method: MethodCustomProjectInfo} // Response type for `custom/textDocument/sourceDefinition` type CustomTextDocumentSourceDefinitionResponse = *LocationOrLocationsOrDefinitionLinksOrNull // Type mapping info for `custom/textDocument/sourceDefinition` var CustomTextDocumentSourceDefinitionInfo = RequestInfo[*TextDocumentPositionParams, CustomTextDocumentSourceDefinitionResponse]{Method: MethodCustomTextDocumentSourceDefinition} // Response type for `custom/textDocument/multiDocumentHighlight` type CustomMultiDocumentHighlightResponse = MultiDocumentHighlightsOrNull // Type mapping info for `custom/textDocument/multiDocumentHighlight` var CustomTextDocumentMultiDocumentHighlightInfo = RequestInfo[*MultiDocumentHighlightParams, CustomMultiDocumentHighlightResponse]{Method: MethodCustomTextDocumentMultiDocumentHighlight} // Response type for `textDocument/_vs_onAutoInsert` type VSOnAutoInsertResponse = VSOnAutoInsertResponseItemOrNull // Type mapping info for `textDocument/_vs_onAutoInsert` var TextDocumentVSOnAutoInsertInfo = RequestInfo[*VSOnAutoInsertParams, VSOnAutoInsertResponse]{Method: MethodTextDocumentVSOnAutoInsert} // Response type for `textDocument/_vs_references` type VSReferencesResponse = VSReferenceItemsOrNull // Type mapping info for `textDocument/_vs_references` var TextDocumentVSReferencesInfo = RequestInfo[*ReferenceParams, VSReferencesResponse]{Method: MethodTextDocumentVSReferences} // Type mapping info for `workspace/didChangeWorkspaceFolders` var WorkspaceDidChangeWorkspaceFoldersInfo = NotificationInfo[*DidChangeWorkspaceFoldersParams]{Method: MethodWorkspaceDidChangeWorkspaceFolders} // Type mapping info for `window/workDoneProgress/cancel` var WindowWorkDoneProgressCancelInfo = NotificationInfo[*WorkDoneProgressCancelParams]{Method: MethodWindowWorkDoneProgressCancel} // Type mapping info for `workspace/didCreateFiles` var WorkspaceDidCreateFilesInfo = NotificationInfo[*CreateFilesParams]{Method: MethodWorkspaceDidCreateFiles} // Type mapping info for `workspace/didRenameFiles` var WorkspaceDidRenameFilesInfo = NotificationInfo[*RenameFilesParams]{Method: MethodWorkspaceDidRenameFiles} // Type mapping info for `workspace/didDeleteFiles` var WorkspaceDidDeleteFilesInfo = NotificationInfo[*DeleteFilesParams]{Method: MethodWorkspaceDidDeleteFiles} // Type mapping info for `initialized` var InitializedInfo = NotificationInfo[*InitializedParams]{Method: MethodInitialized} // Type mapping info for `exit` var ExitInfo = NotificationInfo[NoParams]{Method: MethodExit} // Type mapping info for `workspace/didChangeConfiguration` var WorkspaceDidChangeConfigurationInfo = NotificationInfo[*DidChangeConfigurationParams]{Method: MethodWorkspaceDidChangeConfiguration} // Type mapping info for `window/showMessage` var WindowShowMessageInfo = NotificationInfo[*ShowMessageParams]{Method: MethodWindowShowMessage} // Type mapping info for `window/logMessage` var WindowLogMessageInfo = NotificationInfo[*LogMessageParams]{Method: MethodWindowLogMessage} // Type mapping info for `telemetry/event` var TelemetryEventInfo = NotificationInfo[TelemetryEvent]{Method: MethodTelemetryEvent} // Type mapping info for `textDocument/didOpen` var TextDocumentDidOpenInfo = NotificationInfo[*DidOpenTextDocumentParams]{Method: MethodTextDocumentDidOpen} // Type mapping info for `textDocument/didChange` var TextDocumentDidChangeInfo = NotificationInfo[*DidChangeTextDocumentParams]{Method: MethodTextDocumentDidChange} // Type mapping info for `textDocument/didClose` var TextDocumentDidCloseInfo = NotificationInfo[*DidCloseTextDocumentParams]{Method: MethodTextDocumentDidClose} // Type mapping info for `textDocument/didSave` var TextDocumentDidSaveInfo = NotificationInfo[*DidSaveTextDocumentParams]{Method: MethodTextDocumentDidSave} // Type mapping info for `textDocument/willSave` var TextDocumentWillSaveInfo = NotificationInfo[*WillSaveTextDocumentParams]{Method: MethodTextDocumentWillSave} // Type mapping info for `workspace/didChangeWatchedFiles` var WorkspaceDidChangeWatchedFilesInfo = NotificationInfo[*DidChangeWatchedFilesParams]{Method: MethodWorkspaceDidChangeWatchedFiles} // Type mapping info for `textDocument/publishDiagnostics` var TextDocumentPublishDiagnosticsInfo = NotificationInfo[*PublishDiagnosticsParams]{Method: MethodTextDocumentPublishDiagnostics} // Type mapping info for `$/setTrace` var SetTraceInfo = NotificationInfo[*SetTraceParams]{Method: MethodSetTrace} // Type mapping info for `$/logTrace` var LogTraceInfo = NotificationInfo[*LogTraceParams]{Method: MethodLogTrace} // Type mapping info for `$/cancelRequest` var CancelRequestInfo = NotificationInfo[*CancelParams]{Method: MethodCancelRequest} // Type mapping info for `$/progress` var ProgressInfo = NotificationInfo[*ProgressParams]{Method: MethodProgress} // Type mapping info for `custom/setLogVerbosity` var CustomSetLogVerbosityInfo = NotificationInfo[*SetLogVerbosityParams]{Method: MethodCustomSetLogVerbosity} // Type aliases type TelemetryEvent = RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull // Union types type IntegerOrString struct { Integer *int32 String *string } var _ json.MarshalerTo = (*IntegerOrString)(nil) func (o *IntegerOrString) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "IntegerOrString", false) } var _ json.UnmarshalerFrom = (*IntegerOrString)(nil) func (o *IntegerOrString) UnmarshalJSONFrom(dec *json.Decoder) error { *o = IntegerOrString{} switch dec.PeekKind() { case '0': o.Integer = new(int32) return json.UnmarshalDecode(dec, o.Integer) case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) default: return errInvalidKind("IntegerOrString", dec.PeekKind()) } } type DocumentSelectorOrNull struct { DocumentSelector *[]TextDocumentFilterLanguageOrSchemeOrPattern } var _ json.MarshalerTo = (*DocumentSelectorOrNull)(nil) func (o *DocumentSelectorOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "DocumentSelectorOrNull", true) } var _ json.UnmarshalerFrom = (*DocumentSelectorOrNull)(nil) func (o *DocumentSelectorOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = DocumentSelectorOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.DocumentSelector = new([]TextDocumentFilterLanguageOrSchemeOrPattern) return json.UnmarshalDecode(dec, o.DocumentSelector) default: return errInvalidKind("DocumentSelectorOrNull", dec.PeekKind()) } } type BooleanOrEmptyObject struct { Boolean *bool EmptyObject *struct{} } var _ json.MarshalerTo = (*BooleanOrEmptyObject)(nil) func (o *BooleanOrEmptyObject) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrEmptyObject", false) } var _ json.UnmarshalerFrom = (*BooleanOrEmptyObject)(nil) func (o *BooleanOrEmptyObject) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrEmptyObject{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.EmptyObject = new(struct{}) return json.UnmarshalDecode(dec, o.EmptyObject) default: return errInvalidKind("BooleanOrEmptyObject", dec.PeekKind()) } } type BooleanOrSemanticTokensFullDelta struct { Boolean *bool SemanticTokensFullDelta *SemanticTokensFullDelta } var _ json.MarshalerTo = (*BooleanOrSemanticTokensFullDelta)(nil) func (o *BooleanOrSemanticTokensFullDelta) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrSemanticTokensFullDelta", false) } var _ json.UnmarshalerFrom = (*BooleanOrSemanticTokensFullDelta)(nil) func (o *BooleanOrSemanticTokensFullDelta) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrSemanticTokensFullDelta{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.SemanticTokensFullDelta = new(SemanticTokensFullDelta) return json.UnmarshalDecode(dec, o.SemanticTokensFullDelta) default: return errInvalidKind("BooleanOrSemanticTokensFullDelta", dec.PeekKind()) } } type TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile struct { TextDocumentEdit *TextDocumentEdit CreateFile *CreateFile RenameFile *RenameFile DeleteFile *DeleteFile } var _ json.MarshalerTo = (*TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile)(nil) func (o *TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile", false) } var _ json.UnmarshalerFrom = (*TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile)(nil) func (o *TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile{} data, err := dec.ReadValue() if err != nil { return err } switch string(jsonObjectRawField(data, "kind")) { case `"rename"`: o.RenameFile = new(RenameFile) return json.Unmarshal(data, o.RenameFile) case `"create"`: o.CreateFile = new(CreateFile) return json.Unmarshal(data, o.CreateFile) case `"delete"`: o.DeleteFile = new(DeleteFile) return json.Unmarshal(data, o.DeleteFile) default: o.TextDocumentEdit = new(TextDocumentEdit) return json.Unmarshal(data, o.TextDocumentEdit) } } type StringOrInlayHintLabelParts struct { String *string InlayHintLabelParts *[]*InlayHintLabelPart } var _ json.MarshalerTo = (*StringOrInlayHintLabelParts)(nil) func (o *StringOrInlayHintLabelParts) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrInlayHintLabelParts", false) } var _ json.UnmarshalerFrom = (*StringOrInlayHintLabelParts)(nil) func (o *StringOrInlayHintLabelParts) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrInlayHintLabelParts{} switch dec.PeekKind() { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '[': o.InlayHintLabelParts = new([]*InlayHintLabelPart) return json.UnmarshalDecode(dec, o.InlayHintLabelParts) default: return errInvalidKind("StringOrInlayHintLabelParts", dec.PeekKind()) } } type StringOrMarkupContent struct { String *string MarkupContent *MarkupContent } var _ json.MarshalerTo = (*StringOrMarkupContent)(nil) func (o *StringOrMarkupContent) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrMarkupContent", false) } var _ json.UnmarshalerFrom = (*StringOrMarkupContent)(nil) func (o *StringOrMarkupContent) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrMarkupContent{} switch dec.PeekKind() { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '{': o.MarkupContent = new(MarkupContent) return json.UnmarshalDecode(dec, o.MarkupContent) default: return errInvalidKind("StringOrMarkupContent", dec.PeekKind()) } } type WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport struct { FullDocumentDiagnosticReport *WorkspaceFullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport *WorkspaceUnchangedDocumentDiagnosticReport } var _ json.MarshalerTo = (*WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport)(nil) func (o *WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport", false) } var _ json.UnmarshalerFrom = (*WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport)(nil) func (o *WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { *o = WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport{} data, err := dec.ReadValue() if err != nil { return err } switch string(jsonObjectRawField(data, "kind")) { case `"full"`: o.FullDocumentDiagnosticReport = new(WorkspaceFullDocumentDiagnosticReport) return json.Unmarshal(data, o.FullDocumentDiagnosticReport) case `"unchanged"`: o.UnchangedDocumentDiagnosticReport = new(WorkspaceUnchangedDocumentDiagnosticReport) return json.Unmarshal(data, o.UnchangedDocumentDiagnosticReport) } return errInvalidValue("WorkspaceFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport", data) } type StringOrStringValue struct { String *string StringValue *StringValue } var _ json.MarshalerTo = (*StringOrStringValue)(nil) func (o *StringOrStringValue) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrStringValue", false) } var _ json.UnmarshalerFrom = (*StringOrStringValue)(nil) func (o *StringOrStringValue) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrStringValue{} switch dec.PeekKind() { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '{': o.StringValue = new(StringValue) return json.UnmarshalDecode(dec, o.StringValue) default: return errInvalidKind("StringOrStringValue", dec.PeekKind()) } } type IntegerOrNull struct { Integer *int32 } var _ json.MarshalerTo = (*IntegerOrNull)(nil) func (o *IntegerOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "IntegerOrNull", true) } var _ json.UnmarshalerFrom = (*IntegerOrNull)(nil) func (o *IntegerOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = IntegerOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '0': o.Integer = new(int32) return json.UnmarshalDecode(dec, o.Integer) default: return errInvalidKind("IntegerOrNull", dec.PeekKind()) } } type StringOrNull struct { String *string } var _ json.MarshalerTo = (*StringOrNull)(nil) func (o *StringOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrNull", true) } var _ json.UnmarshalerFrom = (*StringOrNull)(nil) func (o *StringOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) default: return errInvalidKind("StringOrNull", dec.PeekKind()) } } type DocumentUriOrNull struct { DocumentUri *DocumentUri } var _ json.MarshalerTo = (*DocumentUriOrNull)(nil) func (o *DocumentUriOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "DocumentUriOrNull", true) } var _ json.UnmarshalerFrom = (*DocumentUriOrNull)(nil) func (o *DocumentUriOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = DocumentUriOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '"': o.DocumentUri = new(DocumentUri) return json.UnmarshalDecode(dec, o.DocumentUri) default: return errInvalidKind("DocumentUriOrNull", dec.PeekKind()) } } type InitializationOptionsOrNull struct { InitializationOptions *InitializationOptions } var _ json.MarshalerTo = (*InitializationOptionsOrNull)(nil) func (o *InitializationOptionsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "InitializationOptionsOrNull", true) } var _ json.UnmarshalerFrom = (*InitializationOptionsOrNull)(nil) func (o *InitializationOptionsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = InitializationOptionsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.InitializationOptions = new(InitializationOptions) return json.UnmarshalDecode(dec, o.InitializationOptions) default: return errInvalidKind("InitializationOptionsOrNull", dec.PeekKind()) } } type WorkspaceFoldersOrNull struct { WorkspaceFolders *[]*WorkspaceFolder } var _ json.MarshalerTo = (*WorkspaceFoldersOrNull)(nil) func (o *WorkspaceFoldersOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "WorkspaceFoldersOrNull", true) } var _ json.UnmarshalerFrom = (*WorkspaceFoldersOrNull)(nil) func (o *WorkspaceFoldersOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = WorkspaceFoldersOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.WorkspaceFolders = new([]*WorkspaceFolder) return json.UnmarshalDecode(dec, o.WorkspaceFolders) default: return errInvalidKind("WorkspaceFoldersOrNull", dec.PeekKind()) } } type StringOrStrings struct { String *string Strings *[]string } var _ json.MarshalerTo = (*StringOrStrings)(nil) func (o *StringOrStrings) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrStrings", false) } var _ json.UnmarshalerFrom = (*StringOrStrings)(nil) func (o *StringOrStrings) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrStrings{} switch dec.PeekKind() { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '[': o.Strings = new([]string) return json.UnmarshalDecode(dec, o.Strings) default: return errInvalidKind("StringOrStrings", dec.PeekKind()) } } type TextDocumentContentChangePartialOrWholeDocument struct { Partial *TextDocumentContentChangePartial WholeDocument *TextDocumentContentChangeWholeDocument } var _ json.MarshalerTo = (*TextDocumentContentChangePartialOrWholeDocument)(nil) func (o *TextDocumentContentChangePartialOrWholeDocument) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextDocumentContentChangePartialOrWholeDocument", false) } var _ json.UnmarshalerFrom = (*TextDocumentContentChangePartialOrWholeDocument)(nil) func (o *TextDocumentContentChangePartialOrWholeDocument) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextDocumentContentChangePartialOrWholeDocument{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "range") { case 0: // range o.Partial = new(TextDocumentContentChangePartial) return json.Unmarshal(data, o.Partial) default: o.WholeDocument = new(TextDocumentContentChangeWholeDocument) return json.Unmarshal(data, o.WholeDocument) } } type TextEditOrInsertReplaceEdit struct { TextEdit *TextEdit InsertReplaceEdit *InsertReplaceEdit } var _ json.MarshalerTo = (*TextEditOrInsertReplaceEdit)(nil) func (o *TextEditOrInsertReplaceEdit) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextEditOrInsertReplaceEdit", false) } var _ json.UnmarshalerFrom = (*TextEditOrInsertReplaceEdit)(nil) func (o *TextEditOrInsertReplaceEdit) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextEditOrInsertReplaceEdit{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "insert", "range") { case 0: // insert o.InsertReplaceEdit = new(InsertReplaceEdit) return json.Unmarshal(data, o.InsertReplaceEdit) case 1: // range o.TextEdit = new(TextEdit) return json.Unmarshal(data, o.TextEdit) } return errInvalidValue("TextEditOrInsertReplaceEdit", data) } type MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings struct { MarkupContent *MarkupContent String *string MarkedStringWithLanguage *MarkedStringWithLanguage MarkedStrings *[]StringOrMarkedStringWithLanguage } var _ json.MarshalerTo = (*MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings)(nil) func (o *MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings", false) } var _ json.UnmarshalerFrom = (*MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings)(nil) func (o *MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings) UnmarshalJSONFrom(dec *json.Decoder) error { *o = MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings{} switch dec.PeekKind() { case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "kind", "language") { case 0: // kind o.MarkupContent = new(MarkupContent) return json.Unmarshal(data, o.MarkupContent) case 1: // language o.MarkedStringWithLanguage = new(MarkedStringWithLanguage) return json.Unmarshal(data, o.MarkedStringWithLanguage) } return errInvalidValue("MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings", data) case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '[': o.MarkedStrings = new([]StringOrMarkedStringWithLanguage) return json.UnmarshalDecode(dec, o.MarkedStrings) default: return errInvalidKind("MarkupContentOrStringOrMarkedStringWithLanguageOrMarkedStrings", dec.PeekKind()) } } type UintegerOrNull struct { Uinteger *uint32 } var _ json.MarshalerTo = (*UintegerOrNull)(nil) func (o *UintegerOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "UintegerOrNull", true) } var _ json.UnmarshalerFrom = (*UintegerOrNull)(nil) func (o *UintegerOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = UintegerOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '0': o.Uinteger = new(uint32) return json.UnmarshalDecode(dec, o.Uinteger) default: return errInvalidKind("UintegerOrNull", dec.PeekKind()) } } type LocationOrLocationUriOnly struct { Location *Location LocationUriOnly *LocationUriOnly } var _ json.MarshalerTo = (*LocationOrLocationUriOnly)(nil) func (o *LocationOrLocationUriOnly) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "LocationOrLocationUriOnly", false) } var _ json.UnmarshalerFrom = (*LocationOrLocationUriOnly)(nil) func (o *LocationOrLocationUriOnly) UnmarshalJSONFrom(dec *json.Decoder) error { *o = LocationOrLocationUriOnly{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "range") { case 0: // range o.Location = new(Location) return json.Unmarshal(data, o.Location) default: o.LocationUriOnly = new(LocationUriOnly) return json.Unmarshal(data, o.LocationUriOnly) } } type WorkDoneProgressBeginOrReportOrEnd struct { Begin *WorkDoneProgressBegin Report *WorkDoneProgressReport End *WorkDoneProgressEnd } var _ json.MarshalerTo = (*WorkDoneProgressBeginOrReportOrEnd)(nil) func (o *WorkDoneProgressBeginOrReportOrEnd) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "WorkDoneProgressBeginOrReportOrEnd", false) } var _ json.UnmarshalerFrom = (*WorkDoneProgressBeginOrReportOrEnd)(nil) func (o *WorkDoneProgressBeginOrReportOrEnd) UnmarshalJSONFrom(dec *json.Decoder) error { *o = WorkDoneProgressBeginOrReportOrEnd{} data, err := dec.ReadValue() if err != nil { return err } switch string(jsonObjectRawField(data, "kind")) { case `"begin"`: o.Begin = new(WorkDoneProgressBegin) return json.Unmarshal(data, o.Begin) case `"report"`: o.Report = new(WorkDoneProgressReport) return json.Unmarshal(data, o.Report) case `"end"`: o.End = new(WorkDoneProgressEnd) return json.Unmarshal(data, o.End) } return errInvalidValue("WorkDoneProgressBeginOrReportOrEnd", data) } type TextEditOrAnnotatedTextEditOrSnippetTextEdit struct { TextEdit *TextEdit AnnotatedTextEdit *AnnotatedTextEdit SnippetTextEdit *SnippetTextEdit } var _ json.MarshalerTo = (*TextEditOrAnnotatedTextEditOrSnippetTextEdit)(nil) func (o *TextEditOrAnnotatedTextEditOrSnippetTextEdit) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextEditOrAnnotatedTextEditOrSnippetTextEdit", false) } var _ json.UnmarshalerFrom = (*TextEditOrAnnotatedTextEditOrSnippetTextEdit)(nil) func (o *TextEditOrAnnotatedTextEditOrSnippetTextEdit) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextEditOrAnnotatedTextEditOrSnippetTextEdit{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "snippet", "annotationId") { case 0: // snippet o.SnippetTextEdit = new(SnippetTextEdit) return json.Unmarshal(data, o.SnippetTextEdit) case 1: // annotationId o.AnnotatedTextEdit = new(AnnotatedTextEdit) return json.Unmarshal(data, o.AnnotatedTextEdit) default: o.TextEdit = new(TextEdit) return json.Unmarshal(data, o.TextEdit) } } type FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport struct { FullDocumentDiagnosticReport *FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport *UnchangedDocumentDiagnosticReport } var _ json.MarshalerTo = (*FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport)(nil) func (o *FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport", false) } var _ json.UnmarshalerFrom = (*FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport)(nil) func (o *FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { *o = FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport{} data, err := dec.ReadValue() if err != nil { return err } switch string(jsonObjectRawField(data, "kind")) { case `"full"`: o.FullDocumentDiagnosticReport = new(FullDocumentDiagnosticReport) return json.Unmarshal(data, o.FullDocumentDiagnosticReport) case `"unchanged"`: o.UnchangedDocumentDiagnosticReport = new(UnchangedDocumentDiagnosticReport) return json.Unmarshal(data, o.UnchangedDocumentDiagnosticReport) } return errInvalidValue("FullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport", data) } type TextDocumentSyncOptionsOrKind struct { Options *TextDocumentSyncOptions Kind *TextDocumentSyncKind } var _ json.MarshalerTo = (*TextDocumentSyncOptionsOrKind)(nil) func (o *TextDocumentSyncOptionsOrKind) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextDocumentSyncOptionsOrKind", false) } var _ json.UnmarshalerFrom = (*TextDocumentSyncOptionsOrKind)(nil) func (o *TextDocumentSyncOptionsOrKind) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextDocumentSyncOptionsOrKind{} switch dec.PeekKind() { case '{': o.Options = new(TextDocumentSyncOptions) return json.UnmarshalDecode(dec, o.Options) case '0': o.Kind = new(TextDocumentSyncKind) return json.UnmarshalDecode(dec, o.Kind) default: return errInvalidKind("TextDocumentSyncOptionsOrKind", dec.PeekKind()) } } type BooleanOrHoverOptions struct { Boolean *bool HoverOptions *HoverOptions } var _ json.MarshalerTo = (*BooleanOrHoverOptions)(nil) func (o *BooleanOrHoverOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrHoverOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrHoverOptions)(nil) func (o *BooleanOrHoverOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrHoverOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.HoverOptions = new(HoverOptions) return json.UnmarshalDecode(dec, o.HoverOptions) default: return errInvalidKind("BooleanOrHoverOptions", dec.PeekKind()) } } type BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions struct { Boolean *bool DeclarationOptions *DeclarationOptions DeclarationRegistrationOptions *DeclarationRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions)(nil) func (o *BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions)(nil) func (o *BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.DeclarationRegistrationOptions = new(DeclarationRegistrationOptions) return json.Unmarshal(data, o.DeclarationRegistrationOptions) default: o.DeclarationOptions = new(DeclarationOptions) return json.Unmarshal(data, o.DeclarationOptions) } default: return errInvalidKind("BooleanOrDeclarationOptionsOrDeclarationRegistrationOptions", dec.PeekKind()) } } type BooleanOrDefinitionOptions struct { Boolean *bool DefinitionOptions *DefinitionOptions } var _ json.MarshalerTo = (*BooleanOrDefinitionOptions)(nil) func (o *BooleanOrDefinitionOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDefinitionOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDefinitionOptions)(nil) func (o *BooleanOrDefinitionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDefinitionOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.DefinitionOptions = new(DefinitionOptions) return json.UnmarshalDecode(dec, o.DefinitionOptions) default: return errInvalidKind("BooleanOrDefinitionOptions", dec.PeekKind()) } } type BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions struct { Boolean *bool TypeDefinitionOptions *TypeDefinitionOptions TypeDefinitionRegistrationOptions *TypeDefinitionRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions)(nil) func (o *BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions)(nil) func (o *BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.TypeDefinitionRegistrationOptions = new(TypeDefinitionRegistrationOptions) return json.Unmarshal(data, o.TypeDefinitionRegistrationOptions) default: o.TypeDefinitionOptions = new(TypeDefinitionOptions) return json.Unmarshal(data, o.TypeDefinitionOptions) } default: return errInvalidKind("BooleanOrTypeDefinitionOptionsOrTypeDefinitionRegistrationOptions", dec.PeekKind()) } } type BooleanOrImplementationOptionsOrImplementationRegistrationOptions struct { Boolean *bool ImplementationOptions *ImplementationOptions ImplementationRegistrationOptions *ImplementationRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrImplementationOptionsOrImplementationRegistrationOptions)(nil) func (o *BooleanOrImplementationOptionsOrImplementationRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrImplementationOptionsOrImplementationRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrImplementationOptionsOrImplementationRegistrationOptions)(nil) func (o *BooleanOrImplementationOptionsOrImplementationRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrImplementationOptionsOrImplementationRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.ImplementationRegistrationOptions = new(ImplementationRegistrationOptions) return json.Unmarshal(data, o.ImplementationRegistrationOptions) default: o.ImplementationOptions = new(ImplementationOptions) return json.Unmarshal(data, o.ImplementationOptions) } default: return errInvalidKind("BooleanOrImplementationOptionsOrImplementationRegistrationOptions", dec.PeekKind()) } } type BooleanOrReferenceOptions struct { Boolean *bool ReferenceOptions *ReferenceOptions } var _ json.MarshalerTo = (*BooleanOrReferenceOptions)(nil) func (o *BooleanOrReferenceOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrReferenceOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrReferenceOptions)(nil) func (o *BooleanOrReferenceOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrReferenceOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.ReferenceOptions = new(ReferenceOptions) return json.UnmarshalDecode(dec, o.ReferenceOptions) default: return errInvalidKind("BooleanOrReferenceOptions", dec.PeekKind()) } } type BooleanOrDocumentHighlightOptions struct { Boolean *bool DocumentHighlightOptions *DocumentHighlightOptions } var _ json.MarshalerTo = (*BooleanOrDocumentHighlightOptions)(nil) func (o *BooleanOrDocumentHighlightOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDocumentHighlightOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDocumentHighlightOptions)(nil) func (o *BooleanOrDocumentHighlightOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDocumentHighlightOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.DocumentHighlightOptions = new(DocumentHighlightOptions) return json.UnmarshalDecode(dec, o.DocumentHighlightOptions) default: return errInvalidKind("BooleanOrDocumentHighlightOptions", dec.PeekKind()) } } type BooleanOrDocumentSymbolOptions struct { Boolean *bool DocumentSymbolOptions *DocumentSymbolOptions } var _ json.MarshalerTo = (*BooleanOrDocumentSymbolOptions)(nil) func (o *BooleanOrDocumentSymbolOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDocumentSymbolOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDocumentSymbolOptions)(nil) func (o *BooleanOrDocumentSymbolOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDocumentSymbolOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.DocumentSymbolOptions = new(DocumentSymbolOptions) return json.UnmarshalDecode(dec, o.DocumentSymbolOptions) default: return errInvalidKind("BooleanOrDocumentSymbolOptions", dec.PeekKind()) } } type BooleanOrCodeActionOptions struct { Boolean *bool CodeActionOptions *CodeActionOptions } var _ json.MarshalerTo = (*BooleanOrCodeActionOptions)(nil) func (o *BooleanOrCodeActionOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrCodeActionOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrCodeActionOptions)(nil) func (o *BooleanOrCodeActionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrCodeActionOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.CodeActionOptions = new(CodeActionOptions) return json.UnmarshalDecode(dec, o.CodeActionOptions) default: return errInvalidKind("BooleanOrCodeActionOptions", dec.PeekKind()) } } type BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions struct { Boolean *bool DocumentColorOptions *DocumentColorOptions DocumentColorRegistrationOptions *DocumentColorRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions)(nil) func (o *BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions)(nil) func (o *BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.DocumentColorRegistrationOptions = new(DocumentColorRegistrationOptions) return json.Unmarshal(data, o.DocumentColorRegistrationOptions) default: o.DocumentColorOptions = new(DocumentColorOptions) return json.Unmarshal(data, o.DocumentColorOptions) } default: return errInvalidKind("BooleanOrDocumentColorOptionsOrDocumentColorRegistrationOptions", dec.PeekKind()) } } type BooleanOrWorkspaceSymbolOptions struct { Boolean *bool WorkspaceSymbolOptions *WorkspaceSymbolOptions } var _ json.MarshalerTo = (*BooleanOrWorkspaceSymbolOptions)(nil) func (o *BooleanOrWorkspaceSymbolOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrWorkspaceSymbolOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrWorkspaceSymbolOptions)(nil) func (o *BooleanOrWorkspaceSymbolOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrWorkspaceSymbolOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.WorkspaceSymbolOptions = new(WorkspaceSymbolOptions) return json.UnmarshalDecode(dec, o.WorkspaceSymbolOptions) default: return errInvalidKind("BooleanOrWorkspaceSymbolOptions", dec.PeekKind()) } } type BooleanOrDocumentFormattingOptions struct { Boolean *bool DocumentFormattingOptions *DocumentFormattingOptions } var _ json.MarshalerTo = (*BooleanOrDocumentFormattingOptions)(nil) func (o *BooleanOrDocumentFormattingOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDocumentFormattingOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDocumentFormattingOptions)(nil) func (o *BooleanOrDocumentFormattingOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDocumentFormattingOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.DocumentFormattingOptions = new(DocumentFormattingOptions) return json.UnmarshalDecode(dec, o.DocumentFormattingOptions) default: return errInvalidKind("BooleanOrDocumentFormattingOptions", dec.PeekKind()) } } type BooleanOrDocumentRangeFormattingOptions struct { Boolean *bool DocumentRangeFormattingOptions *DocumentRangeFormattingOptions } var _ json.MarshalerTo = (*BooleanOrDocumentRangeFormattingOptions)(nil) func (o *BooleanOrDocumentRangeFormattingOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrDocumentRangeFormattingOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrDocumentRangeFormattingOptions)(nil) func (o *BooleanOrDocumentRangeFormattingOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrDocumentRangeFormattingOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.DocumentRangeFormattingOptions = new(DocumentRangeFormattingOptions) return json.UnmarshalDecode(dec, o.DocumentRangeFormattingOptions) default: return errInvalidKind("BooleanOrDocumentRangeFormattingOptions", dec.PeekKind()) } } type BooleanOrRenameOptions struct { Boolean *bool RenameOptions *RenameOptions } var _ json.MarshalerTo = (*BooleanOrRenameOptions)(nil) func (o *BooleanOrRenameOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrRenameOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrRenameOptions)(nil) func (o *BooleanOrRenameOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrRenameOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.RenameOptions = new(RenameOptions) return json.UnmarshalDecode(dec, o.RenameOptions) default: return errInvalidKind("BooleanOrRenameOptions", dec.PeekKind()) } } type BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions struct { Boolean *bool FoldingRangeOptions *FoldingRangeOptions FoldingRangeRegistrationOptions *FoldingRangeRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions)(nil) func (o *BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions)(nil) func (o *BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.FoldingRangeRegistrationOptions = new(FoldingRangeRegistrationOptions) return json.Unmarshal(data, o.FoldingRangeRegistrationOptions) default: o.FoldingRangeOptions = new(FoldingRangeOptions) return json.Unmarshal(data, o.FoldingRangeOptions) } default: return errInvalidKind("BooleanOrFoldingRangeOptionsOrFoldingRangeRegistrationOptions", dec.PeekKind()) } } type BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions struct { Boolean *bool SelectionRangeOptions *SelectionRangeOptions SelectionRangeRegistrationOptions *SelectionRangeRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions)(nil) func (o *BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions)(nil) func (o *BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.SelectionRangeRegistrationOptions = new(SelectionRangeRegistrationOptions) return json.Unmarshal(data, o.SelectionRangeRegistrationOptions) default: o.SelectionRangeOptions = new(SelectionRangeOptions) return json.Unmarshal(data, o.SelectionRangeOptions) } default: return errInvalidKind("BooleanOrSelectionRangeOptionsOrSelectionRangeRegistrationOptions", dec.PeekKind()) } } type BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions struct { Boolean *bool CallHierarchyOptions *CallHierarchyOptions CallHierarchyRegistrationOptions *CallHierarchyRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions)(nil) func (o *BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions)(nil) func (o *BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.CallHierarchyRegistrationOptions = new(CallHierarchyRegistrationOptions) return json.Unmarshal(data, o.CallHierarchyRegistrationOptions) default: o.CallHierarchyOptions = new(CallHierarchyOptions) return json.Unmarshal(data, o.CallHierarchyOptions) } default: return errInvalidKind("BooleanOrCallHierarchyOptionsOrCallHierarchyRegistrationOptions", dec.PeekKind()) } } type BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions struct { Boolean *bool LinkedEditingRangeOptions *LinkedEditingRangeOptions LinkedEditingRangeRegistrationOptions *LinkedEditingRangeRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions)(nil) func (o *BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions)(nil) func (o *BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.LinkedEditingRangeRegistrationOptions = new(LinkedEditingRangeRegistrationOptions) return json.Unmarshal(data, o.LinkedEditingRangeRegistrationOptions) default: o.LinkedEditingRangeOptions = new(LinkedEditingRangeOptions) return json.Unmarshal(data, o.LinkedEditingRangeOptions) } default: return errInvalidKind("BooleanOrLinkedEditingRangeOptionsOrLinkedEditingRangeRegistrationOptions", dec.PeekKind()) } } type SemanticTokensOptionsOrRegistrationOptions struct { Options *SemanticTokensOptions RegistrationOptions *SemanticTokensRegistrationOptions } var _ json.MarshalerTo = (*SemanticTokensOptionsOrRegistrationOptions)(nil) func (o *SemanticTokensOptionsOrRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SemanticTokensOptionsOrRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*SemanticTokensOptionsOrRegistrationOptions)(nil) func (o *SemanticTokensOptionsOrRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SemanticTokensOptionsOrRegistrationOptions{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.RegistrationOptions = new(SemanticTokensRegistrationOptions) return json.Unmarshal(data, o.RegistrationOptions) default: o.Options = new(SemanticTokensOptions) return json.Unmarshal(data, o.Options) } } type BooleanOrMonikerOptionsOrMonikerRegistrationOptions struct { Boolean *bool MonikerOptions *MonikerOptions MonikerRegistrationOptions *MonikerRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrMonikerOptionsOrMonikerRegistrationOptions)(nil) func (o *BooleanOrMonikerOptionsOrMonikerRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrMonikerOptionsOrMonikerRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrMonikerOptionsOrMonikerRegistrationOptions)(nil) func (o *BooleanOrMonikerOptionsOrMonikerRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrMonikerOptionsOrMonikerRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.MonikerRegistrationOptions = new(MonikerRegistrationOptions) return json.Unmarshal(data, o.MonikerRegistrationOptions) default: o.MonikerOptions = new(MonikerOptions) return json.Unmarshal(data, o.MonikerOptions) } default: return errInvalidKind("BooleanOrMonikerOptionsOrMonikerRegistrationOptions", dec.PeekKind()) } } type BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions struct { Boolean *bool TypeHierarchyOptions *TypeHierarchyOptions TypeHierarchyRegistrationOptions *TypeHierarchyRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions)(nil) func (o *BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions)(nil) func (o *BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.TypeHierarchyRegistrationOptions = new(TypeHierarchyRegistrationOptions) return json.Unmarshal(data, o.TypeHierarchyRegistrationOptions) default: o.TypeHierarchyOptions = new(TypeHierarchyOptions) return json.Unmarshal(data, o.TypeHierarchyOptions) } default: return errInvalidKind("BooleanOrTypeHierarchyOptionsOrTypeHierarchyRegistrationOptions", dec.PeekKind()) } } type BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions struct { Boolean *bool InlineValueOptions *InlineValueOptions InlineValueRegistrationOptions *InlineValueRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions)(nil) func (o *BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions)(nil) func (o *BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.InlineValueRegistrationOptions = new(InlineValueRegistrationOptions) return json.Unmarshal(data, o.InlineValueRegistrationOptions) default: o.InlineValueOptions = new(InlineValueOptions) return json.Unmarshal(data, o.InlineValueOptions) } default: return errInvalidKind("BooleanOrInlineValueOptionsOrInlineValueRegistrationOptions", dec.PeekKind()) } } type BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions struct { Boolean *bool InlayHintOptions *InlayHintOptions InlayHintRegistrationOptions *InlayHintRegistrationOptions } var _ json.MarshalerTo = (*BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions)(nil) func (o *BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions)(nil) func (o *BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.InlayHintRegistrationOptions = new(InlayHintRegistrationOptions) return json.Unmarshal(data, o.InlayHintRegistrationOptions) default: o.InlayHintOptions = new(InlayHintOptions) return json.Unmarshal(data, o.InlayHintOptions) } default: return errInvalidKind("BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions", dec.PeekKind()) } } type DiagnosticOptionsOrRegistrationOptions struct { Options *DiagnosticOptions RegistrationOptions *DiagnosticRegistrationOptions } var _ json.MarshalerTo = (*DiagnosticOptionsOrRegistrationOptions)(nil) func (o *DiagnosticOptionsOrRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "DiagnosticOptionsOrRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*DiagnosticOptionsOrRegistrationOptions)(nil) func (o *DiagnosticOptionsOrRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = DiagnosticOptionsOrRegistrationOptions{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "documentSelector") { case 0: // documentSelector o.RegistrationOptions = new(DiagnosticRegistrationOptions) return json.Unmarshal(data, o.RegistrationOptions) default: o.Options = new(DiagnosticOptions) return json.Unmarshal(data, o.Options) } } type BooleanOrInlineCompletionOptions struct { Boolean *bool InlineCompletionOptions *InlineCompletionOptions } var _ json.MarshalerTo = (*BooleanOrInlineCompletionOptions)(nil) func (o *BooleanOrInlineCompletionOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrInlineCompletionOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrInlineCompletionOptions)(nil) func (o *BooleanOrInlineCompletionOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrInlineCompletionOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.InlineCompletionOptions = new(InlineCompletionOptions) return json.UnmarshalDecode(dec, o.InlineCompletionOptions) default: return errInvalidKind("BooleanOrInlineCompletionOptions", dec.PeekKind()) } } type PatternOrRelativePattern struct { Pattern *string RelativePattern *RelativePattern } var _ json.MarshalerTo = (*PatternOrRelativePattern)(nil) func (o *PatternOrRelativePattern) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "PatternOrRelativePattern", false) } var _ json.UnmarshalerFrom = (*PatternOrRelativePattern)(nil) func (o *PatternOrRelativePattern) UnmarshalJSONFrom(dec *json.Decoder) error { *o = PatternOrRelativePattern{} switch dec.PeekKind() { case '"': o.Pattern = new(string) return json.UnmarshalDecode(dec, o.Pattern) case '{': o.RelativePattern = new(RelativePattern) return json.UnmarshalDecode(dec, o.RelativePattern) default: return errInvalidKind("PatternOrRelativePattern", dec.PeekKind()) } } type RangeOrEditRangeWithInsertReplace struct { Range *Range EditRangeWithInsertReplace *EditRangeWithInsertReplace } var _ json.MarshalerTo = (*RangeOrEditRangeWithInsertReplace)(nil) func (o *RangeOrEditRangeWithInsertReplace) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "RangeOrEditRangeWithInsertReplace", false) } var _ json.UnmarshalerFrom = (*RangeOrEditRangeWithInsertReplace)(nil) func (o *RangeOrEditRangeWithInsertReplace) UnmarshalJSONFrom(dec *json.Decoder) error { *o = RangeOrEditRangeWithInsertReplace{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "start", "insert") { case 0: // start o.Range = new(Range) return json.Unmarshal(data, o.Range) case 1: // insert o.EditRangeWithInsertReplace = new(EditRangeWithInsertReplace) return json.Unmarshal(data, o.EditRangeWithInsertReplace) } return errInvalidValue("RangeOrEditRangeWithInsertReplace", data) } type BooleanOrSaveOptions struct { Boolean *bool SaveOptions *SaveOptions } var _ json.MarshalerTo = (*BooleanOrSaveOptions)(nil) func (o *BooleanOrSaveOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrSaveOptions", false) } var _ json.UnmarshalerFrom = (*BooleanOrSaveOptions)(nil) func (o *BooleanOrSaveOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrSaveOptions{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.SaveOptions = new(SaveOptions) return json.UnmarshalDecode(dec, o.SaveOptions) default: return errInvalidKind("BooleanOrSaveOptions", dec.PeekKind()) } } type TextDocumentContentOptionsOrRegistrationOptions struct { Options *TextDocumentContentOptions RegistrationOptions *TextDocumentContentRegistrationOptions } var _ json.MarshalerTo = (*TextDocumentContentOptionsOrRegistrationOptions)(nil) func (o *TextDocumentContentOptionsOrRegistrationOptions) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextDocumentContentOptionsOrRegistrationOptions", false) } var _ json.UnmarshalerFrom = (*TextDocumentContentOptionsOrRegistrationOptions)(nil) func (o *TextDocumentContentOptionsOrRegistrationOptions) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextDocumentContentOptionsOrRegistrationOptions{} data, err := dec.ReadValue() if err != nil { return err } var vOptions TextDocumentContentOptions if err := json.Unmarshal(data, &vOptions); err == nil { o.Options = &vOptions return nil } var vRegistrationOptions TextDocumentContentRegistrationOptions if err := json.Unmarshal(data, &vRegistrationOptions); err == nil { o.RegistrationOptions = &vRegistrationOptions return nil } return errInvalidValue("TextDocumentContentOptionsOrRegistrationOptions", data) } type StringOrTuple struct { String *string Tuple *[2]uint32 } var _ json.MarshalerTo = (*StringOrTuple)(nil) func (o *StringOrTuple) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrTuple", false) } var _ json.UnmarshalerFrom = (*StringOrTuple)(nil) func (o *StringOrTuple) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrTuple{} switch dec.PeekKind() { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '[': o.Tuple = new([2]uint32) return json.UnmarshalDecode(dec, o.Tuple) default: return errInvalidKind("StringOrTuple", dec.PeekKind()) } } type StringOrBoolean struct { String *string Boolean *bool } var _ json.MarshalerTo = (*StringOrBoolean)(nil) func (o *StringOrBoolean) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrBoolean", false) } var _ json.UnmarshalerFrom = (*StringOrBoolean)(nil) func (o *StringOrBoolean) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrBoolean{} switch kind := dec.PeekKind(); kind { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err default: return errInvalidKind("StringOrBoolean", dec.PeekKind()) } } type WorkspaceFolderOrURI struct { WorkspaceFolder *WorkspaceFolder URI *URI } var _ json.MarshalerTo = (*WorkspaceFolderOrURI)(nil) func (o *WorkspaceFolderOrURI) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "WorkspaceFolderOrURI", false) } var _ json.UnmarshalerFrom = (*WorkspaceFolderOrURI)(nil) func (o *WorkspaceFolderOrURI) UnmarshalJSONFrom(dec *json.Decoder) error { *o = WorkspaceFolderOrURI{} switch dec.PeekKind() { case '{': o.WorkspaceFolder = new(WorkspaceFolder) return json.UnmarshalDecode(dec, o.WorkspaceFolder) case '"': o.URI = new(URI) return json.UnmarshalDecode(dec, o.URI) default: return errInvalidKind("WorkspaceFolderOrURI", dec.PeekKind()) } } type BooleanOrClientSemanticTokensRequestFullDelta struct { Boolean *bool ClientSemanticTokensRequestFullDelta *ClientSemanticTokensRequestFullDelta } var _ json.MarshalerTo = (*BooleanOrClientSemanticTokensRequestFullDelta)(nil) func (o *BooleanOrClientSemanticTokensRequestFullDelta) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "BooleanOrClientSemanticTokensRequestFullDelta", false) } var _ json.UnmarshalerFrom = (*BooleanOrClientSemanticTokensRequestFullDelta)(nil) func (o *BooleanOrClientSemanticTokensRequestFullDelta) UnmarshalJSONFrom(dec *json.Decoder) error { *o = BooleanOrClientSemanticTokensRequestFullDelta{} switch kind := dec.PeekKind(); kind { case 't', 'f': o.Boolean = new(kind == 't') _, err := dec.ReadToken() return err case '{': o.ClientSemanticTokensRequestFullDelta = new(ClientSemanticTokensRequestFullDelta) return json.UnmarshalDecode(dec, o.ClientSemanticTokensRequestFullDelta) default: return errInvalidKind("BooleanOrClientSemanticTokensRequestFullDelta", dec.PeekKind()) } } type LocationOrLocationsOrDefinitionLinksOrNull struct { Location *Location Locations *[]Location DefinitionLinks *[]*LocationLink } var _ json.MarshalerTo = (*LocationOrLocationsOrDefinitionLinksOrNull)(nil) func (o *LocationOrLocationsOrDefinitionLinksOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "LocationOrLocationsOrDefinitionLinksOrNull", true) } var _ json.UnmarshalerFrom = (*LocationOrLocationsOrDefinitionLinksOrNull)(nil) func (o *LocationOrLocationsOrDefinitionLinksOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = LocationOrLocationsOrDefinitionLinksOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.Location = new(Location) return json.UnmarshalDecode(dec, o.Location) case '[': data, err := dec.ReadValue() if err != nil { return err } var vLocations []Location if err := json.Unmarshal(data, &vLocations); err == nil { o.Locations = &vLocations return nil } var vDefinitionLinks []*LocationLink if err := json.Unmarshal(data, &vDefinitionLinks); err == nil { o.DefinitionLinks = &vDefinitionLinks return nil } return errInvalidValue("LocationOrLocationsOrDefinitionLinksOrNull", data) default: return errInvalidKind("LocationOrLocationsOrDefinitionLinksOrNull", dec.PeekKind()) } } func (o LocationOrLocationsOrDefinitionLinksOrNull) GetLocations() *[]Location { return o.Locations } type FoldingRangesOrNull struct { FoldingRanges *[]*FoldingRange } var _ json.MarshalerTo = (*FoldingRangesOrNull)(nil) func (o *FoldingRangesOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "FoldingRangesOrNull", true) } var _ json.UnmarshalerFrom = (*FoldingRangesOrNull)(nil) func (o *FoldingRangesOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = FoldingRangesOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.FoldingRanges = new([]*FoldingRange) return json.UnmarshalDecode(dec, o.FoldingRanges) default: return errInvalidKind("FoldingRangesOrNull", dec.PeekKind()) } } type LocationOrLocationsOrDeclarationLinksOrNull struct { Location *Location Locations *[]Location DeclarationLinks *[]*LocationLink } var _ json.MarshalerTo = (*LocationOrLocationsOrDeclarationLinksOrNull)(nil) func (o *LocationOrLocationsOrDeclarationLinksOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "LocationOrLocationsOrDeclarationLinksOrNull", true) } var _ json.UnmarshalerFrom = (*LocationOrLocationsOrDeclarationLinksOrNull)(nil) func (o *LocationOrLocationsOrDeclarationLinksOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = LocationOrLocationsOrDeclarationLinksOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.Location = new(Location) return json.UnmarshalDecode(dec, o.Location) case '[': data, err := dec.ReadValue() if err != nil { return err } var vLocations []Location if err := json.Unmarshal(data, &vLocations); err == nil { o.Locations = &vLocations return nil } var vDeclarationLinks []*LocationLink if err := json.Unmarshal(data, &vDeclarationLinks); err == nil { o.DeclarationLinks = &vDeclarationLinks return nil } return errInvalidValue("LocationOrLocationsOrDeclarationLinksOrNull", data) default: return errInvalidKind("LocationOrLocationsOrDeclarationLinksOrNull", dec.PeekKind()) } } func (o LocationOrLocationsOrDeclarationLinksOrNull) GetLocations() *[]Location { return o.Locations } type SelectionRangesOrNull struct { SelectionRanges *[]*SelectionRange } var _ json.MarshalerTo = (*SelectionRangesOrNull)(nil) func (o *SelectionRangesOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SelectionRangesOrNull", true) } var _ json.UnmarshalerFrom = (*SelectionRangesOrNull)(nil) func (o *SelectionRangesOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SelectionRangesOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.SelectionRanges = new([]*SelectionRange) return json.UnmarshalDecode(dec, o.SelectionRanges) default: return errInvalidKind("SelectionRangesOrNull", dec.PeekKind()) } } type CallHierarchyItemsOrNull struct { CallHierarchyItems *[]*CallHierarchyItem } var _ json.MarshalerTo = (*CallHierarchyItemsOrNull)(nil) func (o *CallHierarchyItemsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CallHierarchyItemsOrNull", true) } var _ json.UnmarshalerFrom = (*CallHierarchyItemsOrNull)(nil) func (o *CallHierarchyItemsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CallHierarchyItemsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.CallHierarchyItems = new([]*CallHierarchyItem) return json.UnmarshalDecode(dec, o.CallHierarchyItems) default: return errInvalidKind("CallHierarchyItemsOrNull", dec.PeekKind()) } } type CallHierarchyIncomingCallsOrNull struct { CallHierarchyIncomingCalls *[]*CallHierarchyIncomingCall } var _ json.MarshalerTo = (*CallHierarchyIncomingCallsOrNull)(nil) func (o *CallHierarchyIncomingCallsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CallHierarchyIncomingCallsOrNull", true) } var _ json.UnmarshalerFrom = (*CallHierarchyIncomingCallsOrNull)(nil) func (o *CallHierarchyIncomingCallsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CallHierarchyIncomingCallsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.CallHierarchyIncomingCalls = new([]*CallHierarchyIncomingCall) return json.UnmarshalDecode(dec, o.CallHierarchyIncomingCalls) default: return errInvalidKind("CallHierarchyIncomingCallsOrNull", dec.PeekKind()) } } type CallHierarchyOutgoingCallsOrNull struct { CallHierarchyOutgoingCalls *[]*CallHierarchyOutgoingCall } var _ json.MarshalerTo = (*CallHierarchyOutgoingCallsOrNull)(nil) func (o *CallHierarchyOutgoingCallsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CallHierarchyOutgoingCallsOrNull", true) } var _ json.UnmarshalerFrom = (*CallHierarchyOutgoingCallsOrNull)(nil) func (o *CallHierarchyOutgoingCallsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CallHierarchyOutgoingCallsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.CallHierarchyOutgoingCalls = new([]*CallHierarchyOutgoingCall) return json.UnmarshalDecode(dec, o.CallHierarchyOutgoingCalls) default: return errInvalidKind("CallHierarchyOutgoingCallsOrNull", dec.PeekKind()) } } type SemanticTokensOrNull struct { SemanticTokens *SemanticTokens } var _ json.MarshalerTo = (*SemanticTokensOrNull)(nil) func (o *SemanticTokensOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SemanticTokensOrNull", true) } var _ json.UnmarshalerFrom = (*SemanticTokensOrNull)(nil) func (o *SemanticTokensOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SemanticTokensOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.SemanticTokens = new(SemanticTokens) return json.UnmarshalDecode(dec, o.SemanticTokens) default: return errInvalidKind("SemanticTokensOrNull", dec.PeekKind()) } } type SemanticTokensOrSemanticTokensDeltaOrNull struct { SemanticTokens *SemanticTokens SemanticTokensDelta *SemanticTokensDelta } var _ json.MarshalerTo = (*SemanticTokensOrSemanticTokensDeltaOrNull)(nil) func (o *SemanticTokensOrSemanticTokensDeltaOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SemanticTokensOrSemanticTokensDeltaOrNull", true) } var _ json.UnmarshalerFrom = (*SemanticTokensOrSemanticTokensDeltaOrNull)(nil) func (o *SemanticTokensOrSemanticTokensDeltaOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SemanticTokensOrSemanticTokensDeltaOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "data", "edits") { case 0: // data o.SemanticTokens = new(SemanticTokens) return json.Unmarshal(data, o.SemanticTokens) case 1: // edits o.SemanticTokensDelta = new(SemanticTokensDelta) return json.Unmarshal(data, o.SemanticTokensDelta) } return errInvalidValue("SemanticTokensOrSemanticTokensDeltaOrNull", data) default: return errInvalidKind("SemanticTokensOrSemanticTokensDeltaOrNull", dec.PeekKind()) } } type LinkedEditingRangesOrNull struct { LinkedEditingRanges *LinkedEditingRanges } var _ json.MarshalerTo = (*LinkedEditingRangesOrNull)(nil) func (o *LinkedEditingRangesOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "LinkedEditingRangesOrNull", true) } var _ json.UnmarshalerFrom = (*LinkedEditingRangesOrNull)(nil) func (o *LinkedEditingRangesOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = LinkedEditingRangesOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.LinkedEditingRanges = new(LinkedEditingRanges) return json.UnmarshalDecode(dec, o.LinkedEditingRanges) default: return errInvalidKind("LinkedEditingRangesOrNull", dec.PeekKind()) } } type WorkspaceEditOrNull struct { WorkspaceEdit *WorkspaceEdit } var _ json.MarshalerTo = (*WorkspaceEditOrNull)(nil) func (o *WorkspaceEditOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "WorkspaceEditOrNull", true) } var _ json.UnmarshalerFrom = (*WorkspaceEditOrNull)(nil) func (o *WorkspaceEditOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = WorkspaceEditOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.WorkspaceEdit = new(WorkspaceEdit) return json.UnmarshalDecode(dec, o.WorkspaceEdit) default: return errInvalidKind("WorkspaceEditOrNull", dec.PeekKind()) } } type MonikersOrNull struct { Monikers *[]*Moniker } var _ json.MarshalerTo = (*MonikersOrNull)(nil) func (o *MonikersOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "MonikersOrNull", true) } var _ json.UnmarshalerFrom = (*MonikersOrNull)(nil) func (o *MonikersOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = MonikersOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.Monikers = new([]*Moniker) return json.UnmarshalDecode(dec, o.Monikers) default: return errInvalidKind("MonikersOrNull", dec.PeekKind()) } } type TypeHierarchyItemsOrNull struct { TypeHierarchyItems *[]*TypeHierarchyItem } var _ json.MarshalerTo = (*TypeHierarchyItemsOrNull)(nil) func (o *TypeHierarchyItemsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TypeHierarchyItemsOrNull", true) } var _ json.UnmarshalerFrom = (*TypeHierarchyItemsOrNull)(nil) func (o *TypeHierarchyItemsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TypeHierarchyItemsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.TypeHierarchyItems = new([]*TypeHierarchyItem) return json.UnmarshalDecode(dec, o.TypeHierarchyItems) default: return errInvalidKind("TypeHierarchyItemsOrNull", dec.PeekKind()) } } type InlineValuesOrNull struct { InlineValues *[]InlineValueTextOrVariableLookupOrEvaluatableExpression } var _ json.MarshalerTo = (*InlineValuesOrNull)(nil) func (o *InlineValuesOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "InlineValuesOrNull", true) } var _ json.UnmarshalerFrom = (*InlineValuesOrNull)(nil) func (o *InlineValuesOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = InlineValuesOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.InlineValues = new([]InlineValueTextOrVariableLookupOrEvaluatableExpression) return json.UnmarshalDecode(dec, o.InlineValues) default: return errInvalidKind("InlineValuesOrNull", dec.PeekKind()) } } type InlayHintsOrNull struct { InlayHints *[]*InlayHint } var _ json.MarshalerTo = (*InlayHintsOrNull)(nil) func (o *InlayHintsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "InlayHintsOrNull", true) } var _ json.UnmarshalerFrom = (*InlayHintsOrNull)(nil) func (o *InlayHintsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = InlayHintsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.InlayHints = new([]*InlayHint) return json.UnmarshalDecode(dec, o.InlayHints) default: return errInvalidKind("InlayHintsOrNull", dec.PeekKind()) } } type RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport struct { FullDocumentDiagnosticReport *RelatedFullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport *RelatedUnchangedDocumentDiagnosticReport } var _ json.MarshalerTo = (*RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport)(nil) func (o *RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport", false) } var _ json.UnmarshalerFrom = (*RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport)(nil) func (o *RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport) UnmarshalJSONFrom(dec *json.Decoder) error { *o = RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport{} data, err := dec.ReadValue() if err != nil { return err } switch string(jsonObjectRawField(data, "kind")) { case `"full"`: o.FullDocumentDiagnosticReport = new(RelatedFullDocumentDiagnosticReport) return json.Unmarshal(data, o.FullDocumentDiagnosticReport) case `"unchanged"`: o.UnchangedDocumentDiagnosticReport = new(RelatedUnchangedDocumentDiagnosticReport) return json.Unmarshal(data, o.UnchangedDocumentDiagnosticReport) } return errInvalidValue("RelatedFullDocumentDiagnosticReportOrUnchangedDocumentDiagnosticReport", data) } type InlineCompletionListOrItemsOrNull struct { List *InlineCompletionList Items *[]*InlineCompletionItem } var _ json.MarshalerTo = (*InlineCompletionListOrItemsOrNull)(nil) func (o *InlineCompletionListOrItemsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "InlineCompletionListOrItemsOrNull", true) } var _ json.UnmarshalerFrom = (*InlineCompletionListOrItemsOrNull)(nil) func (o *InlineCompletionListOrItemsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = InlineCompletionListOrItemsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.List = new(InlineCompletionList) return json.UnmarshalDecode(dec, o.List) case '[': o.Items = new([]*InlineCompletionItem) return json.UnmarshalDecode(dec, o.Items) default: return errInvalidKind("InlineCompletionListOrItemsOrNull", dec.PeekKind()) } } type MessageActionItemOrNull struct { MessageActionItem *MessageActionItem } var _ json.MarshalerTo = (*MessageActionItemOrNull)(nil) func (o *MessageActionItemOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "MessageActionItemOrNull", true) } var _ json.UnmarshalerFrom = (*MessageActionItemOrNull)(nil) func (o *MessageActionItemOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = MessageActionItemOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.MessageActionItem = new(MessageActionItem) return json.UnmarshalDecode(dec, o.MessageActionItem) default: return errInvalidKind("MessageActionItemOrNull", dec.PeekKind()) } } type TextEditsOrNull struct { TextEdits *[]*TextEdit } var _ json.MarshalerTo = (*TextEditsOrNull)(nil) func (o *TextEditsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextEditsOrNull", true) } var _ json.UnmarshalerFrom = (*TextEditsOrNull)(nil) func (o *TextEditsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextEditsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.TextEdits = new([]*TextEdit) return json.UnmarshalDecode(dec, o.TextEdits) default: return errInvalidKind("TextEditsOrNull", dec.PeekKind()) } } type CompletionItemsOrListOrNull struct { Items *[]*CompletionItem List *CompletionList } var _ json.MarshalerTo = (*CompletionItemsOrListOrNull)(nil) func (o *CompletionItemsOrListOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CompletionItemsOrListOrNull", true) } var _ json.UnmarshalerFrom = (*CompletionItemsOrListOrNull)(nil) func (o *CompletionItemsOrListOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CompletionItemsOrListOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.Items = new([]*CompletionItem) return json.UnmarshalDecode(dec, o.Items) case '{': o.List = new(CompletionList) return json.UnmarshalDecode(dec, o.List) default: return errInvalidKind("CompletionItemsOrListOrNull", dec.PeekKind()) } } type HoverOrNull struct { Hover *Hover } var _ json.MarshalerTo = (*HoverOrNull)(nil) func (o *HoverOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "HoverOrNull", true) } var _ json.UnmarshalerFrom = (*HoverOrNull)(nil) func (o *HoverOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = HoverOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.Hover = new(Hover) return json.UnmarshalDecode(dec, o.Hover) default: return errInvalidKind("HoverOrNull", dec.PeekKind()) } } type SignatureHelpOrNull struct { SignatureHelp *SignatureHelp } var _ json.MarshalerTo = (*SignatureHelpOrNull)(nil) func (o *SignatureHelpOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SignatureHelpOrNull", true) } var _ json.UnmarshalerFrom = (*SignatureHelpOrNull)(nil) func (o *SignatureHelpOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SignatureHelpOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.SignatureHelp = new(SignatureHelp) return json.UnmarshalDecode(dec, o.SignatureHelp) default: return errInvalidKind("SignatureHelpOrNull", dec.PeekKind()) } } type LocationsOrNull struct { Locations *[]Location } var _ json.MarshalerTo = (*LocationsOrNull)(nil) func (o *LocationsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "LocationsOrNull", true) } var _ json.UnmarshalerFrom = (*LocationsOrNull)(nil) func (o *LocationsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = LocationsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.Locations = new([]Location) return json.UnmarshalDecode(dec, o.Locations) default: return errInvalidKind("LocationsOrNull", dec.PeekKind()) } } func (o LocationsOrNull) GetLocations() *[]Location { return o.Locations } type DocumentHighlightsOrNull struct { DocumentHighlights *[]*DocumentHighlight } var _ json.MarshalerTo = (*DocumentHighlightsOrNull)(nil) func (o *DocumentHighlightsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "DocumentHighlightsOrNull", true) } var _ json.UnmarshalerFrom = (*DocumentHighlightsOrNull)(nil) func (o *DocumentHighlightsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = DocumentHighlightsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.DocumentHighlights = new([]*DocumentHighlight) return json.UnmarshalDecode(dec, o.DocumentHighlights) default: return errInvalidKind("DocumentHighlightsOrNull", dec.PeekKind()) } } type SymbolInformationsOrDocumentSymbolsOrNull struct { SymbolInformations *[]*SymbolInformation DocumentSymbols *[]*DocumentSymbol } var _ json.MarshalerTo = (*SymbolInformationsOrDocumentSymbolsOrNull)(nil) func (o *SymbolInformationsOrDocumentSymbolsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SymbolInformationsOrDocumentSymbolsOrNull", true) } var _ json.UnmarshalerFrom = (*SymbolInformationsOrDocumentSymbolsOrNull)(nil) func (o *SymbolInformationsOrDocumentSymbolsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SymbolInformationsOrDocumentSymbolsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': data, err := dec.ReadValue() if err != nil { return err } var vSymbolInformations []*SymbolInformation if err := json.Unmarshal(data, &vSymbolInformations); err == nil { o.SymbolInformations = &vSymbolInformations return nil } var vDocumentSymbols []*DocumentSymbol if err := json.Unmarshal(data, &vDocumentSymbols); err == nil { o.DocumentSymbols = &vDocumentSymbols return nil } return errInvalidValue("SymbolInformationsOrDocumentSymbolsOrNull", data) default: return errInvalidKind("SymbolInformationsOrDocumentSymbolsOrNull", dec.PeekKind()) } } type CommandOrCodeAction struct { Command *Command CodeAction *CodeAction } var _ json.MarshalerTo = (*CommandOrCodeAction)(nil) func (o *CommandOrCodeAction) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CommandOrCodeAction", false) } var _ json.UnmarshalerFrom = (*CommandOrCodeAction)(nil) func (o *CommandOrCodeAction) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CommandOrCodeAction{} data, err := dec.ReadValue() if err != nil { return err } var vCommand Command if err := json.Unmarshal(data, &vCommand); err == nil { o.Command = &vCommand return nil } var vCodeAction CodeAction if err := json.Unmarshal(data, &vCodeAction); err == nil { o.CodeAction = &vCodeAction return nil } return errInvalidValue("CommandOrCodeAction", data) } type CommandOrCodeActionArrayOrNull struct { CommandOrCodeActionArray *[]CommandOrCodeAction } var _ json.MarshalerTo = (*CommandOrCodeActionArrayOrNull)(nil) func (o *CommandOrCodeActionArrayOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CommandOrCodeActionArrayOrNull", true) } var _ json.UnmarshalerFrom = (*CommandOrCodeActionArrayOrNull)(nil) func (o *CommandOrCodeActionArrayOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CommandOrCodeActionArrayOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.CommandOrCodeActionArray = new([]CommandOrCodeAction) return json.UnmarshalDecode(dec, o.CommandOrCodeActionArray) default: return errInvalidKind("CommandOrCodeActionArrayOrNull", dec.PeekKind()) } } type SymbolInformationsOrWorkspaceSymbolsOrNull struct { SymbolInformations *[]*SymbolInformation WorkspaceSymbols *[]*WorkspaceSymbol } var _ json.MarshalerTo = (*SymbolInformationsOrWorkspaceSymbolsOrNull)(nil) func (o *SymbolInformationsOrWorkspaceSymbolsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "SymbolInformationsOrWorkspaceSymbolsOrNull", true) } var _ json.UnmarshalerFrom = (*SymbolInformationsOrWorkspaceSymbolsOrNull)(nil) func (o *SymbolInformationsOrWorkspaceSymbolsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = SymbolInformationsOrWorkspaceSymbolsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': data, err := dec.ReadValue() if err != nil { return err } var vSymbolInformations []*SymbolInformation if err := json.Unmarshal(data, &vSymbolInformations); err == nil { o.SymbolInformations = &vSymbolInformations return nil } var vWorkspaceSymbols []*WorkspaceSymbol if err := json.Unmarshal(data, &vWorkspaceSymbols); err == nil { o.WorkspaceSymbols = &vWorkspaceSymbols return nil } return errInvalidValue("SymbolInformationsOrWorkspaceSymbolsOrNull", data) default: return errInvalidKind("SymbolInformationsOrWorkspaceSymbolsOrNull", dec.PeekKind()) } } type CodeLensesOrNull struct { CodeLenses *[]*CodeLens } var _ json.MarshalerTo = (*CodeLensesOrNull)(nil) func (o *CodeLensesOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "CodeLensesOrNull", true) } var _ json.UnmarshalerFrom = (*CodeLensesOrNull)(nil) func (o *CodeLensesOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = CodeLensesOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.CodeLenses = new([]*CodeLens) return json.UnmarshalDecode(dec, o.CodeLenses) default: return errInvalidKind("CodeLensesOrNull", dec.PeekKind()) } } type DocumentLinksOrNull struct { DocumentLinks *[]*DocumentLink } var _ json.MarshalerTo = (*DocumentLinksOrNull)(nil) func (o *DocumentLinksOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "DocumentLinksOrNull", true) } var _ json.UnmarshalerFrom = (*DocumentLinksOrNull)(nil) func (o *DocumentLinksOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = DocumentLinksOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.DocumentLinks = new([]*DocumentLink) return json.UnmarshalDecode(dec, o.DocumentLinks) default: return errInvalidKind("DocumentLinksOrNull", dec.PeekKind()) } } type RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull struct { Range *Range PrepareRenamePlaceholder *PrepareRenamePlaceholder PrepareRenameDefaultBehavior *PrepareRenameDefaultBehavior } var _ json.MarshalerTo = (*RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull)(nil) func (o *RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull", true) } var _ json.UnmarshalerFrom = (*RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull)(nil) func (o *RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "start", "range", "defaultBehavior") { case 0: // start o.Range = new(Range) return json.Unmarshal(data, o.Range) case 1: // range o.PrepareRenamePlaceholder = new(PrepareRenamePlaceholder) return json.Unmarshal(data, o.PrepareRenamePlaceholder) case 2: // defaultBehavior o.PrepareRenameDefaultBehavior = new(PrepareRenameDefaultBehavior) return json.Unmarshal(data, o.PrepareRenameDefaultBehavior) } return errInvalidValue("RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull", data) default: return errInvalidKind("RangeOrPrepareRenamePlaceholderOrPrepareRenameDefaultBehaviorOrNull", dec.PeekKind()) } } type LSPAnyOrNull struct { LSPAny *any } var _ json.MarshalerTo = (*LSPAnyOrNull)(nil) func (o *LSPAnyOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "LSPAnyOrNull", true) } var _ json.UnmarshalerFrom = (*LSPAnyOrNull)(nil) func (o *LSPAnyOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = LSPAnyOrNull{} data, err := dec.ReadValue() if err != nil { return err } if string(data) == "null" { return nil } var vLSPAny any if err := json.Unmarshal(data, &vLSPAny); err == nil { o.LSPAny = &vLSPAny return nil } return errInvalidValue("LSPAnyOrNull", data) } type MultiDocumentHighlightsOrNull struct { MultiDocumentHighlights *[]*MultiDocumentHighlight } var _ json.MarshalerTo = (*MultiDocumentHighlightsOrNull)(nil) func (o *MultiDocumentHighlightsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "MultiDocumentHighlightsOrNull", true) } var _ json.UnmarshalerFrom = (*MultiDocumentHighlightsOrNull)(nil) func (o *MultiDocumentHighlightsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = MultiDocumentHighlightsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.MultiDocumentHighlights = new([]*MultiDocumentHighlight) return json.UnmarshalDecode(dec, o.MultiDocumentHighlights) default: return errInvalidKind("MultiDocumentHighlightsOrNull", dec.PeekKind()) } } type VSOnAutoInsertResponseItemOrNull struct { VSOnAutoInsertResponseItem *VSOnAutoInsertResponseItem } var _ json.MarshalerTo = (*VSOnAutoInsertResponseItemOrNull)(nil) func (o *VSOnAutoInsertResponseItemOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "VSOnAutoInsertResponseItemOrNull", true) } var _ json.UnmarshalerFrom = (*VSOnAutoInsertResponseItemOrNull)(nil) func (o *VSOnAutoInsertResponseItemOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = VSOnAutoInsertResponseItemOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': o.VSOnAutoInsertResponseItem = new(VSOnAutoInsertResponseItem) return json.UnmarshalDecode(dec, o.VSOnAutoInsertResponseItem) default: return errInvalidKind("VSOnAutoInsertResponseItemOrNull", dec.PeekKind()) } } type VSReferenceItemsOrNull struct { VSReferenceItems *[]*VSReferenceItem } var _ json.MarshalerTo = (*VSReferenceItemsOrNull)(nil) func (o *VSReferenceItemsOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "VSReferenceItemsOrNull", true) } var _ json.UnmarshalerFrom = (*VSReferenceItemsOrNull)(nil) func (o *VSReferenceItemsOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = VSReferenceItemsOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '[': o.VSReferenceItems = new([]*VSReferenceItem) return json.UnmarshalDecode(dec, o.VSReferenceItems) default: return errInvalidKind("VSReferenceItemsOrNull", dec.PeekKind()) } } type RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull struct { RequestFailureTelemetryEvent *RequestFailureTelemetryEvent PerformanceStatsTelemetryEvent *PerformanceStatsTelemetryEvent ProjectInfoTelemetryEvent *ProjectInfoTelemetryEvent } var _ json.MarshalerTo = (*RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull)(nil) func (o *RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull", true) } var _ json.UnmarshalerFrom = (*RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull)(nil) func (o *RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull) UnmarshalJSONFrom(dec *json.Decoder) error { *o = RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull{} switch dec.PeekKind() { case 'n': _, err := dec.ReadToken() return err case '{': data, err := dec.ReadValue() if err != nil { return err } switch string(jsonObjectRawField(data, "eventName")) { case `"languageServer.projectInfo"`: o.ProjectInfoTelemetryEvent = new(ProjectInfoTelemetryEvent) return json.Unmarshal(data, o.ProjectInfoTelemetryEvent) case `"languageServer.errorResponse"`: o.RequestFailureTelemetryEvent = new(RequestFailureTelemetryEvent) return json.Unmarshal(data, o.RequestFailureTelemetryEvent) case `"languageServer.performanceStats"`: o.PerformanceStatsTelemetryEvent = new(PerformanceStatsTelemetryEvent) return json.Unmarshal(data, o.PerformanceStatsTelemetryEvent) } return errInvalidValue("RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull", data) default: return errInvalidKind("RequestFailureTelemetryEventOrPerformanceStatsTelemetryEventOrProjectInfoTelemetryEventOrNull", dec.PeekKind()) } } type TextDocumentFilterLanguageOrSchemeOrPattern struct { Language *TextDocumentFilterLanguage Scheme *TextDocumentFilterScheme Pattern *TextDocumentFilterPattern } var _ json.MarshalerTo = (*TextDocumentFilterLanguageOrSchemeOrPattern)(nil) func (o *TextDocumentFilterLanguageOrSchemeOrPattern) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "TextDocumentFilterLanguageOrSchemeOrPattern", false) } var _ json.UnmarshalerFrom = (*TextDocumentFilterLanguageOrSchemeOrPattern)(nil) func (o *TextDocumentFilterLanguageOrSchemeOrPattern) UnmarshalJSONFrom(dec *json.Decoder) error { *o = TextDocumentFilterLanguageOrSchemeOrPattern{} data, err := dec.ReadValue() if err != nil { return err } var vLanguage TextDocumentFilterLanguage if err := json.Unmarshal(data, &vLanguage); err == nil { o.Language = &vLanguage return nil } var vScheme TextDocumentFilterScheme if err := json.Unmarshal(data, &vScheme); err == nil { o.Scheme = &vScheme return nil } var vPattern TextDocumentFilterPattern if err := json.Unmarshal(data, &vPattern); err == nil { o.Pattern = &vPattern return nil } return errInvalidValue("TextDocumentFilterLanguageOrSchemeOrPattern", data) } type StringOrMarkedStringWithLanguage struct { String *string MarkedStringWithLanguage *MarkedStringWithLanguage } var _ json.MarshalerTo = (*StringOrMarkedStringWithLanguage)(nil) func (o *StringOrMarkedStringWithLanguage) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "StringOrMarkedStringWithLanguage", false) } var _ json.UnmarshalerFrom = (*StringOrMarkedStringWithLanguage)(nil) func (o *StringOrMarkedStringWithLanguage) UnmarshalJSONFrom(dec *json.Decoder) error { *o = StringOrMarkedStringWithLanguage{} switch dec.PeekKind() { case '"': o.String = new(string) return json.UnmarshalDecode(dec, o.String) case '{': o.MarkedStringWithLanguage = new(MarkedStringWithLanguage) return json.UnmarshalDecode(dec, o.MarkedStringWithLanguage) default: return errInvalidKind("StringOrMarkedStringWithLanguage", dec.PeekKind()) } } type InlineValueTextOrVariableLookupOrEvaluatableExpression struct { Text *InlineValueText VariableLookup *InlineValueVariableLookup EvaluatableExpression *InlineValueEvaluatableExpression } var _ json.MarshalerTo = (*InlineValueTextOrVariableLookupOrEvaluatableExpression)(nil) func (o *InlineValueTextOrVariableLookupOrEvaluatableExpression) MarshalJSONTo(enc *json.Encoder) error { return marshalUnion(o, enc, "InlineValueTextOrVariableLookupOrEvaluatableExpression", false) } var _ json.UnmarshalerFrom = (*InlineValueTextOrVariableLookupOrEvaluatableExpression)(nil) func (o *InlineValueTextOrVariableLookupOrEvaluatableExpression) UnmarshalJSONFrom(dec *json.Decoder) error { *o = InlineValueTextOrVariableLookupOrEvaluatableExpression{} data, err := dec.ReadValue() if err != nil { return err } switch jsonObjectHasKey(data, "text", "caseSensitiveLookup") { case 0: // text o.Text = new(InlineValueText) return json.Unmarshal(data, o.Text) case 1: // caseSensitiveLookup o.VariableLookup = new(InlineValueVariableLookup) return json.Unmarshal(data, o.VariableLookup) default: o.EvaluatableExpression = new(InlineValueEvaluatableExpression) return json.Unmarshal(data, o.EvaluatableExpression) } } // Literal types // StringLiteralBegin is a literal type for "begin" type StringLiteralBegin struct{} var _ json.MarshalerTo = StringLiteralBegin{} func (o StringLiteralBegin) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"begin"`)) } var _ json.UnmarshalerFrom = &StringLiteralBegin{} func (o *StringLiteralBegin) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"begin"` { return errLiteralMismatch("StringLiteralBegin", `"begin"`, v) } return nil } // StringLiteralReport is a literal type for "report" type StringLiteralReport struct{} var _ json.MarshalerTo = StringLiteralReport{} func (o StringLiteralReport) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"report"`)) } var _ json.UnmarshalerFrom = &StringLiteralReport{} func (o *StringLiteralReport) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"report"` { return errLiteralMismatch("StringLiteralReport", `"report"`, v) } return nil } // StringLiteralEnd is a literal type for "end" type StringLiteralEnd struct{} var _ json.MarshalerTo = StringLiteralEnd{} func (o StringLiteralEnd) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"end"`)) } var _ json.UnmarshalerFrom = &StringLiteralEnd{} func (o *StringLiteralEnd) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"end"` { return errLiteralMismatch("StringLiteralEnd", `"end"`, v) } return nil } // StringLiteralCreate is a literal type for "create" type StringLiteralCreate struct{} var _ json.MarshalerTo = StringLiteralCreate{} func (o StringLiteralCreate) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"create"`)) } var _ json.UnmarshalerFrom = &StringLiteralCreate{} func (o *StringLiteralCreate) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"create"` { return errLiteralMismatch("StringLiteralCreate", `"create"`, v) } return nil } // StringLiteralRename is a literal type for "rename" type StringLiteralRename struct{} var _ json.MarshalerTo = StringLiteralRename{} func (o StringLiteralRename) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"rename"`)) } var _ json.UnmarshalerFrom = &StringLiteralRename{} func (o *StringLiteralRename) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"rename"` { return errLiteralMismatch("StringLiteralRename", `"rename"`, v) } return nil } // StringLiteralDelete is a literal type for "delete" type StringLiteralDelete struct{} var _ json.MarshalerTo = StringLiteralDelete{} func (o StringLiteralDelete) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"delete"`)) } var _ json.UnmarshalerFrom = &StringLiteralDelete{} func (o *StringLiteralDelete) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"delete"` { return errLiteralMismatch("StringLiteralDelete", `"delete"`, v) } return nil } // StringLiteralFull is a literal type for "full" type StringLiteralFull struct{} var _ json.MarshalerTo = StringLiteralFull{} func (o StringLiteralFull) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"full"`)) } var _ json.UnmarshalerFrom = &StringLiteralFull{} func (o *StringLiteralFull) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"full"` { return errLiteralMismatch("StringLiteralFull", `"full"`, v) } return nil } // StringLiteralUnchanged is a literal type for "unchanged" type StringLiteralUnchanged struct{} var _ json.MarshalerTo = StringLiteralUnchanged{} func (o StringLiteralUnchanged) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"unchanged"`)) } var _ json.UnmarshalerFrom = &StringLiteralUnchanged{} func (o *StringLiteralUnchanged) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"unchanged"` { return errLiteralMismatch("StringLiteralUnchanged", `"unchanged"`, v) } return nil } // StringLiteralSnippet is a literal type for "snippet" type StringLiteralSnippet struct{} var _ json.MarshalerTo = StringLiteralSnippet{} func (o StringLiteralSnippet) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"snippet"`)) } var _ json.UnmarshalerFrom = &StringLiteralSnippet{} func (o *StringLiteralSnippet) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"snippet"` { return errLiteralMismatch("StringLiteralSnippet", `"snippet"`, v) } return nil } // StringLiteralLanguageServerErrorResponse is a literal type for "languageServer.errorResponse" type StringLiteralLanguageServerErrorResponse struct{} var _ json.MarshalerTo = StringLiteralLanguageServerErrorResponse{} func (o StringLiteralLanguageServerErrorResponse) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"languageServer.errorResponse"`)) } var _ json.UnmarshalerFrom = &StringLiteralLanguageServerErrorResponse{} func (o *StringLiteralLanguageServerErrorResponse) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"languageServer.errorResponse"` { return errLiteralMismatch("StringLiteralLanguageServerErrorResponse", `"languageServer.errorResponse"`, v) } return nil } // StringLiteralError is a literal type for "error" type StringLiteralError struct{} var _ json.MarshalerTo = StringLiteralError{} func (o StringLiteralError) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"error"`)) } var _ json.UnmarshalerFrom = &StringLiteralError{} func (o *StringLiteralError) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"error"` { return errLiteralMismatch("StringLiteralError", `"error"`, v) } return nil } // StringLiteralLanguageServerPerformanceStats is a literal type for "languageServer.performanceStats" type StringLiteralLanguageServerPerformanceStats struct{} var _ json.MarshalerTo = StringLiteralLanguageServerPerformanceStats{} func (o StringLiteralLanguageServerPerformanceStats) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"languageServer.performanceStats"`)) } var _ json.UnmarshalerFrom = &StringLiteralLanguageServerPerformanceStats{} func (o *StringLiteralLanguageServerPerformanceStats) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"languageServer.performanceStats"` { return errLiteralMismatch("StringLiteralLanguageServerPerformanceStats", `"languageServer.performanceStats"`, v) } return nil } // StringLiteralUsage is a literal type for "usage" type StringLiteralUsage struct{} var _ json.MarshalerTo = StringLiteralUsage{} func (o StringLiteralUsage) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"usage"`)) } var _ json.UnmarshalerFrom = &StringLiteralUsage{} func (o *StringLiteralUsage) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"usage"` { return errLiteralMismatch("StringLiteralUsage", `"usage"`, v) } return nil } // StringLiteralLanguageServerProjectInfo is a literal type for "languageServer.projectInfo" type StringLiteralLanguageServerProjectInfo struct{} var _ json.MarshalerTo = StringLiteralLanguageServerProjectInfo{} func (o StringLiteralLanguageServerProjectInfo) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"languageServer.projectInfo"`)) } var _ json.UnmarshalerFrom = &StringLiteralLanguageServerProjectInfo{} func (o *StringLiteralLanguageServerProjectInfo) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"languageServer.projectInfo"` { return errLiteralMismatch("StringLiteralLanguageServerProjectInfo", `"languageServer.projectInfo"`, v) } return nil } // StringLiteralClassifiedTextRun is a literal type for "ClassifiedTextRun" type StringLiteralClassifiedTextRun struct{} var _ json.MarshalerTo = StringLiteralClassifiedTextRun{} func (o StringLiteralClassifiedTextRun) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"ClassifiedTextRun"`)) } var _ json.UnmarshalerFrom = &StringLiteralClassifiedTextRun{} func (o *StringLiteralClassifiedTextRun) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"ClassifiedTextRun"` { return errLiteralMismatch("StringLiteralClassifiedTextRun", `"ClassifiedTextRun"`, v) } return nil } // StringLiteralClassifiedTextElement is a literal type for "ClassifiedTextElement" type StringLiteralClassifiedTextElement struct{} var _ json.MarshalerTo = StringLiteralClassifiedTextElement{} func (o StringLiteralClassifiedTextElement) MarshalJSONTo(enc *json.Encoder) error { return enc.WriteValue(json.Value(`"ClassifiedTextElement"`)) } var _ json.UnmarshalerFrom = &StringLiteralClassifiedTextElement{} func (o *StringLiteralClassifiedTextElement) UnmarshalJSONFrom(dec *json.Decoder) error { v, err := dec.ReadValue() if err != nil { return err } if string(v) != `"ClassifiedTextElement"` { return errLiteralMismatch("StringLiteralClassifiedTextElement", `"ClassifiedTextElement"`, v) } return nil } // Helper function for dereferencing pointers with zero value fallback func derefOr[T any](v *T) T { if v != nil { return *v } var zero T return zero } // ResolvedChangeAnnotationsSupportOptions is a resolved version of ChangeAnnotationsSupportOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedChangeAnnotationsSupportOptions struct { // Whether the client groups edits with equal labels into tree nodes, // for instance all edits labelled with "Changes in Strings" would // be a tree node. GroupsOnLabel bool `json:"groupsOnLabel,omitzero"` } func (v *ChangeAnnotationsSupportOptions) resolve() ResolvedChangeAnnotationsSupportOptions { if v == nil { return ResolvedChangeAnnotationsSupportOptions{} } return ResolvedChangeAnnotationsSupportOptions{ GroupsOnLabel: derefOr(v.GroupsOnLabel), } } // ResolvedWorkspaceEditClientCapabilities is a resolved version of WorkspaceEditClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedWorkspaceEditClientCapabilities struct { // The client supports versioned document changes in `WorkspaceEdit`s DocumentChanges bool `json:"documentChanges,omitzero"` // The resource operations the client supports. Clients should at least // support 'create', 'rename' and 'delete' files and folders. // // Since: 3.13.0 ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitzero"` // The failure handling strategy of a client if applying the workspace edit // fails. // // Since: 3.13.0 FailureHandling FailureHandlingKind `json:"failureHandling,omitzero"` // Whether the client normalizes line endings to the client specific // setting. // If set to `true` the client will normalize line ending characters // in a workspace edit to the client-specified new line // character. // // Since: 3.16.0 NormalizesLineEndings bool `json:"normalizesLineEndings,omitzero"` // Whether the client in general supports change annotations on text edits, // create file, rename file and delete file changes. // // Since: 3.16.0 ChangeAnnotationSupport ResolvedChangeAnnotationsSupportOptions `json:"changeAnnotationSupport,omitzero"` // Whether the client supports `WorkspaceEditMetadata` in `WorkspaceEdit`s. // // Since: 3.18.0 MetadataSupport bool `json:"metadataSupport,omitzero"` // Whether the client supports snippets as text edits. // // Since: 3.18.0 SnippetEditSupport bool `json:"snippetEditSupport,omitzero"` } func (v *WorkspaceEditClientCapabilities) resolve() ResolvedWorkspaceEditClientCapabilities { if v == nil { return ResolvedWorkspaceEditClientCapabilities{} } return ResolvedWorkspaceEditClientCapabilities{ DocumentChanges: derefOr(v.DocumentChanges), ResourceOperations: derefOr(v.ResourceOperations), FailureHandling: derefOr(v.FailureHandling), NormalizesLineEndings: derefOr(v.NormalizesLineEndings), ChangeAnnotationSupport: v.ChangeAnnotationSupport.resolve(), MetadataSupport: derefOr(v.MetadataSupport), SnippetEditSupport: derefOr(v.SnippetEditSupport), } } // ResolvedDidChangeConfigurationClientCapabilities is a resolved version of DidChangeConfigurationClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedDidChangeConfigurationClientCapabilities struct { // Did change configuration notification supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *DidChangeConfigurationClientCapabilities) resolve() ResolvedDidChangeConfigurationClientCapabilities { if v == nil { return ResolvedDidChangeConfigurationClientCapabilities{} } return ResolvedDidChangeConfigurationClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedDidChangeWatchedFilesClientCapabilities is a resolved version of DidChangeWatchedFilesClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedDidChangeWatchedFilesClientCapabilities struct { // Did change watched files notification supports dynamic registration. Please note // that the current protocol doesn't support static configuration for file changes // from the server side. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Whether the client has support for pattern // or not. // // Since: 3.17.0 RelativePatternSupport bool `json:"relativePatternSupport,omitzero"` } func (v *DidChangeWatchedFilesClientCapabilities) resolve() ResolvedDidChangeWatchedFilesClientCapabilities { if v == nil { return ResolvedDidChangeWatchedFilesClientCapabilities{} } return ResolvedDidChangeWatchedFilesClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), RelativePatternSupport: derefOr(v.RelativePatternSupport), } } // ResolvedClientSymbolKindOptions is a resolved version of ClientSymbolKindOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientSymbolKindOptions struct { // The symbol kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. // // If this property is not present the client only supports // the symbol kinds from `File` to `Array` as defined in // the initial version of the protocol. ValueSet []SymbolKind `json:"valueSet,omitzero"` } func (v *ClientSymbolKindOptions) resolve() ResolvedClientSymbolKindOptions { if v == nil { return ResolvedClientSymbolKindOptions{} } return ResolvedClientSymbolKindOptions{ ValueSet: derefOr(v.ValueSet), } } // ResolvedClientSymbolTagOptions is a resolved version of ClientSymbolTagOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientSymbolTagOptions struct { // The tags supported by the client. ValueSet []SymbolTag `json:"valueSet,omitzero"` } func (v *ClientSymbolTagOptions) resolve() ResolvedClientSymbolTagOptions { if v == nil { return ResolvedClientSymbolTagOptions{} } return ResolvedClientSymbolTagOptions{ ValueSet: v.ValueSet, } } // ResolvedClientSymbolResolveOptions is a resolved version of ClientSymbolResolveOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientSymbolResolveOptions struct { // The properties that a client can resolve lazily. Usually // `location.range` Properties []string `json:"properties,omitzero"` } func (v *ClientSymbolResolveOptions) resolve() ResolvedClientSymbolResolveOptions { if v == nil { return ResolvedClientSymbolResolveOptions{} } return ResolvedClientSymbolResolveOptions{ Properties: v.Properties, } } // ResolvedWorkspaceSymbolClientCapabilities is a resolved version of WorkspaceSymbolClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities for a WorkspaceSymbolRequest. type ResolvedWorkspaceSymbolClientCapabilities struct { // Symbol request supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. SymbolKind ResolvedClientSymbolKindOptions `json:"symbolKind,omitzero"` // The client supports tags on `SymbolInformation`. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.16.0 TagSupport ResolvedClientSymbolTagOptions `json:"tagSupport,omitzero"` // The client support partial workspace symbols. The client will send the // request `workspaceSymbol/resolve` to the server to resolve additional // properties. // // Since: 3.17.0 ResolveSupport ResolvedClientSymbolResolveOptions `json:"resolveSupport,omitzero"` } func (v *WorkspaceSymbolClientCapabilities) resolve() ResolvedWorkspaceSymbolClientCapabilities { if v == nil { return ResolvedWorkspaceSymbolClientCapabilities{} } return ResolvedWorkspaceSymbolClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), SymbolKind: v.SymbolKind.resolve(), TagSupport: v.TagSupport.resolve(), ResolveSupport: v.ResolveSupport.resolve(), } } // ResolvedExecuteCommandClientCapabilities is a resolved version of ExecuteCommandClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // The client capabilities of a ExecuteCommandRequest. type ResolvedExecuteCommandClientCapabilities struct { // Execute command supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *ExecuteCommandClientCapabilities) resolve() ResolvedExecuteCommandClientCapabilities { if v == nil { return ResolvedExecuteCommandClientCapabilities{} } return ResolvedExecuteCommandClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedSemanticTokensWorkspaceClientCapabilities is a resolved version of SemanticTokensWorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.16.0 type ResolvedSemanticTokensWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from // the server to the client. // // Note that this event is global and will force the client to refresh all // semantic tokens currently shown. It should be used with absolute care // and is useful for situation where a server for example detects a project // wide change that requires such a calculation. RefreshSupport bool `json:"refreshSupport,omitzero"` } func (v *SemanticTokensWorkspaceClientCapabilities) resolve() ResolvedSemanticTokensWorkspaceClientCapabilities { if v == nil { return ResolvedSemanticTokensWorkspaceClientCapabilities{} } return ResolvedSemanticTokensWorkspaceClientCapabilities{ RefreshSupport: derefOr(v.RefreshSupport), } } // ResolvedCodeLensWorkspaceClientCapabilities is a resolved version of CodeLensWorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.16.0 type ResolvedCodeLensWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from the // server to the client. // // Note that this event is global and will force the client to refresh all // code lenses currently shown. It should be used with absolute care and is // useful for situation where a server for example detect a project wide // change that requires such a calculation. RefreshSupport bool `json:"refreshSupport,omitzero"` } func (v *CodeLensWorkspaceClientCapabilities) resolve() ResolvedCodeLensWorkspaceClientCapabilities { if v == nil { return ResolvedCodeLensWorkspaceClientCapabilities{} } return ResolvedCodeLensWorkspaceClientCapabilities{ RefreshSupport: derefOr(v.RefreshSupport), } } // ResolvedFileOperationClientCapabilities is a resolved version of FileOperationClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Capabilities relating to events from file operations by the user in the client. // // These events do not come from the file system, they come from user operations // like renaming a file in the UI. // // Since: 3.16.0 type ResolvedFileOperationClientCapabilities struct { // Whether the client supports dynamic registration for file requests/notifications. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client has support for sending didCreateFiles notifications. DidCreate bool `json:"didCreate,omitzero"` // The client has support for sending willCreateFiles requests. WillCreate bool `json:"willCreate,omitzero"` // The client has support for sending didRenameFiles notifications. DidRename bool `json:"didRename,omitzero"` // The client has support for sending willRenameFiles requests. WillRename bool `json:"willRename,omitzero"` // The client has support for sending didDeleteFiles notifications. DidDelete bool `json:"didDelete,omitzero"` // The client has support for sending willDeleteFiles requests. WillDelete bool `json:"willDelete,omitzero"` } func (v *FileOperationClientCapabilities) resolve() ResolvedFileOperationClientCapabilities { if v == nil { return ResolvedFileOperationClientCapabilities{} } return ResolvedFileOperationClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), DidCreate: derefOr(v.DidCreate), WillCreate: derefOr(v.WillCreate), DidRename: derefOr(v.DidRename), WillRename: derefOr(v.WillRename), DidDelete: derefOr(v.DidDelete), WillDelete: derefOr(v.WillDelete), } } // ResolvedInlineValueWorkspaceClientCapabilities is a resolved version of InlineValueWorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client workspace capabilities specific to inline values. // // Since: 3.17.0 type ResolvedInlineValueWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from the // server to the client. // // Note that this event is global and will force the client to refresh all // inline values currently shown. It should be used with absolute care and is // useful for situation where a server for example detects a project wide // change that requires such a calculation. RefreshSupport bool `json:"refreshSupport,omitzero"` } func (v *InlineValueWorkspaceClientCapabilities) resolve() ResolvedInlineValueWorkspaceClientCapabilities { if v == nil { return ResolvedInlineValueWorkspaceClientCapabilities{} } return ResolvedInlineValueWorkspaceClientCapabilities{ RefreshSupport: derefOr(v.RefreshSupport), } } // ResolvedInlayHintWorkspaceClientCapabilities is a resolved version of InlayHintWorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client workspace capabilities specific to inlay hints. // // Since: 3.17.0 type ResolvedInlayHintWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from // the server to the client. // // Note that this event is global and will force the client to refresh all // inlay hints currently shown. It should be used with absolute care and // is useful for situation where a server for example detects a project wide // change that requires such a calculation. RefreshSupport bool `json:"refreshSupport,omitzero"` } func (v *InlayHintWorkspaceClientCapabilities) resolve() ResolvedInlayHintWorkspaceClientCapabilities { if v == nil { return ResolvedInlayHintWorkspaceClientCapabilities{} } return ResolvedInlayHintWorkspaceClientCapabilities{ RefreshSupport: derefOr(v.RefreshSupport), } } // ResolvedDiagnosticWorkspaceClientCapabilities is a resolved version of DiagnosticWorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Workspace client capabilities specific to diagnostic pull requests. // // Since: 3.17.0 type ResolvedDiagnosticWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from // the server to the client. // // Note that this event is global and will force the client to refresh all // pulled diagnostics currently shown. It should be used with absolute care and // is useful for situation where a server for example detects a project wide // change that requires such a calculation. RefreshSupport bool `json:"refreshSupport,omitzero"` } func (v *DiagnosticWorkspaceClientCapabilities) resolve() ResolvedDiagnosticWorkspaceClientCapabilities { if v == nil { return ResolvedDiagnosticWorkspaceClientCapabilities{} } return ResolvedDiagnosticWorkspaceClientCapabilities{ RefreshSupport: derefOr(v.RefreshSupport), } } // ResolvedFoldingRangeWorkspaceClientCapabilities is a resolved version of FoldingRangeWorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // # Client workspace capabilities specific to folding ranges // // Since: 3.18.0 type ResolvedFoldingRangeWorkspaceClientCapabilities struct { // Whether the client implementation supports a refresh request sent from the // server to the client. // // Note that this event is global and will force the client to refresh all // folding ranges currently shown. It should be used with absolute care and is // useful for situation where a server for example detects a project wide // change that requires such a calculation. // // Since: 3.18.0 RefreshSupport bool `json:"refreshSupport,omitzero"` } func (v *FoldingRangeWorkspaceClientCapabilities) resolve() ResolvedFoldingRangeWorkspaceClientCapabilities { if v == nil { return ResolvedFoldingRangeWorkspaceClientCapabilities{} } return ResolvedFoldingRangeWorkspaceClientCapabilities{ RefreshSupport: derefOr(v.RefreshSupport), } } // ResolvedTextDocumentContentClientCapabilities is a resolved version of TextDocumentContentClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities for a text document content provider. // // Since: 3.18.0 type ResolvedTextDocumentContentClientCapabilities struct { // Text document content provider supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *TextDocumentContentClientCapabilities) resolve() ResolvedTextDocumentContentClientCapabilities { if v == nil { return ResolvedTextDocumentContentClientCapabilities{} } return ResolvedTextDocumentContentClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedWorkspaceClientCapabilities is a resolved version of WorkspaceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Workspace specific client capabilities. type ResolvedWorkspaceClientCapabilities struct { // The client supports applying batch edits // to the workspace by supporting the request // 'workspace/applyEdit' ApplyEdit bool `json:"applyEdit,omitzero"` // Capabilities specific to `WorkspaceEdit`s. WorkspaceEdit ResolvedWorkspaceEditClientCapabilities `json:"workspaceEdit,omitzero"` // Capabilities specific to the `workspace/didChangeConfiguration` notification. DidChangeConfiguration ResolvedDidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitzero"` // Capabilities specific to the `workspace/didChangeWatchedFiles` notification. DidChangeWatchedFiles ResolvedDidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitzero"` // Capabilities specific to the `workspace/symbol` request. Symbol ResolvedWorkspaceSymbolClientCapabilities `json:"symbol,omitzero"` // Capabilities specific to the `workspace/executeCommand` request. ExecuteCommand ResolvedExecuteCommandClientCapabilities `json:"executeCommand,omitzero"` // The client has support for workspace folders. // // Since: 3.6.0 WorkspaceFolders bool `json:"workspaceFolders,omitzero"` // The client supports `workspace/configuration` requests. // // Since: 3.6.0 Configuration bool `json:"configuration,omitzero"` // Capabilities specific to the semantic token requests scoped to the // workspace. // // Since: 3.16.0. SemanticTokens ResolvedSemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitzero"` // Capabilities specific to the code lens requests scoped to the // workspace. // // Since: 3.16.0. CodeLens ResolvedCodeLensWorkspaceClientCapabilities `json:"codeLens,omitzero"` // The client has support for file notifications/requests for user operations on files. // // Since 3.16.0 FileOperations ResolvedFileOperationClientCapabilities `json:"fileOperations,omitzero"` // Capabilities specific to the inline values requests scoped to the // workspace. // // Since: 3.17.0. InlineValue ResolvedInlineValueWorkspaceClientCapabilities `json:"inlineValue,omitzero"` // Capabilities specific to the inlay hint requests scoped to the // workspace. // // Since: 3.17.0. InlayHint ResolvedInlayHintWorkspaceClientCapabilities `json:"inlayHint,omitzero"` // Capabilities specific to the diagnostic requests scoped to the // workspace. // // Since: 3.17.0. Diagnostics ResolvedDiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitzero"` // Capabilities specific to the folding range requests scoped to the workspace. // // Since: 3.18.0 FoldingRange ResolvedFoldingRangeWorkspaceClientCapabilities `json:"foldingRange,omitzero"` // Capabilities specific to the `workspace/textDocumentContent` request. // // Since: 3.18.0 TextDocumentContent ResolvedTextDocumentContentClientCapabilities `json:"textDocumentContent,omitzero"` } func (v *WorkspaceClientCapabilities) resolve() ResolvedWorkspaceClientCapabilities { if v == nil { return ResolvedWorkspaceClientCapabilities{} } return ResolvedWorkspaceClientCapabilities{ ApplyEdit: derefOr(v.ApplyEdit), WorkspaceEdit: v.WorkspaceEdit.resolve(), DidChangeConfiguration: v.DidChangeConfiguration.resolve(), DidChangeWatchedFiles: v.DidChangeWatchedFiles.resolve(), Symbol: v.Symbol.resolve(), ExecuteCommand: v.ExecuteCommand.resolve(), WorkspaceFolders: derefOr(v.WorkspaceFolders), Configuration: derefOr(v.Configuration), SemanticTokens: v.SemanticTokens.resolve(), CodeLens: v.CodeLens.resolve(), FileOperations: v.FileOperations.resolve(), InlineValue: v.InlineValue.resolve(), InlayHint: v.InlayHint.resolve(), Diagnostics: v.Diagnostics.resolve(), FoldingRange: v.FoldingRange.resolve(), TextDocumentContent: v.TextDocumentContent.resolve(), } } // ResolvedTextDocumentSyncClientCapabilities is a resolved version of TextDocumentSyncClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedTextDocumentSyncClientCapabilities struct { // Whether text document synchronization supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports sending will save notifications. WillSave bool `json:"willSave,omitzero"` // The client supports sending a will save request and // waits for a response providing text edits which will // be applied to the document before it is saved. WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitzero"` // The client supports did save notifications. DidSave bool `json:"didSave,omitzero"` } func (v *TextDocumentSyncClientCapabilities) resolve() ResolvedTextDocumentSyncClientCapabilities { if v == nil { return ResolvedTextDocumentSyncClientCapabilities{} } return ResolvedTextDocumentSyncClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), WillSave: derefOr(v.WillSave), WillSaveWaitUntil: derefOr(v.WillSaveWaitUntil), DidSave: derefOr(v.DidSave), } } // ResolvedTextDocumentFilterClientCapabilities is a resolved version of TextDocumentFilterClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedTextDocumentFilterClientCapabilities struct { // The client supports Relative Patterns. // // Since: 3.18.0 RelativePatternSupport bool `json:"relativePatternSupport,omitzero"` } func (v *TextDocumentFilterClientCapabilities) resolve() ResolvedTextDocumentFilterClientCapabilities { if v == nil { return ResolvedTextDocumentFilterClientCapabilities{} } return ResolvedTextDocumentFilterClientCapabilities{ RelativePatternSupport: derefOr(v.RelativePatternSupport), } } // ResolvedCompletionItemTagOptions is a resolved version of CompletionItemTagOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedCompletionItemTagOptions struct { // The tags supported by the client. ValueSet []CompletionItemTag `json:"valueSet,omitzero"` } func (v *CompletionItemTagOptions) resolve() ResolvedCompletionItemTagOptions { if v == nil { return ResolvedCompletionItemTagOptions{} } return ResolvedCompletionItemTagOptions{ ValueSet: v.ValueSet, } } // ResolvedClientCompletionItemResolveOptions is a resolved version of ClientCompletionItemResolveOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCompletionItemResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties,omitzero"` } func (v *ClientCompletionItemResolveOptions) resolve() ResolvedClientCompletionItemResolveOptions { if v == nil { return ResolvedClientCompletionItemResolveOptions{} } return ResolvedClientCompletionItemResolveOptions{ Properties: v.Properties, } } // ResolvedClientCompletionItemInsertTextModeOptions is a resolved version of ClientCompletionItemInsertTextModeOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCompletionItemInsertTextModeOptions struct { ValueSet []InsertTextMode `json:"valueSet,omitzero"` } func (v *ClientCompletionItemInsertTextModeOptions) resolve() ResolvedClientCompletionItemInsertTextModeOptions { if v == nil { return ResolvedClientCompletionItemInsertTextModeOptions{} } return ResolvedClientCompletionItemInsertTextModeOptions{ ValueSet: v.ValueSet, } } // ResolvedClientCompletionItemOptions is a resolved version of ClientCompletionItemOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCompletionItemOptions struct { // Client supports snippets as insert text. // // A snippet can define tab stops and placeholders with `$1`, `$2` // and `${3:foo}`. `$0` defines the final tab stop, it defaults to // the end of the snippet. Placeholders with equal identifiers are linked, // that is typing in one will update others too. SnippetSupport bool `json:"snippetSupport,omitzero"` // Client supports commit characters on a completion item. CommitCharactersSupport bool `json:"commitCharactersSupport,omitzero"` // Client supports the following content formats for the documentation // property. The order describes the preferred format of the client. DocumentationFormat []MarkupKind `json:"documentationFormat,omitzero"` // Client supports the deprecated property on a completion item. DeprecatedSupport bool `json:"deprecatedSupport,omitzero"` // Client supports the preselect property on a completion item. PreselectSupport bool `json:"preselectSupport,omitzero"` // Client supports the tag property on a completion item. Clients supporting // tags have to handle unknown tags gracefully. Clients especially need to // preserve unknown tags when sending a completion item back to the server in // a resolve call. // // Since: 3.15.0 TagSupport ResolvedCompletionItemTagOptions `json:"tagSupport,omitzero"` // Client support insert replace edit to control different behavior if a // completion item is inserted in the text or should replace text. // // Since: 3.16.0 InsertReplaceSupport bool `json:"insertReplaceSupport,omitzero"` // Indicates which properties a client can resolve lazily on a completion // item. Before version 3.16.0 only the predefined properties `documentation` // and `details` could be resolved lazily. // // Since: 3.16.0 ResolveSupport ResolvedClientCompletionItemResolveOptions `json:"resolveSupport,omitzero"` // The client supports the `insertTextMode` property on // a completion item to override the whitespace handling mode // as defined by the client (see `insertTextMode`). // // Since: 3.16.0 InsertTextModeSupport ResolvedClientCompletionItemInsertTextModeOptions `json:"insertTextModeSupport,omitzero"` // The client has support for completion item label // details (see also `CompletionItemLabelDetails`). // // Since: 3.17.0 LabelDetailsSupport bool `json:"labelDetailsSupport,omitzero"` } func (v *ClientCompletionItemOptions) resolve() ResolvedClientCompletionItemOptions { if v == nil { return ResolvedClientCompletionItemOptions{} } return ResolvedClientCompletionItemOptions{ SnippetSupport: derefOr(v.SnippetSupport), CommitCharactersSupport: derefOr(v.CommitCharactersSupport), DocumentationFormat: derefOr(v.DocumentationFormat), DeprecatedSupport: derefOr(v.DeprecatedSupport), PreselectSupport: derefOr(v.PreselectSupport), TagSupport: v.TagSupport.resolve(), InsertReplaceSupport: derefOr(v.InsertReplaceSupport), ResolveSupport: v.ResolveSupport.resolve(), InsertTextModeSupport: v.InsertTextModeSupport.resolve(), LabelDetailsSupport: derefOr(v.LabelDetailsSupport), } } // ResolvedClientCompletionItemOptionsKind is a resolved version of ClientCompletionItemOptionsKind with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCompletionItemOptionsKind struct { // The completion item kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. // // If this property is not present the client only supports // the completion items kinds from `Text` to `Reference` as defined in // the initial version of the protocol. ValueSet []CompletionItemKind `json:"valueSet,omitzero"` } func (v *ClientCompletionItemOptionsKind) resolve() ResolvedClientCompletionItemOptionsKind { if v == nil { return ResolvedClientCompletionItemOptionsKind{} } return ResolvedClientCompletionItemOptionsKind{ ValueSet: derefOr(v.ValueSet), } } // ResolvedCompletionListCapabilities is a resolved version of CompletionListCapabilities with all optional fields // converted to non-pointer values for easier access. // // The client supports the following `CompletionList` specific // capabilities. // // Since: 3.17.0 type ResolvedCompletionListCapabilities struct { // The client supports the following itemDefaults on // a completion list. // // The value lists the supported property names of the // `CompletionList.itemDefaults` object. If omitted // no properties are supported. // // Since: 3.17.0 ItemDefaults []string `json:"itemDefaults,omitzero"` // Specifies whether the client supports `CompletionList.applyKind` to // indicate how supported values from `completionList.itemDefaults` // and `completion` will be combined. // // If a client supports `applyKind` it must support it for all fields // that it supports that are listed in `CompletionList.applyKind`. This // means when clients add support for new/future fields in completion // items the MUST also support merge for them if those fields are // defined in `CompletionList.applyKind`. // // Since: 3.18.0 ApplyKindSupport bool `json:"applyKindSupport,omitzero"` } func (v *CompletionListCapabilities) resolve() ResolvedCompletionListCapabilities { if v == nil { return ResolvedCompletionListCapabilities{} } return ResolvedCompletionListCapabilities{ ItemDefaults: derefOr(v.ItemDefaults), ApplyKindSupport: derefOr(v.ApplyKindSupport), } } // ResolvedCompletionClientCapabilities is a resolved version of CompletionClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Completion client capabilities type ResolvedCompletionClientCapabilities struct { // Whether completion supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports the following `CompletionItem` specific // capabilities. CompletionItem ResolvedClientCompletionItemOptions `json:"completionItem,omitzero"` // The client supports the following completion item kinds. CompletionItemKind ResolvedClientCompletionItemOptionsKind `json:"completionItemKind,omitzero"` // Defines how the client handles whitespace and indentation // when accepting a completion item that uses multi line // text in either `insertText` or `textEdit`. // // Since: 3.17.0 InsertTextMode InsertTextMode `json:"insertTextMode,omitzero"` // The client supports to send additional context information for a // `textDocument/completion` request. ContextSupport bool `json:"contextSupport,omitzero"` // The client supports the following `CompletionList` specific // capabilities. // // Since: 3.17.0 CompletionList ResolvedCompletionListCapabilities `json:"completionList,omitzero"` } func (v *CompletionClientCapabilities) resolve() ResolvedCompletionClientCapabilities { if v == nil { return ResolvedCompletionClientCapabilities{} } return ResolvedCompletionClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), CompletionItem: v.CompletionItem.resolve(), CompletionItemKind: v.CompletionItemKind.resolve(), InsertTextMode: derefOr(v.InsertTextMode), ContextSupport: derefOr(v.ContextSupport), CompletionList: v.CompletionList.resolve(), } } // ResolvedHoverClientCapabilities is a resolved version of HoverClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedHoverClientCapabilities struct { // Whether hover supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Client supports the following content formats for the content // property. The order describes the preferred format of the client. ContentFormat []MarkupKind `json:"contentFormat,omitzero"` } func (v *HoverClientCapabilities) resolve() ResolvedHoverClientCapabilities { if v == nil { return ResolvedHoverClientCapabilities{} } return ResolvedHoverClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), ContentFormat: derefOr(v.ContentFormat), } } // ResolvedClientSignatureParameterInformationOptions is a resolved version of ClientSignatureParameterInformationOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientSignatureParameterInformationOptions struct { // The client supports processing label offsets instead of a // simple label string. // // Since: 3.14.0 LabelOffsetSupport bool `json:"labelOffsetSupport,omitzero"` } func (v *ClientSignatureParameterInformationOptions) resolve() ResolvedClientSignatureParameterInformationOptions { if v == nil { return ResolvedClientSignatureParameterInformationOptions{} } return ResolvedClientSignatureParameterInformationOptions{ LabelOffsetSupport: derefOr(v.LabelOffsetSupport), } } // ResolvedClientSignatureInformationOptions is a resolved version of ClientSignatureInformationOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientSignatureInformationOptions struct { // Client supports the following content formats for the documentation // property. The order describes the preferred format of the client. DocumentationFormat []MarkupKind `json:"documentationFormat,omitzero"` // Client capabilities specific to parameter information. ParameterInformation ResolvedClientSignatureParameterInformationOptions `json:"parameterInformation,omitzero"` // The client supports the `activeParameter` property on `SignatureInformation` // literal. // // Since: 3.16.0 ActiveParameterSupport bool `json:"activeParameterSupport,omitzero"` // The client supports the `activeParameter` property on // `SignatureHelp`/`SignatureInformation` being set to `null` to // indicate that no parameter should be active. // // Since: 3.18.0 NoActiveParameterSupport bool `json:"noActiveParameterSupport,omitzero"` } func (v *ClientSignatureInformationOptions) resolve() ResolvedClientSignatureInformationOptions { if v == nil { return ResolvedClientSignatureInformationOptions{} } return ResolvedClientSignatureInformationOptions{ DocumentationFormat: derefOr(v.DocumentationFormat), ParameterInformation: v.ParameterInformation.resolve(), ActiveParameterSupport: derefOr(v.ActiveParameterSupport), NoActiveParameterSupport: derefOr(v.NoActiveParameterSupport), } } // ResolvedSignatureHelpClientCapabilities is a resolved version of SignatureHelpClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client Capabilities for a SignatureHelpRequest. type ResolvedSignatureHelpClientCapabilities struct { // Whether signature help supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports the following `SignatureInformation` // specific properties. SignatureInformation ResolvedClientSignatureInformationOptions `json:"signatureInformation,omitzero"` // The client supports to send additional context information for a // `textDocument/signatureHelp` request. A client that opts into // contextSupport will also support the `retriggerCharacters` on // `SignatureHelpOptions`. // // Since: 3.15.0 ContextSupport bool `json:"contextSupport,omitzero"` } func (v *SignatureHelpClientCapabilities) resolve() ResolvedSignatureHelpClientCapabilities { if v == nil { return ResolvedSignatureHelpClientCapabilities{} } return ResolvedSignatureHelpClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), SignatureInformation: v.SignatureInformation.resolve(), ContextSupport: derefOr(v.ContextSupport), } } // ResolvedDeclarationClientCapabilities is a resolved version of DeclarationClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.14.0 type ResolvedDeclarationClientCapabilities struct { // Whether declaration supports dynamic registration. If this is set to `true` // the client supports the new `DeclarationRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of declaration links. LinkSupport bool `json:"linkSupport,omitzero"` } func (v *DeclarationClientCapabilities) resolve() ResolvedDeclarationClientCapabilities { if v == nil { return ResolvedDeclarationClientCapabilities{} } return ResolvedDeclarationClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), LinkSupport: derefOr(v.LinkSupport), } } // ResolvedDefinitionClientCapabilities is a resolved version of DefinitionClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client Capabilities for a DefinitionRequest. type ResolvedDefinitionClientCapabilities struct { // Whether definition supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of definition links. // // Since: 3.14.0 LinkSupport bool `json:"linkSupport,omitzero"` } func (v *DefinitionClientCapabilities) resolve() ResolvedDefinitionClientCapabilities { if v == nil { return ResolvedDefinitionClientCapabilities{} } return ResolvedDefinitionClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), LinkSupport: derefOr(v.LinkSupport), } } // ResolvedTypeDefinitionClientCapabilities is a resolved version of TypeDefinitionClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since 3.6.0 type ResolvedTypeDefinitionClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `TypeDefinitionRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of definition links. // // Since 3.14.0 LinkSupport bool `json:"linkSupport,omitzero"` } func (v *TypeDefinitionClientCapabilities) resolve() ResolvedTypeDefinitionClientCapabilities { if v == nil { return ResolvedTypeDefinitionClientCapabilities{} } return ResolvedTypeDefinitionClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), LinkSupport: derefOr(v.LinkSupport), } } // ResolvedImplementationClientCapabilities is a resolved version of ImplementationClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.6.0 type ResolvedImplementationClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `ImplementationRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client supports additional metadata in the form of definition links. // // Since: 3.14.0 LinkSupport bool `json:"linkSupport,omitzero"` } func (v *ImplementationClientCapabilities) resolve() ResolvedImplementationClientCapabilities { if v == nil { return ResolvedImplementationClientCapabilities{} } return ResolvedImplementationClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), LinkSupport: derefOr(v.LinkSupport), } } // ResolvedReferenceClientCapabilities is a resolved version of ReferenceClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client Capabilities for a ReferencesRequest. type ResolvedReferenceClientCapabilities struct { // Whether references supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *ReferenceClientCapabilities) resolve() ResolvedReferenceClientCapabilities { if v == nil { return ResolvedReferenceClientCapabilities{} } return ResolvedReferenceClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedDocumentHighlightClientCapabilities is a resolved version of DocumentHighlightClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client Capabilities for a DocumentHighlightRequest. type ResolvedDocumentHighlightClientCapabilities struct { // Whether document highlight supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *DocumentHighlightClientCapabilities) resolve() ResolvedDocumentHighlightClientCapabilities { if v == nil { return ResolvedDocumentHighlightClientCapabilities{} } return ResolvedDocumentHighlightClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedDocumentSymbolClientCapabilities is a resolved version of DocumentSymbolClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client Capabilities for a DocumentSymbolRequest. type ResolvedDocumentSymbolClientCapabilities struct { // Whether document symbol supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Specific capabilities for the `SymbolKind` in the // `textDocument/documentSymbol` request. SymbolKind ResolvedClientSymbolKindOptions `json:"symbolKind,omitzero"` // The client supports hierarchical document symbols. HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitzero"` // The client supports tags on `SymbolInformation`. Tags are supported on // `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.16.0 TagSupport ResolvedClientSymbolTagOptions `json:"tagSupport,omitzero"` // The client supports an additional label presented in the UI when // registering a document symbol provider. // // Since: 3.16.0 LabelSupport bool `json:"labelSupport,omitzero"` } func (v *DocumentSymbolClientCapabilities) resolve() ResolvedDocumentSymbolClientCapabilities { if v == nil { return ResolvedDocumentSymbolClientCapabilities{} } return ResolvedDocumentSymbolClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), SymbolKind: v.SymbolKind.resolve(), HierarchicalDocumentSymbolSupport: derefOr(v.HierarchicalDocumentSymbolSupport), TagSupport: v.TagSupport.resolve(), LabelSupport: derefOr(v.LabelSupport), } } // ResolvedClientCodeActionKindOptions is a resolved version of ClientCodeActionKindOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCodeActionKindOptions struct { // The code action kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. ValueSet []CodeActionKind `json:"valueSet,omitzero"` } func (v *ClientCodeActionKindOptions) resolve() ResolvedClientCodeActionKindOptions { if v == nil { return ResolvedClientCodeActionKindOptions{} } return ResolvedClientCodeActionKindOptions{ ValueSet: v.ValueSet, } } // ResolvedClientCodeActionLiteralOptions is a resolved version of ClientCodeActionLiteralOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCodeActionLiteralOptions struct { // The code action kind is support with the following value // set. CodeActionKind ResolvedClientCodeActionKindOptions `json:"codeActionKind,omitzero"` } func (v *ClientCodeActionLiteralOptions) resolve() ResolvedClientCodeActionLiteralOptions { if v == nil { return ResolvedClientCodeActionLiteralOptions{} } return ResolvedClientCodeActionLiteralOptions{ CodeActionKind: v.CodeActionKind.resolve(), } } // ResolvedClientCodeActionResolveOptions is a resolved version of ClientCodeActionResolveOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCodeActionResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties,omitzero"` } func (v *ClientCodeActionResolveOptions) resolve() ResolvedClientCodeActionResolveOptions { if v == nil { return ResolvedClientCodeActionResolveOptions{} } return ResolvedClientCodeActionResolveOptions{ Properties: v.Properties, } } // ResolvedCodeActionTagOptions is a resolved version of CodeActionTagOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 - proposed type ResolvedCodeActionTagOptions struct { // The tags supported by the client. ValueSet []CodeActionTag `json:"valueSet,omitzero"` } func (v *CodeActionTagOptions) resolve() ResolvedCodeActionTagOptions { if v == nil { return ResolvedCodeActionTagOptions{} } return ResolvedCodeActionTagOptions{ ValueSet: v.ValueSet, } } // ResolvedCodeActionClientCapabilities is a resolved version of CodeActionClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // The Client Capabilities of a CodeActionRequest. type ResolvedCodeActionClientCapabilities struct { // Whether code action supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The client support code action literals of type `CodeAction` as a valid // response of the `textDocument/codeAction` request. If the property is not // set the request can only return `Command` literals. // // Since: 3.8.0 CodeActionLiteralSupport ResolvedClientCodeActionLiteralOptions `json:"codeActionLiteralSupport,omitzero"` // Whether code action supports the `isPreferred` property. // // Since: 3.15.0 IsPreferredSupport bool `json:"isPreferredSupport,omitzero"` // Whether code action supports the `disabled` property. // // Since: 3.16.0 DisabledSupport bool `json:"disabledSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/codeAction` and a // `codeAction/resolve` request. // // Since: 3.16.0 DataSupport bool `json:"dataSupport,omitzero"` // Whether the client supports resolving additional code action // properties via a separate `codeAction/resolve` request. // // Since: 3.16.0 ResolveSupport ResolvedClientCodeActionResolveOptions `json:"resolveSupport,omitzero"` // Whether the client honors the change annotations in // text edits and resource operations returned via the // `CodeAction#edit` property by for example presenting // the workspace edit in the user interface and asking // for confirmation. // // Since: 3.16.0 HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitzero"` // Whether the client supports documentation for a class of // code actions. // // Since: 3.18.0 DocumentationSupport bool `json:"documentationSupport,omitzero"` // Client supports the tag property on a code action. Clients // supporting tags have to handle unknown tags gracefully. // // Since: 3.18.0 - proposed TagSupport ResolvedCodeActionTagOptions `json:"tagSupport,omitzero"` } func (v *CodeActionClientCapabilities) resolve() ResolvedCodeActionClientCapabilities { if v == nil { return ResolvedCodeActionClientCapabilities{} } return ResolvedCodeActionClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), CodeActionLiteralSupport: v.CodeActionLiteralSupport.resolve(), IsPreferredSupport: derefOr(v.IsPreferredSupport), DisabledSupport: derefOr(v.DisabledSupport), DataSupport: derefOr(v.DataSupport), ResolveSupport: v.ResolveSupport.resolve(), HonorsChangeAnnotations: derefOr(v.HonorsChangeAnnotations), DocumentationSupport: derefOr(v.DocumentationSupport), TagSupport: v.TagSupport.resolve(), } } // ResolvedClientCodeLensResolveOptions is a resolved version of ClientCodeLensResolveOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientCodeLensResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties,omitzero"` } func (v *ClientCodeLensResolveOptions) resolve() ResolvedClientCodeLensResolveOptions { if v == nil { return ResolvedClientCodeLensResolveOptions{} } return ResolvedClientCodeLensResolveOptions{ Properties: v.Properties, } } // ResolvedCodeLensClientCapabilities is a resolved version of CodeLensClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // The client capabilities of a CodeLensRequest. type ResolvedCodeLensClientCapabilities struct { // Whether code lens supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Whether the client supports resolving additional code lens // properties via a separate `codeLens/resolve` request. // // Since: 3.18.0 ResolveSupport ResolvedClientCodeLensResolveOptions `json:"resolveSupport,omitzero"` } func (v *CodeLensClientCapabilities) resolve() ResolvedCodeLensClientCapabilities { if v == nil { return ResolvedCodeLensClientCapabilities{} } return ResolvedCodeLensClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), ResolveSupport: v.ResolveSupport.resolve(), } } // ResolvedDocumentLinkClientCapabilities is a resolved version of DocumentLinkClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // The client capabilities of a DocumentLinkRequest. type ResolvedDocumentLinkClientCapabilities struct { // Whether document link supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Whether the client supports the `tooltip` property on `DocumentLink`. // // Since: 3.15.0 TooltipSupport bool `json:"tooltipSupport,omitzero"` } func (v *DocumentLinkClientCapabilities) resolve() ResolvedDocumentLinkClientCapabilities { if v == nil { return ResolvedDocumentLinkClientCapabilities{} } return ResolvedDocumentLinkClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), TooltipSupport: derefOr(v.TooltipSupport), } } // ResolvedDocumentColorClientCapabilities is a resolved version of DocumentColorClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedDocumentColorClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `DocumentColorRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *DocumentColorClientCapabilities) resolve() ResolvedDocumentColorClientCapabilities { if v == nil { return ResolvedDocumentColorClientCapabilities{} } return ResolvedDocumentColorClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedDocumentFormattingClientCapabilities is a resolved version of DocumentFormattingClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities of a DocumentFormattingRequest. type ResolvedDocumentFormattingClientCapabilities struct { // Whether formatting supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *DocumentFormattingClientCapabilities) resolve() ResolvedDocumentFormattingClientCapabilities { if v == nil { return ResolvedDocumentFormattingClientCapabilities{} } return ResolvedDocumentFormattingClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedDocumentRangeFormattingClientCapabilities is a resolved version of DocumentRangeFormattingClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities of a DocumentRangeFormattingRequest. type ResolvedDocumentRangeFormattingClientCapabilities struct { // Whether range formatting supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Whether the client supports formatting multiple ranges at once. // // Since: 3.18.0 RangesSupport bool `json:"rangesSupport,omitzero"` } func (v *DocumentRangeFormattingClientCapabilities) resolve() ResolvedDocumentRangeFormattingClientCapabilities { if v == nil { return ResolvedDocumentRangeFormattingClientCapabilities{} } return ResolvedDocumentRangeFormattingClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), RangesSupport: derefOr(v.RangesSupport), } } // ResolvedDocumentOnTypeFormattingClientCapabilities is a resolved version of DocumentOnTypeFormattingClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities of a DocumentOnTypeFormattingRequest. type ResolvedDocumentOnTypeFormattingClientCapabilities struct { // Whether on type formatting supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *DocumentOnTypeFormattingClientCapabilities) resolve() ResolvedDocumentOnTypeFormattingClientCapabilities { if v == nil { return ResolvedDocumentOnTypeFormattingClientCapabilities{} } return ResolvedDocumentOnTypeFormattingClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedRenameClientCapabilities is a resolved version of RenameClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedRenameClientCapabilities struct { // Whether rename supports dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Client supports testing for validity of rename operations // before execution. // // Since: 3.12.0 PrepareSupport bool `json:"prepareSupport,omitzero"` // Client supports the default behavior result. // // The value indicates the default behavior used by the // client. // // Since: 3.16.0 PrepareSupportDefaultBehavior PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitzero"` // Whether the client honors the change annotations in // text edits and resource operations returned via the // rename request's workspace edit by for example presenting // the workspace edit in the user interface and asking // for confirmation. // // Since: 3.16.0 HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitzero"` } func (v *RenameClientCapabilities) resolve() ResolvedRenameClientCapabilities { if v == nil { return ResolvedRenameClientCapabilities{} } return ResolvedRenameClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), PrepareSupport: derefOr(v.PrepareSupport), PrepareSupportDefaultBehavior: derefOr(v.PrepareSupportDefaultBehavior), HonorsChangeAnnotations: derefOr(v.HonorsChangeAnnotations), } } // ResolvedClientFoldingRangeKindOptions is a resolved version of ClientFoldingRangeKindOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientFoldingRangeKindOptions struct { // The folding range kind values the client supports. When this // property exists the client also guarantees that it will // handle values outside its set gracefully and falls back // to a default value when unknown. ValueSet []FoldingRangeKind `json:"valueSet,omitzero"` } func (v *ClientFoldingRangeKindOptions) resolve() ResolvedClientFoldingRangeKindOptions { if v == nil { return ResolvedClientFoldingRangeKindOptions{} } return ResolvedClientFoldingRangeKindOptions{ ValueSet: derefOr(v.ValueSet), } } // ResolvedClientFoldingRangeOptions is a resolved version of ClientFoldingRangeOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientFoldingRangeOptions struct { // If set, the client signals that it supports setting collapsedText on // folding ranges to display custom labels instead of the default text. // // Since: 3.17.0 CollapsedText bool `json:"collapsedText,omitzero"` } func (v *ClientFoldingRangeOptions) resolve() ResolvedClientFoldingRangeOptions { if v == nil { return ResolvedClientFoldingRangeOptions{} } return ResolvedClientFoldingRangeOptions{ CollapsedText: derefOr(v.CollapsedText), } } // ResolvedFoldingRangeClientCapabilities is a resolved version of FoldingRangeClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedFoldingRangeClientCapabilities struct { // Whether implementation supports dynamic registration for folding range // providers. If this is set to `true` the client supports the new // `FoldingRangeRegistrationOptions` return value for the corresponding // server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // The maximum number of folding ranges that the client prefers to receive // per document. The value serves as a hint, servers are free to follow the // limit. RangeLimit uint32 `json:"rangeLimit,omitzero"` // If set, the client signals that it only supports folding complete lines. // If set, client will ignore specified `startCharacter` and `endCharacter` // properties in a FoldingRange. LineFoldingOnly bool `json:"lineFoldingOnly,omitzero"` // Specific options for the folding range kind. // // Since: 3.17.0 FoldingRangeKind ResolvedClientFoldingRangeKindOptions `json:"foldingRangeKind,omitzero"` // Specific options for the folding range. // // Since: 3.17.0 FoldingRange ResolvedClientFoldingRangeOptions `json:"foldingRange,omitzero"` } func (v *FoldingRangeClientCapabilities) resolve() ResolvedFoldingRangeClientCapabilities { if v == nil { return ResolvedFoldingRangeClientCapabilities{} } return ResolvedFoldingRangeClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), RangeLimit: derefOr(v.RangeLimit), LineFoldingOnly: derefOr(v.LineFoldingOnly), FoldingRangeKind: v.FoldingRangeKind.resolve(), FoldingRange: v.FoldingRange.resolve(), } } // ResolvedSelectionRangeClientCapabilities is a resolved version of SelectionRangeClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedSelectionRangeClientCapabilities struct { // Whether implementation supports dynamic registration for selection range providers. If this is set to `true` // the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server // capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *SelectionRangeClientCapabilities) resolve() ResolvedSelectionRangeClientCapabilities { if v == nil { return ResolvedSelectionRangeClientCapabilities{} } return ResolvedSelectionRangeClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedClientDiagnosticsTagOptions is a resolved version of ClientDiagnosticsTagOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientDiagnosticsTagOptions struct { // The tags supported by the client. ValueSet []DiagnosticTag `json:"valueSet,omitzero"` } func (v *ClientDiagnosticsTagOptions) resolve() ResolvedClientDiagnosticsTagOptions { if v == nil { return ResolvedClientDiagnosticsTagOptions{} } return ResolvedClientDiagnosticsTagOptions{ ValueSet: v.ValueSet, } } // ResolvedPublishDiagnosticsClientCapabilities is a resolved version of PublishDiagnosticsClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // The publish diagnostic client capabilities. type ResolvedPublishDiagnosticsClientCapabilities struct { // Whether the clients accepts diagnostics with related information. RelatedInformation bool `json:"relatedInformation,omitzero"` // Client supports the tag property to provide meta data about a diagnostic. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.15.0 TagSupport ResolvedClientDiagnosticsTagOptions `json:"tagSupport,omitzero"` // Client supports a codeDescription property // // Since: 3.16.0 CodeDescriptionSupport bool `json:"codeDescriptionSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/publishDiagnostics` and // `textDocument/codeAction` request. // // Since: 3.16.0 DataSupport bool `json:"dataSupport,omitzero"` // Whether the client interprets the version property of the // `textDocument/publishDiagnostics` notification's parameter. // // Since: 3.15.0 VersionSupport bool `json:"versionSupport,omitzero"` } func (v *PublishDiagnosticsClientCapabilities) resolve() ResolvedPublishDiagnosticsClientCapabilities { if v == nil { return ResolvedPublishDiagnosticsClientCapabilities{} } return ResolvedPublishDiagnosticsClientCapabilities{ RelatedInformation: derefOr(v.RelatedInformation), TagSupport: v.TagSupport.resolve(), CodeDescriptionSupport: derefOr(v.CodeDescriptionSupport), DataSupport: derefOr(v.DataSupport), VersionSupport: derefOr(v.VersionSupport), } } // ResolvedCallHierarchyClientCapabilities is a resolved version of CallHierarchyClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.16.0 type ResolvedCallHierarchyClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *CallHierarchyClientCapabilities) resolve() ResolvedCallHierarchyClientCapabilities { if v == nil { return ResolvedCallHierarchyClientCapabilities{} } return ResolvedCallHierarchyClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedClientSemanticTokensRequestOptions is a resolved version of ClientSemanticTokensRequestOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientSemanticTokensRequestOptions struct { // The client will send the `textDocument/semanticTokens/range` request if // the server provides a corresponding handler. Range BooleanOrEmptyObject `json:"range,omitzero"` // The client will send the `textDocument/semanticTokens/full` request if // the server provides a corresponding handler. Full BooleanOrClientSemanticTokensRequestFullDelta `json:"full,omitzero"` } func (v *ClientSemanticTokensRequestOptions) resolve() ResolvedClientSemanticTokensRequestOptions { if v == nil { return ResolvedClientSemanticTokensRequestOptions{} } return ResolvedClientSemanticTokensRequestOptions{ Range: derefOr(v.Range), Full: derefOr(v.Full), } } // ResolvedSemanticTokensClientCapabilities is a resolved version of SemanticTokensClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.16.0 type ResolvedSemanticTokensClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Which requests the client supports and might send to the server // depending on the server's capability. Please note that clients might not // show semantic tokens or degrade some of the user experience if a range // or full request is advertised by the client but not provided by the // server. If for example the client capability `requests.full` and // `request.range` are both set to true but the server only provides a // range provider the client might not render a minimap correctly or might // even decide to not show any semantic tokens at all. Requests ResolvedClientSemanticTokensRequestOptions `json:"requests,omitzero"` // The token types that the client supports. TokenTypes []string `json:"tokenTypes,omitzero"` // The token modifiers that the client supports. TokenModifiers []string `json:"tokenModifiers,omitzero"` // The token formats the clients supports. Formats []TokenFormat `json:"formats,omitzero"` // Whether the client supports tokens that can overlap each other. OverlappingTokenSupport bool `json:"overlappingTokenSupport,omitzero"` // Whether the client supports tokens that can span multiple lines. MultilineTokenSupport bool `json:"multilineTokenSupport,omitzero"` // Whether the client allows the server to actively cancel a // semantic token request, e.g. supports returning // LSPErrorCodes.ServerCancelled. If a server does the client // needs to retrigger the request. // // Since: 3.17.0 ServerCancelSupport bool `json:"serverCancelSupport,omitzero"` // Whether the client uses semantic tokens to augment existing // syntax tokens. If set to `true` client side created syntax // tokens and semantic tokens are both used for colorization. If // set to `false` the client only uses the returned semantic tokens // for colorization. // // If the value is `undefined` then the client behavior is not // specified. // // Since: 3.17.0 AugmentsSyntaxTokens bool `json:"augmentsSyntaxTokens,omitzero"` } func (v *SemanticTokensClientCapabilities) resolve() ResolvedSemanticTokensClientCapabilities { if v == nil { return ResolvedSemanticTokensClientCapabilities{} } return ResolvedSemanticTokensClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), Requests: v.Requests.resolve(), TokenTypes: v.TokenTypes, TokenModifiers: v.TokenModifiers, Formats: v.Formats, OverlappingTokenSupport: derefOr(v.OverlappingTokenSupport), MultilineTokenSupport: derefOr(v.MultilineTokenSupport), ServerCancelSupport: derefOr(v.ServerCancelSupport), AugmentsSyntaxTokens: derefOr(v.AugmentsSyntaxTokens), } } // ResolvedLinkedEditingRangeClientCapabilities is a resolved version of LinkedEditingRangeClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities for the linked editing range request. // // Since: 3.16.0 type ResolvedLinkedEditingRangeClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *LinkedEditingRangeClientCapabilities) resolve() ResolvedLinkedEditingRangeClientCapabilities { if v == nil { return ResolvedLinkedEditingRangeClientCapabilities{} } return ResolvedLinkedEditingRangeClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedMonikerClientCapabilities is a resolved version of MonikerClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities specific to the moniker request. // // Since: 3.16.0 type ResolvedMonikerClientCapabilities struct { // Whether moniker supports dynamic registration. If this is set to `true` // the client supports the new `MonikerRegistrationOptions` return value // for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *MonikerClientCapabilities) resolve() ResolvedMonikerClientCapabilities { if v == nil { return ResolvedMonikerClientCapabilities{} } return ResolvedMonikerClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedTypeHierarchyClientCapabilities is a resolved version of TypeHierarchyClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Since: 3.17.0 type ResolvedTypeHierarchyClientCapabilities struct { // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *TypeHierarchyClientCapabilities) resolve() ResolvedTypeHierarchyClientCapabilities { if v == nil { return ResolvedTypeHierarchyClientCapabilities{} } return ResolvedTypeHierarchyClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedInlineValueClientCapabilities is a resolved version of InlineValueClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities specific to inline values. // // Since: 3.17.0 type ResolvedInlineValueClientCapabilities struct { // Whether implementation supports dynamic registration for inline value providers. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *InlineValueClientCapabilities) resolve() ResolvedInlineValueClientCapabilities { if v == nil { return ResolvedInlineValueClientCapabilities{} } return ResolvedInlineValueClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedClientInlayHintResolveOptions is a resolved version of ClientInlayHintResolveOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientInlayHintResolveOptions struct { // The properties that a client can resolve lazily. Properties []string `json:"properties,omitzero"` } func (v *ClientInlayHintResolveOptions) resolve() ResolvedClientInlayHintResolveOptions { if v == nil { return ResolvedClientInlayHintResolveOptions{} } return ResolvedClientInlayHintResolveOptions{ Properties: v.Properties, } } // ResolvedInlayHintClientCapabilities is a resolved version of InlayHintClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Inlay hint client capabilities. // // Since: 3.17.0 type ResolvedInlayHintClientCapabilities struct { // Whether inlay hints support dynamic registration. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Indicates which properties a client can resolve lazily on an inlay // hint. ResolveSupport ResolvedClientInlayHintResolveOptions `json:"resolveSupport,omitzero"` } func (v *InlayHintClientCapabilities) resolve() ResolvedInlayHintClientCapabilities { if v == nil { return ResolvedInlayHintClientCapabilities{} } return ResolvedInlayHintClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), ResolveSupport: v.ResolveSupport.resolve(), } } // ResolvedDiagnosticClientCapabilities is a resolved version of DiagnosticClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities specific to diagnostic pull requests. // // Since: 3.17.0 type ResolvedDiagnosticClientCapabilities struct { // Whether the clients accepts diagnostics with related information. RelatedInformation bool `json:"relatedInformation,omitzero"` // Client supports the tag property to provide meta data about a diagnostic. // Clients supporting tags have to handle unknown tags gracefully. // // Since: 3.15.0 TagSupport ResolvedClientDiagnosticsTagOptions `json:"tagSupport,omitzero"` // Client supports a codeDescription property // // Since: 3.16.0 CodeDescriptionSupport bool `json:"codeDescriptionSupport,omitzero"` // Whether code action supports the `data` property which is // preserved between a `textDocument/publishDiagnostics` and // `textDocument/codeAction` request. // // Since: 3.16.0 DataSupport bool `json:"dataSupport,omitzero"` // Whether implementation supports dynamic registration. If this is set to `true` // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` // return value for the corresponding server capability as well. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` // Whether the clients supports related documents for document diagnostic pulls. RelatedDocumentSupport bool `json:"relatedDocumentSupport,omitzero"` // Whether the client supports `MarkupContent` in diagnostic messages. // // Since: 3.18.0 MarkupMessageSupport bool `json:"markupMessageSupport,omitzero"` } func (v *DiagnosticClientCapabilities) resolve() ResolvedDiagnosticClientCapabilities { if v == nil { return ResolvedDiagnosticClientCapabilities{} } return ResolvedDiagnosticClientCapabilities{ RelatedInformation: derefOr(v.RelatedInformation), TagSupport: v.TagSupport.resolve(), CodeDescriptionSupport: derefOr(v.CodeDescriptionSupport), DataSupport: derefOr(v.DataSupport), DynamicRegistration: derefOr(v.DynamicRegistration), RelatedDocumentSupport: derefOr(v.RelatedDocumentSupport), MarkupMessageSupport: derefOr(v.MarkupMessageSupport), } } // ResolvedInlineCompletionClientCapabilities is a resolved version of InlineCompletionClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities specific to inline completions. // // Since: 3.18.0 type ResolvedInlineCompletionClientCapabilities struct { // Whether implementation supports dynamic registration for inline completion providers. DynamicRegistration bool `json:"dynamicRegistration,omitzero"` } func (v *InlineCompletionClientCapabilities) resolve() ResolvedInlineCompletionClientCapabilities { if v == nil { return ResolvedInlineCompletionClientCapabilities{} } return ResolvedInlineCompletionClientCapabilities{ DynamicRegistration: derefOr(v.DynamicRegistration), } } // ResolvedTextDocumentClientCapabilities is a resolved version of TextDocumentClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Text document specific client capabilities. type ResolvedTextDocumentClientCapabilities struct { // Defines which synchronization capabilities the client supports. Synchronization ResolvedTextDocumentSyncClientCapabilities `json:"synchronization,omitzero"` // Defines which filters the client supports. // // Since: 3.18.0 Filters ResolvedTextDocumentFilterClientCapabilities `json:"filters,omitzero"` // Capabilities specific to the `textDocument/completion` request. Completion ResolvedCompletionClientCapabilities `json:"completion,omitzero"` // Capabilities specific to the `textDocument/hover` request. Hover ResolvedHoverClientCapabilities `json:"hover,omitzero"` // Capabilities specific to the `textDocument/signatureHelp` request. SignatureHelp ResolvedSignatureHelpClientCapabilities `json:"signatureHelp,omitzero"` // Capabilities specific to the `textDocument/declaration` request. // // Since: 3.14.0 Declaration ResolvedDeclarationClientCapabilities `json:"declaration,omitzero"` // Capabilities specific to the `textDocument/definition` request. Definition ResolvedDefinitionClientCapabilities `json:"definition,omitzero"` // Capabilities specific to the `textDocument/typeDefinition` request. // // Since: 3.6.0 TypeDefinition ResolvedTypeDefinitionClientCapabilities `json:"typeDefinition,omitzero"` // Capabilities specific to the `textDocument/implementation` request. // // Since: 3.6.0 Implementation ResolvedImplementationClientCapabilities `json:"implementation,omitzero"` // Capabilities specific to the `textDocument/references` request. References ResolvedReferenceClientCapabilities `json:"references,omitzero"` // Capabilities specific to the `textDocument/documentHighlight` request. DocumentHighlight ResolvedDocumentHighlightClientCapabilities `json:"documentHighlight,omitzero"` // Capabilities specific to the `textDocument/documentSymbol` request. DocumentSymbol ResolvedDocumentSymbolClientCapabilities `json:"documentSymbol,omitzero"` // Capabilities specific to the `textDocument/codeAction` request. CodeAction ResolvedCodeActionClientCapabilities `json:"codeAction,omitzero"` // Capabilities specific to the `textDocument/codeLens` request. CodeLens ResolvedCodeLensClientCapabilities `json:"codeLens,omitzero"` // Capabilities specific to the `textDocument/documentLink` request. DocumentLink ResolvedDocumentLinkClientCapabilities `json:"documentLink,omitzero"` // Capabilities specific to the `textDocument/documentColor` and the // `textDocument/colorPresentation` request. // // Since: 3.6.0 ColorProvider ResolvedDocumentColorClientCapabilities `json:"colorProvider,omitzero"` // Capabilities specific to the `textDocument/formatting` request. Formatting ResolvedDocumentFormattingClientCapabilities `json:"formatting,omitzero"` // Capabilities specific to the `textDocument/rangeFormatting` request. RangeFormatting ResolvedDocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitzero"` // Capabilities specific to the `textDocument/onTypeFormatting` request. OnTypeFormatting ResolvedDocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitzero"` // Capabilities specific to the `textDocument/rename` request. Rename ResolvedRenameClientCapabilities `json:"rename,omitzero"` // Capabilities specific to the `textDocument/foldingRange` request. // // Since: 3.10.0 FoldingRange ResolvedFoldingRangeClientCapabilities `json:"foldingRange,omitzero"` // Capabilities specific to the `textDocument/selectionRange` request. // // Since: 3.15.0 SelectionRange ResolvedSelectionRangeClientCapabilities `json:"selectionRange,omitzero"` // Capabilities specific to the `textDocument/publishDiagnostics` notification. PublishDiagnostics ResolvedPublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitzero"` // Capabilities specific to the various call hierarchy requests. // // Since: 3.16.0 CallHierarchy ResolvedCallHierarchyClientCapabilities `json:"callHierarchy,omitzero"` // Capabilities specific to the various semantic token request. // // Since: 3.16.0 SemanticTokens ResolvedSemanticTokensClientCapabilities `json:"semanticTokens,omitzero"` // Capabilities specific to the `textDocument/linkedEditingRange` request. // // Since: 3.16.0 LinkedEditingRange ResolvedLinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitzero"` // Client capabilities specific to the `textDocument/moniker` request. // // Since: 3.16.0 Moniker ResolvedMonikerClientCapabilities `json:"moniker,omitzero"` // Capabilities specific to the various type hierarchy requests. // // Since: 3.17.0 TypeHierarchy ResolvedTypeHierarchyClientCapabilities `json:"typeHierarchy,omitzero"` // Capabilities specific to the `textDocument/inlineValue` request. // // Since: 3.17.0 InlineValue ResolvedInlineValueClientCapabilities `json:"inlineValue,omitzero"` // Capabilities specific to the `textDocument/inlayHint` request. // // Since: 3.17.0 InlayHint ResolvedInlayHintClientCapabilities `json:"inlayHint,omitzero"` // Capabilities specific to the diagnostic pull model. // // Since: 3.17.0 Diagnostic ResolvedDiagnosticClientCapabilities `json:"diagnostic,omitzero"` // Client capabilities specific to inline completions. // // Since: 3.18.0 InlineCompletion ResolvedInlineCompletionClientCapabilities `json:"inlineCompletion,omitzero"` } func (v *TextDocumentClientCapabilities) resolve() ResolvedTextDocumentClientCapabilities { if v == nil { return ResolvedTextDocumentClientCapabilities{} } return ResolvedTextDocumentClientCapabilities{ Synchronization: v.Synchronization.resolve(), Filters: v.Filters.resolve(), Completion: v.Completion.resolve(), Hover: v.Hover.resolve(), SignatureHelp: v.SignatureHelp.resolve(), Declaration: v.Declaration.resolve(), Definition: v.Definition.resolve(), TypeDefinition: v.TypeDefinition.resolve(), Implementation: v.Implementation.resolve(), References: v.References.resolve(), DocumentHighlight: v.DocumentHighlight.resolve(), DocumentSymbol: v.DocumentSymbol.resolve(), CodeAction: v.CodeAction.resolve(), CodeLens: v.CodeLens.resolve(), DocumentLink: v.DocumentLink.resolve(), ColorProvider: v.ColorProvider.resolve(), Formatting: v.Formatting.resolve(), RangeFormatting: v.RangeFormatting.resolve(), OnTypeFormatting: v.OnTypeFormatting.resolve(), Rename: v.Rename.resolve(), FoldingRange: v.FoldingRange.resolve(), SelectionRange: v.SelectionRange.resolve(), PublishDiagnostics: v.PublishDiagnostics.resolve(), CallHierarchy: v.CallHierarchy.resolve(), SemanticTokens: v.SemanticTokens.resolve(), LinkedEditingRange: v.LinkedEditingRange.resolve(), Moniker: v.Moniker.resolve(), TypeHierarchy: v.TypeHierarchy.resolve(), InlineValue: v.InlineValue.resolve(), InlayHint: v.InlayHint.resolve(), Diagnostic: v.Diagnostic.resolve(), InlineCompletion: v.InlineCompletion.resolve(), } } // ResolvedClientShowMessageActionItemOptions is a resolved version of ClientShowMessageActionItemOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedClientShowMessageActionItemOptions struct { // Whether the client supports additional attributes which // are preserved and send back to the server in the // request's response. AdditionalPropertiesSupport bool `json:"additionalPropertiesSupport,omitzero"` } func (v *ClientShowMessageActionItemOptions) resolve() ResolvedClientShowMessageActionItemOptions { if v == nil { return ResolvedClientShowMessageActionItemOptions{} } return ResolvedClientShowMessageActionItemOptions{ AdditionalPropertiesSupport: derefOr(v.AdditionalPropertiesSupport), } } // ResolvedShowMessageRequestClientCapabilities is a resolved version of ShowMessageRequestClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Show message request client capabilities type ResolvedShowMessageRequestClientCapabilities struct { // Capabilities specific to the `MessageActionItem` type. MessageActionItem ResolvedClientShowMessageActionItemOptions `json:"messageActionItem,omitzero"` } func (v *ShowMessageRequestClientCapabilities) resolve() ResolvedShowMessageRequestClientCapabilities { if v == nil { return ResolvedShowMessageRequestClientCapabilities{} } return ResolvedShowMessageRequestClientCapabilities{ MessageActionItem: v.MessageActionItem.resolve(), } } // ResolvedShowDocumentClientCapabilities is a resolved version of ShowDocumentClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities for the showDocument request. // // Since: 3.16.0 type ResolvedShowDocumentClientCapabilities struct { // The client has support for the showDocument // request. Support bool `json:"support,omitzero"` } func (v *ShowDocumentClientCapabilities) resolve() ResolvedShowDocumentClientCapabilities { if v == nil { return ResolvedShowDocumentClientCapabilities{} } return ResolvedShowDocumentClientCapabilities{ Support: v.Support, } } // ResolvedWindowClientCapabilities is a resolved version of WindowClientCapabilities with all optional fields // converted to non-pointer values for easier access. type ResolvedWindowClientCapabilities struct { // It indicates whether the client supports server initiated // progress using the `window/workDoneProgress/create` request. // // The capability also controls Whether client supports handling // of progress notifications. If set servers are allowed to report a // `workDoneProgress` property in the request specific server // capabilities. // // Since: 3.15.0 WorkDoneProgress bool `json:"workDoneProgress,omitzero"` // Capabilities specific to the showMessage request. // // Since: 3.16.0 ShowMessage ResolvedShowMessageRequestClientCapabilities `json:"showMessage,omitzero"` // Capabilities specific to the showDocument request. // // Since: 3.16.0 ShowDocument ResolvedShowDocumentClientCapabilities `json:"showDocument,omitzero"` } func (v *WindowClientCapabilities) resolve() ResolvedWindowClientCapabilities { if v == nil { return ResolvedWindowClientCapabilities{} } return ResolvedWindowClientCapabilities{ WorkDoneProgress: derefOr(v.WorkDoneProgress), ShowMessage: v.ShowMessage.resolve(), ShowDocument: v.ShowDocument.resolve(), } } // ResolvedStaleRequestSupportOptions is a resolved version of StaleRequestSupportOptions with all optional fields // converted to non-pointer values for easier access. // // Since: 3.18.0 type ResolvedStaleRequestSupportOptions struct { // The client will actively cancel the request. Cancel bool `json:"cancel,omitzero"` // The list of requests for which the client // will retry the request if it receives a // response with error code `ContentModified` RetryOnContentModified []string `json:"retryOnContentModified,omitzero"` } func (v *StaleRequestSupportOptions) resolve() ResolvedStaleRequestSupportOptions { if v == nil { return ResolvedStaleRequestSupportOptions{} } return ResolvedStaleRequestSupportOptions{ Cancel: v.Cancel, RetryOnContentModified: v.RetryOnContentModified, } } // ResolvedRegularExpressionsClientCapabilities is a resolved version of RegularExpressionsClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities specific to regular expressions. // // Since: 3.16.0 type ResolvedRegularExpressionsClientCapabilities struct { // The engine's name. Engine string `json:"engine,omitzero"` // The engine's version. Version string `json:"version,omitzero"` } func (v *RegularExpressionsClientCapabilities) resolve() ResolvedRegularExpressionsClientCapabilities { if v == nil { return ResolvedRegularExpressionsClientCapabilities{} } return ResolvedRegularExpressionsClientCapabilities{ Engine: v.Engine, Version: derefOr(v.Version), } } // ResolvedMarkdownClientCapabilities is a resolved version of MarkdownClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // Client capabilities specific to the used markdown parser. // // Since: 3.16.0 type ResolvedMarkdownClientCapabilities struct { // The name of the parser. Parser string `json:"parser,omitzero"` // The version of the parser. Version string `json:"version,omitzero"` // A list of HTML tags that the client allows / supports in // Markdown. // // Since: 3.17.0 AllowedTags []string `json:"allowedTags,omitzero"` } func (v *MarkdownClientCapabilities) resolve() ResolvedMarkdownClientCapabilities { if v == nil { return ResolvedMarkdownClientCapabilities{} } return ResolvedMarkdownClientCapabilities{ Parser: v.Parser, Version: derefOr(v.Version), AllowedTags: derefOr(v.AllowedTags), } } // ResolvedGeneralClientCapabilities is a resolved version of GeneralClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // General client capabilities. // // Since: 3.16.0 type ResolvedGeneralClientCapabilities struct { // Client capability that signals how the client // handles stale requests (e.g. a request // for which the client will not process the response // anymore since the information is outdated). // // Since: 3.17.0 StaleRequestSupport ResolvedStaleRequestSupportOptions `json:"staleRequestSupport,omitzero"` // Client capabilities specific to regular expressions. // // Since: 3.16.0 RegularExpressions ResolvedRegularExpressionsClientCapabilities `json:"regularExpressions,omitzero"` // Client capabilities specific to the client's markdown parser. // // Since: 3.16.0 Markdown ResolvedMarkdownClientCapabilities `json:"markdown,omitzero"` // The position encodings supported by the client. Client and server // have to agree on the same position encoding to ensure that offsets // (e.g. character position in a line) are interpreted the same on both // sides. // // To keep the protocol backwards compatible the following applies: if // the value 'utf-16' is missing from the array of position encodings // servers can assume that the client supports UTF-16. UTF-16 is // therefore a mandatory encoding. // // If omitted it defaults to ['utf-16']. // // Implementation considerations: since the conversion from one encoding // into another requires the content of the file / line the conversion // is best done where the file is read which is usually on the server // side. // // Since: 3.17.0 PositionEncodings []PositionEncodingKind `json:"positionEncodings,omitzero"` } func (v *GeneralClientCapabilities) resolve() ResolvedGeneralClientCapabilities { if v == nil { return ResolvedGeneralClientCapabilities{} } return ResolvedGeneralClientCapabilities{ StaleRequestSupport: v.StaleRequestSupport.resolve(), RegularExpressions: v.RegularExpressions.resolve(), Markdown: v.Markdown.resolve(), PositionEncodings: derefOr(v.PositionEncodings), } } // ResolvedExperimentalClientCapabilities is a resolved version of ExperimentalClientCapabilities with all optional fields // converted to non-pointer values for easier access. // // ExperimentalClientCapabilities contains experimental capabilities under development. type ResolvedExperimentalClientCapabilities struct { // The client supports hover verbosityLevel requests and canIncreaseVerbosity responses. HoverVerbosityLevel bool `json:"hoverVerbosityLevel,omitzero"` } func (v *ExperimentalClientCapabilities) resolve() ResolvedExperimentalClientCapabilities { if v == nil { return ResolvedExperimentalClientCapabilities{} } return ResolvedExperimentalClientCapabilities{ HoverVerbosityLevel: derefOr(v.HoverVerbosityLevel), } } // ResolvedClientCapabilities is a version of ClientCapabilities where all nested // fields are values (not pointers), making it easier to access deeply nested capabilities. // Use (*ClientCapabilities).Resolve() to convert from ClientCapabilities. // // Defines the capabilities provided by the client. type ResolvedClientCapabilities struct { // Workspace specific client capabilities. Workspace ResolvedWorkspaceClientCapabilities `json:"workspace,omitzero"` // Text document specific client capabilities. TextDocument ResolvedTextDocumentClientCapabilities `json:"textDocument,omitzero"` // Window specific client capabilities. Window ResolvedWindowClientCapabilities `json:"window,omitzero"` // General client capabilities. // // Since: 3.16.0 General ResolvedGeneralClientCapabilities `json:"general,omitzero"` // Experimental client capabilities. Experimental ResolvedExperimentalClientCapabilities `json:"experimental,omitzero"` // Whether the client supports Visual Studio extensions. VSSupportsVisualStudioExtensions bool `json:"_vs_supportsVisualStudioExtensions,omitzero"` // The snippet version supported by the client. VSSupportedSnippetVersion int32 `json:"_vs_supportedSnippetVersion,omitzero"` // Whether the client supports not including text in textDocument/didOpen notifications. VSSupportsNotIncludingTextInTextDocumentDidOpen bool `json:"_vs_supportsNotIncludingTextInTextDocumentDidOpen,omitzero"` // Whether the client supports icon extensions. VSSupportsIconExtensions bool `json:"_vs_supportsIconExtensions,omitzero"` // Whether the client supports diagnostic requests. VSSupportsDiagnosticRequests bool `json:"_vs_supportsDiagnosticRequests,omitzero"` } func (v *ClientCapabilities) Resolve() ResolvedClientCapabilities { if v == nil { return ResolvedClientCapabilities{} } return ResolvedClientCapabilities{ Workspace: v.Workspace.resolve(), TextDocument: v.TextDocument.resolve(), Window: v.Window.resolve(), General: v.General.resolve(), Experimental: v.Experimental.resolve(), VSSupportsVisualStudioExtensions: derefOr(v.VSSupportsVisualStudioExtensions), VSSupportedSnippetVersion: derefOr(v.VSSupportedSnippetVersion), VSSupportsNotIncludingTextInTextDocumentDidOpen: derefOr(v.VSSupportsNotIncludingTextInTextDocumentDidOpen), VSSupportsIconExtensions: derefOr(v.VSSupportsIconExtensions), VSSupportsDiagnosticRequests: derefOr(v.VSSupportsDiagnosticRequests), } }