You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportfunctionactivate(context: vscode.ExtensionContext){// Use the console to output diagnostic information (console.log) and errors (console.error)// This line of code will only be executed once when your extension is activatedconsole.log('Congratulations, your extension "filewatcher-test" is now active!');letfolder=vscode.workspace.workspaceFolders?.[0]?.uri;if(!folder){console.log('No workspace folder to watch... using hard coded path');folder=vscode.Uri.file('/home/username/Source/testing-1/')return;}constpattern: vscode.RelativePattern=newvscode.RelativePattern(folder,'**/*.test.ts');constfileWatcher=vscode.workspace.createFileSystemWatcher(pattern);fileWatcher.onDidChange(uri=>console.log(`${uri.path} changed.`));fileWatcher.onDidCreate(uri=>console.log(`${uri.path} created.`));fileWatcher.onDidDelete(uri=>console.log(`${uri.path} deleted.`));context.subscriptions.push(fileWatcher);}
Using this method and editing files outside of the workspace did not trigger any events but the extension was activated.
The text was updated successfully, but these errors were encountered:
@sbatten you seem to be watching inside the workspace though because you create a watcher with vscode.workspace.workspaceFolders?.[0]?.uri. Did you test this in an empty window to get the vscode.Uri.file('/home/username/Source/testing-1/') fallback?
Testing #196194
Using this method and editing files outside of the workspace did not trigger any events but the extension was activated.
The text was updated successfully, but these errors were encountered: