Skip to content

Commit 0046ca2

Browse files
Support llmGenerated property on CodeAction (#2020)
* add new property to codeAction * address feedback to use CodeActioTag * wording tweaks * add client capability
1 parent 0a59f91 commit 0046ca2

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

_specifications/lsp/3.18/language/codeAction.md

+37
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ export interface CodeActionClientCapabilities {
107107
* @proposed
108108
*/
109109
documentationSupport?: boolean;
110+
111+
/**
112+
* Client supports the tag property on a code action. Clients
113+
* supporting tags have to handle unknown tags gracefully.
114+
*
115+
* @since 3.18.0 - proposed
116+
*/
117+
tagSupport?: {
118+
/**
119+
* The tags supported by the client.
120+
*/
121+
valueSet: CodeActionTag[];
122+
};
110123
}
111124
```
112125

@@ -412,6 +425,23 @@ export namespace CodeActionTriggerKind {
412425
export type CodeActionTriggerKind = 1 | 2;
413426
```
414427

428+
<div class="anchorHolder"><a href="#codeActionTag" name="codeActionTag" class="linkableAnchor"></a></div>
429+
430+
```typescript
431+
/**
432+
* Code action tags are extra annotations that tweak the behavior of a code action.
433+
*
434+
* @since 3.18.0 - proposed
435+
*/
436+
export namespace CodeActionTag {
437+
/**
438+
* Marks the code action as LLM-generated.
439+
*/
440+
export const LLMGenerated = 1;
441+
}
442+
export type CodeActionTag = 1;
443+
```
444+
415445
_Response_:
416446
* result: `(Command | CodeAction)[]` \| `null` where `CodeAction` is defined as follows:
417447

@@ -505,6 +535,13 @@ export interface CodeAction {
505535
* @since 3.16.0
506536
*/
507537
data?: LSPAny;
538+
539+
/**
540+
* Tags for this code action.
541+
*
542+
* @since 3.18.0 - proposed
543+
*/
544+
tags?: CodeActionTag[];
508545
}
509546
```
510547
* partial result: `(Command | CodeAction)[]`

_specifications/lsp/3.18/metaModel/metaModel.json

+57
Original file line numberDiff line numberDiff line change
@@ -5709,6 +5709,19 @@
57095709
"optional": true,
57105710
"documentation": "A data entry field that is preserved on a code action between\na `textDocument/codeAction` and a `codeAction/resolve` request.\n\n@since 3.16.0",
57115711
"since": "3.16.0"
5712+
},
5713+
{
5714+
"name": "tags",
5715+
"type": {
5716+
"kind": "array",
5717+
"element": {
5718+
"kind": "reference",
5719+
"name": "CodeActionTag"
5720+
}
5721+
},
5722+
"optional": true,
5723+
"documentation": "Tags for this code action.\n\n@since 3.18.0 - proposed",
5724+
"since": "3.18.0 - proposed"
57125725
}
57135726
],
57145727
"documentation": "A code action represents a change that can be performed in code, e.g. to fix a problem or\nto refactor code.\n\nA CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed."
@@ -12511,10 +12524,38 @@
1251112524
"documentation": "Whether the client supports documentation for a class of\ncode actions.\n\n@since 3.18.0\n@proposed",
1251212525
"since": "3.18.0",
1251312526
"proposed": true
12527+
},
12528+
{
12529+
"name": "tagSupport",
12530+
"type": {
12531+
"kind": "reference",
12532+
"name": "CodeActionTagOptions"
12533+
},
12534+
"optional": true,
12535+
"documentation": "Client supports the tag property on a code action. Clients\nsupporting tags have to handle unknown tags gracefully.\n\n@since 3.18.0 - proposed",
12536+
"since": "3.18.0 - proposed"
1251412537
}
1251512538
],
1251612539
"documentation": "The Client Capabilities of a {@link CodeActionRequest}."
1251712540
},
12541+
{
12542+
"name": "CodeActionTagOptions",
12543+
"properties": [
12544+
{
12545+
"name": "valueSet",
12546+
"type": {
12547+
"kind": "array",
12548+
"element": {
12549+
"kind": "reference",
12550+
"name": "CodeActionTag"
12551+
}
12552+
},
12553+
"documentation": "The tags supported by the client."
12554+
}
12555+
],
12556+
"documentation": "@since 3.18.0 - proposed",
12557+
"since": "3.18.0 - proposed"
12558+
},
1251812559
{
1251912560
"name": "CodeLensClientCapabilities",
1252012561
"properties": [
@@ -14602,6 +14643,22 @@
1460214643
"supportsCustomValues": true,
1460314644
"documentation": "A set of predefined code action kinds"
1460414645
},
14646+
{
14647+
"name": "CodeActionTag",
14648+
"type": {
14649+
"kind": "base",
14650+
"name": "uinteger"
14651+
},
14652+
"values": [
14653+
{
14654+
"name": "LLMGenerated",
14655+
"value": 1,
14656+
"documentation": "Marks the code action as LLM-generated."
14657+
}
14658+
],
14659+
"documentation": "Code action tags are extra annotations that tweak the behavior of a code action.\n\n@since 3.18.0 - proposed",
14660+
"since": "3.18.0 - proposed"
14661+
},
1460514662
{
1460614663
"name": "TraceValue",
1460714664
"type": {

0 commit comments

Comments
 (0)