Skip to content

Commit

Permalink
Merge pull request #232 from sourcery-ai/ben/sou-2032-fix-ensure-dire…
Browse files Browse the repository at this point in the history
…ctory-links-work-in-vs-code-and-intellij

fix: ensure directory links work in VSCode
  • Loading branch information
bm424 authored Oct 6, 2023
2 parents d436d41 + c87eb52 commit 7e530b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ export class ChatProvider implements vscode.WebviewViewProvider {
});
} else {
// Reveal the directory in the explorer
vscode.commands.executeCommand("revealInExplorer", link);
vscode.commands.executeCommand("revealInExplorer", filePath).then(() =>
// This is a little hack.
//
// There's some issue with the revealInExplorer command which means when the panel changes
// (e.g. from sourcery to the explorer) the instruction to actually focus the file path
// seems to get dropped. By calling it again (after the first command succeeds) we can
// make sure the file actually gets navigated to.
vscode.commands.executeCommand("revealInExplorer", filePath)
);
}
}
}
Expand Down

0 comments on commit 7e530b3

Please sign in to comment.