mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
fix lints
This commit is contained in:
parent
b1b044f2d5
commit
1ee7f54fa6
2 changed files with 12 additions and 13 deletions
|
@ -3,7 +3,7 @@ import * as lc from "vscode-languageclient";
|
||||||
import * as ra from "./lsp_ext";
|
import * as ra from "./lsp_ext";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
|
|
||||||
import { type Ctx, type Cmd, type CtxInit } from "./ctx";
|
import type { Ctx, Cmd, CtxInit } from "./ctx";
|
||||||
import { applySnippetWorkspaceEdit, applySnippetTextEdits } from "./snippets";
|
import { applySnippetWorkspaceEdit, applySnippetTextEdits } from "./snippets";
|
||||||
import { spawnSync } from "child_process";
|
import { spawnSync } from "child_process";
|
||||||
import { type RunnableQuickPick, selectRunnable, createTask, createArgs } from "./run";
|
import { type RunnableQuickPick, selectRunnable, createTask, createArgs } from "./run";
|
||||||
|
@ -878,7 +878,7 @@ export function addProject(ctx: CtxInit): Cmd {
|
||||||
}
|
}
|
||||||
|
|
||||||
const command = `${extensionName}.discoverWorkspaceCommand`;
|
const command = `${extensionName}.discoverWorkspaceCommand`;
|
||||||
const project = (await vscode.commands.executeCommand(command)) as JsonProject;
|
const project = await vscode.commands.executeCommand(command);
|
||||||
|
|
||||||
ctx.addToDiscoveredWorkspaces([project]);
|
ctx.addToDiscoveredWorkspaces([project]);
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,12 @@ import { bootstrap } from "./bootstrap";
|
||||||
export type Workspace =
|
export type Workspace =
|
||||||
| { kind: "Empty" }
|
| { kind: "Empty" }
|
||||||
| {
|
| {
|
||||||
kind: "Workspace Folder";
|
kind: "Workspace Folder";
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
kind: "Detached Files";
|
kind: "Detached Files";
|
||||||
files: vscode.TextDocument[];
|
files: vscode.TextDocument[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export function fetchWorkspace(): Workspace {
|
export function fetchWorkspace(): Workspace {
|
||||||
const folders = (vscode.workspace.workspaceFolders || []).filter(
|
const folders = (vscode.workspace.workspaceFolders || []).filter(
|
||||||
|
@ -49,9 +49,9 @@ export function fetchWorkspace(): Workspace {
|
||||||
? rustDocuments.length === 0
|
? rustDocuments.length === 0
|
||||||
? { kind: "Empty" }
|
? { kind: "Empty" }
|
||||||
: {
|
: {
|
||||||
kind: "Detached Files",
|
kind: "Detached Files",
|
||||||
files: rustDocuments,
|
files: rustDocuments,
|
||||||
}
|
}
|
||||||
: { kind: "Workspace Folder" };
|
: { kind: "Workspace Folder" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ export class Ctx {
|
||||||
if (this.config.discoverProjectRunner) {
|
if (this.config.discoverProjectRunner) {
|
||||||
const command = `${this.config.discoverProjectRunner}.discoverWorkspaceCommand`;
|
const command = `${this.config.discoverProjectRunner}.discoverWorkspaceCommand`;
|
||||||
log.info(`running command: ${command}`);
|
log.info(`running command: ${command}`);
|
||||||
const project = (await vscode.commands.executeCommand(command)) as JsonProject;
|
const project: JsonProject = await vscode.commands.executeCommand(command);
|
||||||
this.addToDiscoveredWorkspaces([project]);
|
this.addToDiscoveredWorkspaces([project]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,8 +441,7 @@ export class Ctx {
|
||||||
}
|
}
|
||||||
statusBar.tooltip.appendMarkdown("\n\n[Open Logs](command:rust-analyzer.openLogs)");
|
statusBar.tooltip.appendMarkdown("\n\n[Open Logs](command:rust-analyzer.openLogs)");
|
||||||
statusBar.tooltip.appendMarkdown(
|
statusBar.tooltip.appendMarkdown(
|
||||||
`\n\n[${
|
`\n\n[${this.config.checkOnSave ? "Disable" : "Enable"
|
||||||
this.config.checkOnSave ? "Disable" : "Enable"
|
|
||||||
} Check on Save](command:rust-analyzer.toggleCheckOnSave)`,
|
} Check on Save](command:rust-analyzer.toggleCheckOnSave)`,
|
||||||
);
|
);
|
||||||
statusBar.tooltip.appendMarkdown(
|
statusBar.tooltip.appendMarkdown(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue