diff options
| author | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2023-06-28 04:03:53 +0900 |
|---|---|---|
| committer | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2023-07-06 16:17:02 +0900 |
| commit | 72a3883a7128b4eae6f38d6479f33aaaaae4790b (patch) | |
| tree | 60b9d6f755bbefeca335bcbc10d0832abc719c48 /editors/code/src/client.ts | |
| parent | bb35d8fa8ef9de3c8282602b411c40b266dc3a4e (diff) | |
| download | rust-72a3883a7128b4eae6f38d6479f33aaaaae4790b.tar.gz rust-72a3883a7128b4eae6f38d6479f33aaaaae4790b.zip | |
editor/code: Enable `noUncheckedIndexedAccess` ts option
https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess
Diffstat (limited to 'editors/code/src/client.ts')
| -rw-r--r-- | editors/code/src/client.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index f721fcce766..7b151c804af 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -9,6 +9,7 @@ import { WorkspaceEdit } from "vscode"; import { Config, prepareVSCodeConfig } from "./config"; import { randomUUID } from "crypto"; import { sep as pathSeparator } from "path"; +import { unwrapUndefinable } from "./undefinable"; export interface Env { [name: string]: string; @@ -323,10 +324,12 @@ export async function createClient( } for (const [group, { index, items }] of groups) { if (items.length === 1) { - result[index] = items[0]; + const item = unwrapUndefinable(items[0]); + result[index] = item; } else { const action = new vscode.CodeAction(group); - action.kind = items[0].kind; + const item = unwrapUndefinable(items[0]); + action.kind = item.kind; action.command = { command: "rust-analyzer.applyActionGroup", title: "", |
