mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
editor/code: Enable noUncheckedIndexedAccess
ts option
https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess
This commit is contained in:
parent
bb35d8fa8e
commit
72a3883a71
14 changed files with 124 additions and 52 deletions
|
@ -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: "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue