mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
fix: Fix runnables being incorrectly constructed
This commit is contained in:
parent
7733403056
commit
bb9678ea3b
8 changed files with 223 additions and 113 deletions
|
@ -4,6 +4,7 @@ import * as path from "path";
|
|||
import * as vscode from "vscode";
|
||||
import { type Env, log, unwrapUndefinable, expectNotUndefined } from "./util";
|
||||
import type { JsonProject } from "./rust_project";
|
||||
import type { Disposable } from "./ctx";
|
||||
|
||||
export type RunnableEnvCfgItem = {
|
||||
mask?: string;
|
||||
|
@ -29,22 +30,9 @@ export class Config {
|
|||
(opt) => `${this.rootSection}.${opt}`,
|
||||
);
|
||||
|
||||
readonly package: {
|
||||
version: string;
|
||||
releaseTag: string | null;
|
||||
enableProposedApi: boolean | undefined;
|
||||
} = vscode.extensions.getExtension(this.extensionId)!.packageJSON;
|
||||
|
||||
readonly globalStorageUri: vscode.Uri;
|
||||
|
||||
constructor(ctx: vscode.ExtensionContext) {
|
||||
this.globalStorageUri = ctx.globalStorageUri;
|
||||
constructor(disposables: Disposable[]) {
|
||||
this.discoveredWorkspaces = [];
|
||||
vscode.workspace.onDidChangeConfiguration(
|
||||
this.onDidChangeConfiguration,
|
||||
this,
|
||||
ctx.subscriptions,
|
||||
);
|
||||
vscode.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, disposables);
|
||||
this.refreshLogging();
|
||||
this.configureLanguage();
|
||||
}
|
||||
|
@ -55,7 +43,10 @@ export class Config {
|
|||
|
||||
private refreshLogging() {
|
||||
log.setEnabled(this.traceExtension ?? false);
|
||||
log.info("Extension version:", this.package.version);
|
||||
log.info(
|
||||
"Extension version:",
|
||||
vscode.extensions.getExtension(this.extensionId)!.packageJSON.version,
|
||||
);
|
||||
|
||||
const cfg = Object.entries(this.cfg).filter(([_, val]) => !(val instanceof Function));
|
||||
log.info("Using configuration", Object.fromEntries(cfg));
|
||||
|
@ -277,10 +268,6 @@ export class Config {
|
|||
return this.get<string[]>("runnables.problemMatcher") || [];
|
||||
}
|
||||
|
||||
get cargoRunner() {
|
||||
return this.get<string | undefined>("cargoRunner");
|
||||
}
|
||||
|
||||
get testExplorer() {
|
||||
return this.get<boolean | undefined>("testExplorer");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue