Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support llmGenerated property on CodeAction #2020

Merged
merged 4 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions _specifications/lsp/3.18/language/codeAction.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ export interface CodeActionClientCapabilities {
* @proposed
*/
documentationSupport?: boolean;

/**
* Client supports the tag property on a code action. Clients
* supporting tags have to handle unknown tags gracefully.
*
* @since 3.18.0 - proposed
*/
tagSupport?: {
/**
* The tags supported by the client.
*/
valueSet: CodeActionTag[];
};
}
```

Expand Down Expand Up @@ -412,6 +425,23 @@ export namespace CodeActionTriggerKind {
export type CodeActionTriggerKind = 1 | 2;
```

<div class="anchorHolder"><a href="#codeActionTag" name="codeActionTag" class="linkableAnchor"></a></div>

```typescript
/**
* Code action tags are extra annotations that tweak the behavior of a code action.
*
* @since 3.18.0 - proposed
*/
export namespace CodeActionTag {
/**
* Marks the code action as LLM-generated.
*/
export const LLMGenerated = 1;
}
export type CodeActionTag = 1;
```

_Response_:
* result: `(Command | CodeAction)[]` \| `null` where `CodeAction` is defined as follows:

Expand Down Expand Up @@ -505,6 +535,13 @@ export interface CodeAction {
* @since 3.16.0
*/
data?: LSPAny;

/**
* Tags for this code action.
*
* @since 3.18.0 - proposed
*/
tags?: CodeActionTag[];
}
```
* partial result: `(Command | CodeAction)[]`
Expand Down
57 changes: 57 additions & 0 deletions _specifications/lsp/3.18/metaModel/metaModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -5709,6 +5709,19 @@
"optional": true,
"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",
"since": "3.16.0"
},
{
"name": "tags",
"type": {
"kind": "array",
"element": {
"kind": "reference",
"name": "CodeActionTag"
}
},
"optional": true,
"documentation": "Tags for this code action.\n\n@since 3.18.0 - proposed",
"since": "3.18.0 - proposed"
}
],
"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."
Expand Down Expand Up @@ -12511,10 +12524,38 @@
"documentation": "Whether the client supports documentation for a class of\ncode actions.\n\n@since 3.18.0\n@proposed",
"since": "3.18.0",
"proposed": true
},
{
"name": "tagSupport",
"type": {
"kind": "reference",
"name": "CodeActionTagOptions"
},
"optional": true,
"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",
"since": "3.18.0 - proposed"
}
],
"documentation": "The Client Capabilities of a {@link CodeActionRequest}."
},
{
"name": "CodeActionTagOptions",
"properties": [
{
"name": "valueSet",
"type": {
"kind": "array",
"element": {
"kind": "reference",
"name": "CodeActionTag"
}
},
"documentation": "The tags supported by the client."
}
],
"documentation": "@since 3.18.0 - proposed",
"since": "3.18.0 - proposed"
},
{
"name": "CodeLensClientCapabilities",
"properties": [
Expand Down Expand Up @@ -14602,6 +14643,22 @@
"supportsCustomValues": true,
"documentation": "A set of predefined code action kinds"
},
{
"name": "CodeActionTag",
"type": {
"kind": "base",
"name": "uinteger"
},
"values": [
{
"name": "LLMGenerated",
"value": 1,
"documentation": "Marks the code action as LLM-generated."
}
],
"documentation": "Code action tags are extra annotations that tweak the behavior of a code action.\n\n@since 3.18.0 - proposed",
"since": "3.18.0 - proposed"
},
{
"name": "TraceValue",
"type": {
Expand Down