| 69 | } |
| 70 | |
| 71 | async function requestCodeActions( |
| 72 | plugin: LSPPlugin, |
| 73 | range: LspRange, |
| 74 | diagnostics: Diagnostic[] = [], |
| 75 | ): Promise<CodeActionResponse> { |
| 76 | const context: CodeActionContext = { |
| 77 | diagnostics, |
| 78 | triggerKind: 1, // CodeActionTriggerKind.Invoked |
| 79 | }; |
| 80 | |
| 81 | return plugin.client.request< |
| 82 | { |
| 83 | textDocument: { uri: string }; |
| 84 | range: LspRange; |
| 85 | context: CodeActionContext; |
| 86 | }, |
| 87 | CodeActionResponse |
| 88 | >("textDocument/codeAction", { |
| 89 | textDocument: { uri: plugin.uri }, |
| 90 | range, |
| 91 | context, |
| 92 | }); |
| 93 | } |
| 94 | |
| 95 | async function resolveCodeAction( |
| 96 | plugin: LSPPlugin, |