Auto merge of #13413 - rust-lang:revert-13367-fix-problem-matchers, r=jonas-schievink
Revert "fix: in VSCode, correctly resolve relative paths to errors" Reverts rust-lang/rust-analyzer#13367 I didn't manage to figure out what exactly is the issue, so reverting this to fix https://github.com/rust-lang/rust-analyzer/issues/13404 before monday.
This commit is contained in:
commit
44fbe522e3
@ -1301,15 +1301,6 @@
|
|||||||
"endsPattern": "^\\[Finished running\\b"
|
"endsPattern": "^\\[Finished running\\b"
|
||||||
},
|
},
|
||||||
"pattern": "$rustc"
|
"pattern": "$rustc"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rustc-run",
|
|
||||||
"base": "$rustc",
|
|
||||||
"fileLocation": [
|
|
||||||
"autoDetect",
|
|
||||||
"${command:rust-analyzer.cargoWorkspaceRootForCurrentRun}"
|
|
||||||
],
|
|
||||||
"pattern": "$rustc-run"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"colors": [
|
"colors": [
|
||||||
|
@ -842,7 +842,6 @@ export function run(ctx: Ctx): Cmd {
|
|||||||
item.detail = "rerun";
|
item.detail = "rerun";
|
||||||
prevRunnable = item;
|
prevRunnable = item;
|
||||||
const task = await createTask(item.runnable, ctx.config);
|
const task = await createTask(item.runnable, ctx.config);
|
||||||
ctx.cargoWorkspaceRootForCurrentRun = item.cargoWorkspaceRoot;
|
|
||||||
return await vscode.tasks.executeTask(task);
|
return await vscode.tasks.executeTask(task);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -947,6 +946,3 @@ export function linkToCommand(ctx: Ctx): Cmd {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export function getCargoWorkspaceDir(ctx: Ctx): Cmd {
|
|
||||||
return async () => ctx.cargoWorkspaceRootForCurrentRun;
|
|
||||||
}
|
|
||||||
|
@ -17,10 +17,6 @@ export type Workspace =
|
|||||||
};
|
};
|
||||||
|
|
||||||
export class Ctx {
|
export class Ctx {
|
||||||
// Helps VS Code to correctly link problems from runnables. This is used by
|
|
||||||
// `rust-analyzer.cargoWorkspaceRootForCurrentRun` command of $rustc-run problem matcher.
|
|
||||||
cargoWorkspaceRootForCurrentRun?: string = undefined;
|
|
||||||
|
|
||||||
private constructor(
|
private constructor(
|
||||||
readonly config: Config,
|
readonly config: Config,
|
||||||
private readonly extCtx: vscode.ExtensionContext,
|
private readonly extCtx: vscode.ExtensionContext,
|
||||||
|
@ -189,7 +189,6 @@ async function initCommonContext(context: vscode.ExtensionContext, ctx: Ctx) {
|
|||||||
ctx.registerCommand("resolveCodeAction", commands.resolveCodeAction);
|
ctx.registerCommand("resolveCodeAction", commands.resolveCodeAction);
|
||||||
ctx.registerCommand("applyActionGroup", commands.applyActionGroup);
|
ctx.registerCommand("applyActionGroup", commands.applyActionGroup);
|
||||||
ctx.registerCommand("gotoLocation", commands.gotoLocation);
|
ctx.registerCommand("gotoLocation", commands.gotoLocation);
|
||||||
ctx.registerCommand("cargoWorkspaceRootForCurrentRun", commands.getCargoWorkspaceDir);
|
|
||||||
|
|
||||||
ctx.registerCommand("linkToCommand", commands.linkToCommand);
|
ctx.registerCommand("linkToCommand", commands.linkToCommand);
|
||||||
}
|
}
|
||||||
|
@ -89,14 +89,12 @@ export async function selectRunnable(
|
|||||||
|
|
||||||
export class RunnableQuickPick implements vscode.QuickPickItem {
|
export class RunnableQuickPick implements vscode.QuickPickItem {
|
||||||
public label: string;
|
public label: string;
|
||||||
public cargoWorkspaceRoot?: string;
|
|
||||||
public description?: string | undefined;
|
public description?: string | undefined;
|
||||||
public detail?: string | undefined;
|
public detail?: string | undefined;
|
||||||
public picked?: boolean | undefined;
|
public picked?: boolean | undefined;
|
||||||
|
|
||||||
constructor(public runnable: ra.Runnable) {
|
constructor(public runnable: ra.Runnable) {
|
||||||
this.label = runnable.label;
|
this.label = runnable.label;
|
||||||
this.cargoWorkspaceRoot = runnable.args.workspaceRoot;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ export async function buildCargoTask(
|
|||||||
name,
|
name,
|
||||||
TASK_SOURCE,
|
TASK_SOURCE,
|
||||||
exec,
|
exec,
|
||||||
["$rustc-run"]
|
["$rustc"]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user