From 5b1c68337da1ae7fd39dd5c28fc2703e84ed41d4 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 25 Dec 2024 18:48:47 -0800 Subject: [PATCH] Fix formatting --- src/integrations/workspace/WorkspaceTracker.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/integrations/workspace/WorkspaceTracker.ts b/src/integrations/workspace/WorkspaceTracker.ts index 69fc860d37..df20a2bfe4 100644 --- a/src/integrations/workspace/WorkspaceTracker.ts +++ b/src/integrations/workspace/WorkspaceTracker.ts @@ -27,24 +27,22 @@ class WorkspaceTracker { } private registerListeners() { - // Create a file system watcher for all files - const watcher = vscode.workspace.createFileSystemWatcher('**') + const watcher = vscode.workspace.createFileSystemWatcher("**") - // Listen for file creation this.disposables.push( watcher.onDidCreate(async (uri) => { await this.addFilePath(uri.fsPath) this.workspaceDidUpdate() - }) + }), ) - // Listen for file deletion + // Renaming files triggers a delete and create event this.disposables.push( watcher.onDidDelete(async (uri) => { if (await this.removeFilePath(uri.fsPath)) { this.workspaceDidUpdate() } - }) + }), ) // Listen for file changes (which could include renames) @@ -52,7 +50,7 @@ class WorkspaceTracker { watcher.onDidChange(async (uri) => { await this.addFilePath(uri.fsPath) this.workspaceDidUpdate() - }) + }), ) // Add the watcher itself to disposables