Skip to content

Commit

Permalink
Add proposed annot, rename StringValue, update meta
Browse files Browse the repository at this point in the history
  • Loading branch information
c-claeys committed Mar 9, 2023
1 parent 980a5e2 commit 5167b24
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 65 deletions.
62 changes: 31 additions & 31 deletions client-node-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-node-tests/src/converter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
72 changes: 46 additions & 26 deletions protocol/metaModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -4134,7 +4136,7 @@
},
{
"kind": "reference",
"name": "SnippetString"
"name": "StringValue"
}
]
},
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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": {
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions protocol/src/common/protocol.inlineCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRe
* Client capabilities specific to inline completions.
*
* @since 3.18.0
* @proposed
*/
export type InlineCompletionClientCapabilities = {
/**
Expand All @@ -27,20 +28,23 @@ export type InlineCompletionClientCapabilities = {
* Inline completion options used during static registration.
*
* @since 3.18.0
* @proposed
*/
export type InlineCompletionOptions = WorkDoneProgressOptions;

/**
* Inline completion options used during static or dynamic registration.
*
* @since 3.18.0
* @proposed
*/
export type InlineCompletionRegistrationOptions = InlineCompletionOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;

/**
* A parameter literal used in inline completion requests.
*
* @since 3.18.0
* @proposed
*/
export type InlineCompletionParams = WorkDoneProgressParams & TextDocumentPositionParams & {
/**
Expand All @@ -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';
Expand Down
2 changes: 2 additions & 0 deletions protocol/src/common/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ export interface TextDocumentClientCapabilities {
* Client capabilities specific to inline completions.
*
* @since 3.18.0
* @proposed
*/
inlineCompletion?: InlineCompletionClientCapabilities;
}
Expand Down Expand Up @@ -1260,6 +1261,7 @@ export interface ServerCapabilities<T = LSPAny> {
* Inline completion options used during static registration.
*
* @since 3.18.0
* @proposed
*/
inlineCompletionProvider?: boolean | InlineCompletionOptions;

Expand Down
Loading

0 comments on commit 5167b24

Please sign in to comment.