diff --git a/_data/specification-toc.yml b/_data/specification-toc.yml index ef0d21b..9ccec9f 100644 --- a/_data/specification-toc.yml +++ b/_data/specification-toc.yml @@ -84,6 +84,8 @@ anchor: textDocument_hover - title: signatureHelp anchor: textDocument_signatureHelp + - title: declaration + anchor: textDocument_declaration - title: definition anchor: textDocument_definition - title: typeDefinition @@ -125,6 +127,8 @@ - title: Change Log anchor: changeLog children: + - title: 3.14.0 + anchor: version_3_14_0 - title: 3.13.0 anchor: version_3_13_0 - title: 3.12.0 diff --git a/specification.md b/specification.md index b7387c8..627e604 100644 --- a/specification.md +++ b/specification.md @@ -289,6 +289,38 @@ interface Location { } ``` +### LocationLink + +Represents a link between a source and a target location. + +```typescript +interface LocationLink { + + /** + * Span of the origin of this link. + * + * Used as the underlined span for mouse interaction. Defaults to the word range at + * the mouse position. + */ + originSelectionRange?: Range; + + /** + * The target resource identifier of this link. + */ + targetUri: string; + + /** + * The full target range of this link. + */ + targetRange: Range; + + /** + * The span of this link. + */ + targetSelectionRange?: Range; +} +``` + #### Diagnostic Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource. @@ -1284,6 +1316,23 @@ export interface TextDocumentClientCapabilities { dynamicRegistration?: boolean; }; + /** + * Capabilities specific to the `textDocument/declaration` + */ + declaration?: { + /** + * Whether declaration 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?: boolean; + + /** + * The client supports additional metadata in the form of declaration links. + */ + linkSupport?: boolean; + }; + /** * Capabilities specific to the `textDocument/definition` */ @@ -1292,6 +1341,11 @@ export interface TextDocumentClientCapabilities { * Whether definition supports dynamic registration. */ dynamicRegistration?: boolean; + + /** + * The client supports additional metadata in the form of definition links. + */ + linkSupport?: boolean; }; /** @@ -1306,6 +1360,11 @@ export interface TextDocumentClientCapabilities { * return value for the corresponding server capability as well. */ dynamicRegistration?: boolean; + + /** + * The client supports additional metadata in the form of definition links. + */ + linkSupport?: boolean; }; /** @@ -1320,6 +1379,11 @@ export interface TextDocumentClientCapabilities { * return value for the corresponding server capability as well. */ dynamicRegistration?: boolean; + + /** + * The client supports additional metadata in the form of definition links. + */ + linkSupport?: boolean; }; /** @@ -3196,17 +3260,38 @@ export interface SignatureHelpRegistrationOptions extends TextDocumentRegistrati triggerCharacters?: string[]; } ``` +#### Goto Declaration Request (:leftwards_arrow_with_hook:) + +> *Since version 3.14.0* + +The goto declaration request is sent from the client to the server to resolve the declaration location of a symbol at a given text document position. + +The result type [`LocationLink](#locationLink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.textDocument.declaration.linkSupport`. + +_Request_: +* method: 'textDocument/declaration' +* params: [`TextDocumentPositionParams`](#textdocumentpositionparams) + +_Response_: +* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink](#locationLink)[] \|`null` +* error: code and message set in case an exception happens during the declaration request. + +_Registration Options_: `TextDocumentRegistrationOptions` #### Goto Definition Request (:leftwards_arrow_with_hook:) +> *Since version 3.14.0* + The goto definition request is sent from the client to the server to resolve the definition location of a symbol at a given text document position. +The result type [`LocationLink](#locationLink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.textDocument.definition.linkSupport`. + _Request_: * method: 'textDocument/definition' * params: [`TextDocumentPositionParams`](#textdocumentpositionparams) _Response_: -* result: [`Location`](#location) \| [`Location`](#location)[] \| `null` +* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink](#locationLink)[] \| `null` * error: code and message set in case an exception happens during the definition request. _Registration Options_: `TextDocumentRegistrationOptions` @@ -3217,12 +3302,14 @@ _Registration Options_: `TextDocumentRegistrationOptions` The goto type definition request is sent from the client to the server to resolve the type definition location of a symbol at a given text document position. +The result type [`LocationLink](#locationLink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.textDocument.typeDefinition.linkSupport`. + _Request_: * method: 'textDocument/typeDefinition' * params: [`TextDocumentPositionParams`](#textdocumentpositionparams) _Response_: -* result: [`Location`](#location) \| [`Location`](#location)[] \| `null` +* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink](#locationLink)[] \| `null` * error: code and message set in case an exception happens during the definition request. _Registration Options_: `TextDocumentRegistrationOptions` @@ -3233,12 +3320,14 @@ _Registration Options_: `TextDocumentRegistrationOptions` The goto implementation request is sent from the client to the server to resolve the implementation location of a symbol at a given text document position. +The result type [`LocationLink](#locationLink)[] got introduce with version 3.14.0 and depends in the corresponding client capability `clientCapabilities.implementation.typeDefinition.linkSupport`. + _Request_: * method: 'textDocument/implementation' * params: [`TextDocumentPositionParams`](#textdocumentpositionparams) _Response_: -* result: [`Location`](#location) \| [`Location`](#location)[] \| `null` +* result: [`Location`](#location) \| [`Location`](#location)[] \| [`LocationLink](#locationLink)[] \| `null` * error: code and message set in case an exception happens during the definition request. _Registration Options_: `TextDocumentRegistrationOptions`