Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1ee7f54

Browse files
committed
fix lints
1 parent b1b044f commit 1ee7f54

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

editors/code/src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as lc from "vscode-languageclient";
33
import * as ra from "./lsp_ext";
44
import * as path from "path";
55

6-
import { type Ctx, type Cmd, type CtxInit } from "./ctx";
6+
import type { Ctx, Cmd, CtxInit } from "./ctx";
77
import { applySnippetWorkspaceEdit, applySnippetTextEdits } from "./snippets";
88
import { spawnSync } from "child_process";
99
import { type RunnableQuickPick, selectRunnable, createTask, createArgs } from "./run";
@@ -878,7 +878,7 @@ export function addProject(ctx: CtxInit): Cmd {
878878
}
879879

880880
const command = `${extensionName}.discoverWorkspaceCommand`;
881-
const project = (await vscode.commands.executeCommand(command)) as JsonProject;
881+
const project = await vscode.commands.executeCommand(command);
882882

883883
ctx.addToDiscoveredWorkspaces([project]);
884884

editors/code/src/ctx.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ import { bootstrap } from "./bootstrap";
3030
export type Workspace =
3131
| { kind: "Empty" }
3232
| {
33-
kind: "Workspace Folder";
34-
}
33+
kind: "Workspace Folder";
34+
}
3535
| {
36-
kind: "Detached Files";
37-
files: vscode.TextDocument[];
38-
};
36+
kind: "Detached Files";
37+
files: vscode.TextDocument[];
38+
};
3939

4040
export function fetchWorkspace(): Workspace {
4141
const folders = (vscode.workspace.workspaceFolders || []).filter(
@@ -49,9 +49,9 @@ export function fetchWorkspace(): Workspace {
4949
? rustDocuments.length === 0
5050
? { kind: "Empty" }
5151
: {
52-
kind: "Detached Files",
53-
files: rustDocuments,
54-
}
52+
kind: "Detached Files",
53+
files: rustDocuments,
54+
}
5555
: { kind: "Workspace Folder" };
5656
}
5757

@@ -189,7 +189,7 @@ export class Ctx {
189189
if (this.config.discoverProjectRunner) {
190190
const command = `${this.config.discoverProjectRunner}.discoverWorkspaceCommand`;
191191
log.info(`running command: ${command}`);
192-
const project = (await vscode.commands.executeCommand(command)) as JsonProject;
192+
const project: JsonProject = await vscode.commands.executeCommand(command);
193193
this.addToDiscoveredWorkspaces([project]);
194194
}
195195

@@ -441,8 +441,7 @@ export class Ctx {
441441
}
442442
statusBar.tooltip.appendMarkdown("\n\n[Open Logs](command:rust-analyzer.openLogs)");
443443
statusBar.tooltip.appendMarkdown(
444-
`\n\n[${
445-
this.config.checkOnSave ? "Disable" : "Enable"
444+
`\n\n[${this.config.checkOnSave ? "Disable" : "Enable"
446445
} Check on Save](command:rust-analyzer.toggleCheckOnSave)`,
447446
);
448447
statusBar.tooltip.appendMarkdown(

0 commit comments

Comments
 (0)