Skip to content

Commit

Permalink
Auto merge of rust-lang#14482 - Veykril:vscode-linking-popup, r=Veykril
Browse files Browse the repository at this point in the history
fix: Fix relative path creation using the wrong path accessor

This should hopefully fix the other errors with paths people seem to be getting
  • Loading branch information
bors committed Apr 4, 2023
2 parents f070093 + 7989a94 commit e871540
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions editors/code/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,27 @@ export async function createClient(
);
void vscode.workspace.fs.stat(path).then(async () => {
const choice = await vscode.window.showInformationMessage(
`This rust file does not belong to a loaded cargo project. It looks like it might belong to the workspace at ${path}, do you want to add it to the linked Projects?`,
`This rust file does not belong to a loaded cargo project. It looks like it might belong to the workspace at ${path.path}, do you want to add it to the linked Projects?`,
"Yes",
"No",
"Don't show this again"
);
switch (choice) {
case undefined:
break;
case "No":
break;
case "Yes":
const pathToInsert =
"." +
parent.substring(folder.length) +
pathSeparator +
"Cargo.toml";
await config.update(
"linkedProjects",
config
.get<any[]>("linkedProjects")
?.concat(
"." +
path.fsPath.substring(folder.length)
),
?.concat(pathToInsert),
false
);
break;
Expand Down

0 comments on commit e871540

Please sign in to comment.