diff --git a/client-node-tests/package-lock.json b/client-node-tests/package-lock.json index f9f2a7e05..7d1ab345f 100644 --- a/client-node-tests/package-lock.json +++ b/client-node-tests/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "minimatch": "^3.0.4", - "vscode-languageserver": "8.1.0", + "vscode-languageserver": "8.1.0-next.1", "vscode-uri": "3.0.3" }, "devDependencies": { @@ -672,37 +672,37 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", - "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", + "version": "8.1.0-next.1", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.1.tgz", + "integrity": "sha512-FiPG+9TuMIga3t+kkalQytwqMtJu1djI+Pq+Ut2tvAJpcNHDJ0PYdjFv5mgEvTEJLujrYwjWHVkNe+XfHPBD/w==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", - "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "version": "8.1.0-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.1.tgz", + "integrity": "sha512-u14Rk4JgXI+7iS6AEXI2pNc1dWh/5JEXtaqa4TeBECKJlN+5242mbGBBPaHMOE7sSI1Kh66XhEMZJhPYjUfjHw==", "dependencies": { - "vscode-languageserver-protocol": "3.17.3" + "vscode-languageserver-protocol": "3.17.3-next.1" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", - "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "version": "3.17.3-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.1.tgz", + "integrity": "sha512-vgjvPE0zox+1Fi4ljsSFJ+B3g8wGNbuAEEdulueVdv+R2VHtc06+dgxhWiG4LKPqXwjPDmiuxCnvd2xk3fzTTw==", "dependencies": { - "vscode-jsonrpc": "8.1.0", - "vscode-languageserver-types": "3.17.3" + "vscode-jsonrpc": "8.1.0-next.1", + "vscode-languageserver-types": "3.17.2" } }, "node_modules/vscode-languageserver-types": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", - "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", + "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" }, "node_modules/vscode-test": { "version": "1.6.1", @@ -1275,31 +1275,31 @@ "dev": true }, "vscode-jsonrpc": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", - "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==" + "version": "8.1.0-next.1", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.1.tgz", + "integrity": "sha512-FiPG+9TuMIga3t+kkalQytwqMtJu1djI+Pq+Ut2tvAJpcNHDJ0PYdjFv5mgEvTEJLujrYwjWHVkNe+XfHPBD/w==" }, "vscode-languageserver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", - "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "version": "8.1.0-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.1.tgz", + "integrity": "sha512-u14Rk4JgXI+7iS6AEXI2pNc1dWh/5JEXtaqa4TeBECKJlN+5242mbGBBPaHMOE7sSI1Kh66XhEMZJhPYjUfjHw==", "requires": { - "vscode-languageserver-protocol": "3.17.3" + "vscode-languageserver-protocol": "3.17.3-next.1" } }, "vscode-languageserver-protocol": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", - "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "version": "3.17.3-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.1.tgz", + "integrity": "sha512-vgjvPE0zox+1Fi4ljsSFJ+B3g8wGNbuAEEdulueVdv+R2VHtc06+dgxhWiG4LKPqXwjPDmiuxCnvd2xk3fzTTw==", "requires": { - "vscode-jsonrpc": "8.1.0", - "vscode-languageserver-types": "3.17.3" + "vscode-jsonrpc": "8.1.0-next.1", + "vscode-languageserver-types": "3.17.2" } }, "vscode-languageserver-types": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", - "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", + "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" }, "vscode-test": { "version": "1.6.1", diff --git a/client-node-tests/src/converter.test.ts b/client-node-tests/src/converter.test.ts index acbe6d538..3a645d59f 100644 --- a/client-node-tests/src/converter.test.ts +++ b/client-node-tests/src/converter.test.ts @@ -1248,7 +1248,7 @@ suite('Protocol Converter', () => { const items: proto.InlineCompletionItem[] = [ proto.InlineCompletionItem.create('insert text', 'in', proto.Range.create(1, 2, 6, 7)), proto.InlineCompletionItem.create('insert text', 'in', proto.Range.create(1, 2, 6, 7), undefined), - proto.InlineCompletionItem.create(proto.SnippetString.create('insert text'), 'in', proto.Range.create(1, 2, 6, 7), undefined), + proto.InlineCompletionItem.create(proto.StringValue.create('insert text'), 'in', proto.Range.create(1, 2, 6, 7), undefined), ]; const result = await p2c.asInlineCompletionResult(items); diff --git a/protocol/metaModel.json b/protocol/metaModel.json index 3d2ed139f..c6ead70e6 100644 --- a/protocol/metaModel.json +++ b/protocol/metaModel.json @@ -1013,8 +1013,9 @@ "kind": "reference", "name": "InlineCompletionRegistrationOptions" }, - "documentation": "A request to provide inline completions in a document. The request's parameter is of\ntype {@link InlineCompletionParams}, the response is of type\n{@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "A request to provide inline completions in a document. The request's parameter is of\ntype {@link InlineCompletionParams}, the response is of type\n{@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "method": "client/registerCapability", @@ -4100,8 +4101,9 @@ "name": "WorkDoneProgressParams" } ], - "documentation": "A parameter literal used in inline completion requests.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "A parameter literal used in inline completion requests.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "InlineCompletionList", @@ -4134,7 +4136,7 @@ }, { "kind": "reference", - "name": "SnippetString" + "name": "StringValue" } ] }, @@ -4168,8 +4170,9 @@ "documentation": "An optional {@link Command} that is executed *after* inserting this completion." } ], - "documentation": "An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "InlineCompletionRegistrationOptions", @@ -4190,8 +4193,9 @@ "name": "StaticRegistrationOptions" } ], - "documentation": "Inline completion options used during static or dynamic registration.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Inline completion options used during static or dynamic registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "RegistrationParams", @@ -7773,12 +7777,21 @@ "documentation": "Provides information about the currently selected item in the autocomplete widget if it is visible." } ], - "documentation": "Provides information about the context in which an inline completion was requested.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Provides information about the context in which an inline completion was requested.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "SnippetString", + "name": "StringValue", "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "snippet" + }, + "documentation": "The kind of string value." + }, { "name": "value", "type": { @@ -7788,8 +7801,9 @@ "documentation": "The snippet string." } ], - "documentation": "A snippet string is a template which allows to insert text\nand to control the editor cursor when insertion happens.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Variables are defined with `$name` and\n`${name:default value}`.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "A string value used as a snippet is a template which allows to insert text\nand to control the editor cursor when insertion happens.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Variables are defined with `$name` and\n`${name:default value}`.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "InlineCompletionOptions", @@ -7800,8 +7814,9 @@ } ], "properties": [], - "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "Registration", @@ -8623,8 +8638,9 @@ ] }, "optional": true, - "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "workspace", @@ -9919,8 +9935,9 @@ "documentation": "The text the range will be replaced with if this completion is accepted." } ], - "documentation": "Describes the currently selected completion item.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Describes the currently selected completion item.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "ClientCapabilities", @@ -10865,8 +10882,9 @@ "name": "InlineCompletionClientCapabilities" }, "optional": true, - "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true } ], "documentation": "Text document specific client capabilities." @@ -12704,8 +12722,9 @@ "documentation": "Whether implementation supports dynamic registration for inline completion providers." } ], - "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "NotebookDocumentSyncClientCapabilities", @@ -13719,8 +13738,9 @@ "documentation": "Completion was triggered automatically while editing." } ], - "documentation": "Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n\n@since 3.18.0", - "since": "3.18.0" + "documentation": "Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "PositionEncodingKind", diff --git a/protocol/src/common/protocol.inlineCompletion.ts b/protocol/src/common/protocol.inlineCompletion.ts index 9c9b46f8c..d69d959c6 100644 --- a/protocol/src/common/protocol.inlineCompletion.ts +++ b/protocol/src/common/protocol.inlineCompletion.ts @@ -15,6 +15,7 @@ import type { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRe * Client capabilities specific to inline completions. * * @since 3.18.0 + * @proposed */ export type InlineCompletionClientCapabilities = { /** @@ -27,6 +28,7 @@ export type InlineCompletionClientCapabilities = { * Inline completion options used during static registration. * * @since 3.18.0 + * @proposed */ export type InlineCompletionOptions = WorkDoneProgressOptions; @@ -34,6 +36,7 @@ export type InlineCompletionOptions = WorkDoneProgressOptions; * Inline completion options used during static or dynamic registration. * * @since 3.18.0 + * @proposed */ export type InlineCompletionRegistrationOptions = InlineCompletionOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions; @@ -41,6 +44,7 @@ export type InlineCompletionRegistrationOptions = InlineCompletionOptions & Text * A parameter literal used in inline completion requests. * * @since 3.18.0 + * @proposed */ export type InlineCompletionParams = WorkDoneProgressParams & TextDocumentPositionParams & { /** @@ -56,6 +60,7 @@ export type InlineCompletionParams = WorkDoneProgressParams & TextDocumentPositi * {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such. * * @since 3.18.0 + * @proposed */ export namespace InlineCompletionRequest { export const method: 'textDocument/inlineCompletion' = 'textDocument/inlineCompletion'; diff --git a/protocol/src/common/protocol.ts b/protocol/src/common/protocol.ts index fa1902161..01420e14b 100644 --- a/protocol/src/common/protocol.ts +++ b/protocol/src/common/protocol.ts @@ -747,6 +747,7 @@ export interface TextDocumentClientCapabilities { * Client capabilities specific to inline completions. * * @since 3.18.0 + * @proposed */ inlineCompletion?: InlineCompletionClientCapabilities; } @@ -1260,6 +1261,7 @@ export interface ServerCapabilities { * Inline completion options used during static registration. * * @since 3.18.0 + * @proposed */ inlineCompletionProvider?: boolean | InlineCompletionOptions; diff --git a/types/src/main.ts b/types/src/main.ts index 7176b0169..361d87486 100644 --- a/types/src/main.ts +++ b/types/src/main.ts @@ -4088,7 +4088,7 @@ export namespace InlayHint { } /** - * A snippet string is a template which allows to insert text + * 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` @@ -4097,17 +4097,22 @@ export namespace InlayHint { * `${name:default value}`. * * @since 3.18.0 + * @proposed */ -export interface SnippetString { +export interface StringValue { + /** + * The kind of string value. + */ + kind: 'snippet'; /** * The snippet string. */ value: string; } -export namespace SnippetString { - export function create(value: string) { - return { value }; +export namespace StringValue { + export function create(value: string): StringValue { + return { value, kind: 'snippet' }; } } @@ -4115,12 +4120,13 @@ export namespace SnippetString { * An inline completion item represents a text snippet that is proposed inline to complete text that is being typed. * * @since 3.18.0 + * @proposed */ export interface InlineCompletionItem { /** * The text to replace the range with. Must be set. */ - insertText: string | SnippetString; + insertText: string | StringValue; /** * A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used. @@ -4139,7 +4145,7 @@ export interface InlineCompletionItem { } export namespace InlineCompletionItem { - export function create(insertText: string | SnippetString, filterText?: string, range?: Range, command?: Command): InlineCompletionItem { + export function create(insertText: string | StringValue, filterText?: string, range?: Range, command?: Command): InlineCompletionItem { return { insertText, filterText, range, command }; } } @@ -4164,6 +4170,7 @@ export namespace InlineCompletionList { * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered. * * @since 3.18.0 + * @proposed */ export namespace InlineCompletionTriggerKind { /** @@ -4183,6 +4190,7 @@ export type InlineCompletionTriggerKind = 0 | 1; * Describes the currently selected completion item. * * @since 3.18.0 + * @proposed */ export interface SelectedCompletionInfo { /** @@ -4206,6 +4214,7 @@ export namespace SelectedCompletionInfo { * Provides information about the context in which an inline completion was requested. * * @since 3.18.0 + * @proposed */ export interface InlineCompletionContext { /**