From ab31cb15fae74592f49c2ceadc8d7810228fa7e2 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 26 Aug 2023 23:21:26 -0700 Subject: fix: :bug: correctly generate uris for remote --- extension/src/util/vscode.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'extension/src/util') diff --git a/extension/src/util/vscode.ts b/extension/src/util/vscode.ts index bf0fa1e5..2283bfdc 100644 --- a/extension/src/util/vscode.ts +++ b/extension/src/util/vscode.ts @@ -102,3 +102,13 @@ export function openEditorAndRevealRange( }); }); } + +export function uriFromFilePath(filepath: string): vscode.Uri { + if (vscode.env.remoteName) { + return vscode.Uri.parse( + `vscode-remote://${vscode.env.remoteName}${filepath}` + ); + } else { + return vscode.Uri.file(filepath); + } +} -- cgit v1.2.3-70-g09d2