From 417d45ccddc2f434d7467e4f17113783996653dd Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 26 Aug 2023 22:31:49 -0700 Subject: fix: :bug: fix ssh /edit by checking for file through vscode fs --- extension/src/continueIdeClient.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'extension/src') diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 19575b13..4e099fdb 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -236,6 +236,11 @@ class IdeProtocolClient { uniqueId: this.getUniqueId(), }); break; + case "fileExists": + messenger.send("fileExists", { + exists: await this.fileExists(data.filepath), + }); + break; case "getUserSecret": messenger.send("getUserSecret", { value: await this.getUserSecret(data.key), @@ -432,6 +437,15 @@ class IdeProtocolClient { openEditorAndRevealRange(filepath, undefined, vscode.ViewColumn.One); } + async fileExists(filepath: string): Promise { + try { + await vscode.workspace.fs.stat(vscode.Uri.file(filepath)); + return true; + } catch { + return false; + } + } + showVirtualFile(name: string, contents: string) { vscode.workspace .openTextDocument( -- cgit v1.2.3-70-g09d2