Skip to content

Revert "fix: in VSCode, correctly resolve relative paths to errors" #13413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1301,15 +1301,6 @@
"endsPattern": "^\\[Finished running\\b"
},
"pattern": "$rustc"
},
{
"name": "rustc-run",
"base": "$rustc",
"fileLocation": [
"autoDetect",
"${command:rust-analyzer.cargoWorkspaceRootForCurrentRun}"
],
"pattern": "$rustc-run"
}
],
"colors": [
Expand Down
4 changes: 0 additions & 4 deletions editors/code/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,6 @@ export function run(ctx: Ctx): Cmd {
item.detail = "rerun";
prevRunnable = item;
const task = await createTask(item.runnable, ctx.config);
ctx.cargoWorkspaceRootForCurrentRun = item.cargoWorkspaceRoot;
return await vscode.tasks.executeTask(task);
};
}
Expand Down Expand Up @@ -947,6 +946,3 @@ export function linkToCommand(ctx: Ctx): Cmd {
}
};
}
export function getCargoWorkspaceDir(ctx: Ctx): Cmd {
return async () => ctx.cargoWorkspaceRootForCurrentRun;
}
4 changes: 0 additions & 4 deletions editors/code/src/ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export type Workspace =
};

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(
readonly config: Config,
private readonly extCtx: vscode.ExtensionContext,
Expand Down
1 change: 0 additions & 1 deletion editors/code/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ async function initCommonContext(context: vscode.ExtensionContext, ctx: Ctx) {
ctx.registerCommand("resolveCodeAction", commands.resolveCodeAction);
ctx.registerCommand("applyActionGroup", commands.applyActionGroup);
ctx.registerCommand("gotoLocation", commands.gotoLocation);
ctx.registerCommand("cargoWorkspaceRootForCurrentRun", commands.getCargoWorkspaceDir);

ctx.registerCommand("linkToCommand", commands.linkToCommand);
}
Expand Down
2 changes: 0 additions & 2 deletions editors/code/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ export async function selectRunnable(

export class RunnableQuickPick implements vscode.QuickPickItem {
public label: string;
public cargoWorkspaceRoot?: string;
public description?: string | undefined;
public detail?: string | undefined;
public picked?: boolean | undefined;

constructor(public runnable: ra.Runnable) {
this.label = runnable.label;
this.cargoWorkspaceRoot = runnable.args.workspaceRoot;
}
}

Expand Down
2 changes: 1 addition & 1 deletion editors/code/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export async function buildCargoTask(
name,
TASK_SOURCE,
exec,
["$rustc-run"]
["$rustc"]
);
}

Expand Down