diff --git a/_specifications/lsp/3.18/language/callHierarchy.md b/_specifications/lsp/3.18/language/callHierarchy.md index 6567d119b..8a8496a9c 100644 --- a/_specifications/lsp/3.18/language/callHierarchy.md +++ b/_specifications/lsp/3.18/language/callHierarchy.md @@ -23,6 +23,13 @@ interface CallHierarchyClientCapabilities { * capability as well. */ dynamicRegistration?: boolean; + + /** + * Determines whether the client supports reference tags. If the value is missing, + * the server assumes that the client does not support reference tags. + * @since 3.18.0 + */ + referenceTagsSupport?: boolean; } ``` @@ -69,6 +76,19 @@ _Response_:
```typescript +export namespace ReferenceTag { + /** + * Determines a read access to the referenced symbol. + */ + export const Read = 1; + /** + * Determines a write access to the referenced symbol. + */ + export const Write = 2; +} + +export type ReferenceTag = 1 | 2; + export interface CallHierarchyItem { /** * The name of this item. @@ -85,6 +105,11 @@ export interface CallHierarchyItem { */ tags?: SymbolTag[]; + /** + * Reference tags of this item. + */ + referenceTags?: ReferenceTag[]; + /** * More detail for this item, e.g. the signature of a function. */ diff --git a/_specifications/lsp/3.18/language/references.md b/_specifications/lsp/3.18/language/references.md index e7d2e0303..9911a9d70 100644 --- a/_specifications/lsp/3.18/language/references.md +++ b/_specifications/lsp/3.18/language/references.md @@ -10,10 +10,18 @@ _Client Capability_: ```typescript export interface ReferenceClientCapabilities { - /** - * Whether references supports dynamic registration. - */ - dynamicRegistration?: boolean; + /** + * Whether references supports dynamic registration. + */ + dynamicRegistration?: boolean; + + /** + * Determines whether the client supports and prefers Reference items instead + * of Location items. If this value is missing, the server assumes that the + * client accepts Location items as defined in earlier versions of the protocol. + * @since 3.18.0 + */ + referenceItemsSupport?: boolean; } ``` @@ -62,6 +70,6 @@ export interface ReferenceContext { } ``` _Response_: -* result: [`Location`](#location)[] \| `null` -* partial result: [`Location`](#location)[] +* result: [`Location`](#location)[] \| [`Reference`](#reference)[] \| `null` +* partial result: [`Location`](#location)[] \| [`Reference`](#reference)[] * error: code and message set in case an exception happens during the reference request. diff --git a/_specifications/lsp/3.18/metaModel/metaModel.json b/_specifications/lsp/3.18/metaModel/metaModel.json index a69917b1a..78617d540 100644 --- a/_specifications/lsp/3.18/metaModel/metaModel.json +++ b/_specifications/lsp/3.18/metaModel/metaModel.json @@ -3043,6 +3043,18 @@ "optional": true, "documentation": "Tags for this item." }, + { + "name": "referenceTags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ReferenceTag" + } + }, + "optional": true, + "documentation": "Reference tags for this item, i.e. determines the operations on the referenced symbol, read, write or both" + }, { "name": "detail", "type": { @@ -12722,6 +12734,16 @@ }, "optional": true, "documentation": "Whether references supports dynamic registration." + }, + { + "name": "referenceItemsSupport", + "type": { + "kind": "reference", + "name": "ClientReferenceTagSupportOption" + }, + "optional": true, + "documentation": "Determines whether the client supports and prefers Reference items instead\nof Location items. If this value is missing, the server assumes that the\nclient accepts Location items as defined in earlier versions of the protocol.", + "since": "3.18.0" } ], "documentation": "Client Capabilities for a {@link ReferencesRequest}." @@ -13153,6 +13175,16 @@ }, "optional": true, "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "referenceTagsSupport", + "type": { + "kind": "reference", + "name": "ClientReferenceTagSupportOption" + }, + "optional": true, + "documentation": "Determines whether the client supports reference tags.", + "since": "3.18.0" } ], "documentation": "@since 3.16.0", @@ -14573,6 +14605,27 @@ "documentation": "Symbol tags are extra annotations that tweak the rendering of a symbol.\n\n@since 3.16", "since": "3.16" }, + { + "name": "RferenceTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Read", + "value": 1, + "documentation": "Determines a read access to the referenced symbol." + }, + { + "name": "Write", + "value": 2, + "documentation": "Determines a write access to the referenced symbol." + } + ], + "documentation": "Reference tags are extra annotations that provide additional information about references.\n\n@since 3.18", + "since": "3.18" + }, { "name": "UniquenessLevel", "type": { diff --git a/_specifications/lsp/3.18/types/reference.md b/_specifications/lsp/3.18/types/reference.md new file mode 100644 index 000000000..d8324a877 --- /dev/null +++ b/_specifications/lsp/3.18/types/reference.md @@ -0,0 +1,20 @@ +#### Reference + +> *Since version 3.18.0* + +Represents a reference inside the workspace. A reference has a location and can have one or more tags. + +```typescript +interface Reference { + /** + * The location of this reference. + * @since 3.18.0 + */ + location: Location; + /** + * Optional, one or more tags describing this reference. + * @since 3.18.0 + */ + referenceTags?: ReferenceTag[]; +} +```