I was looking through the vscode api, and I was wondering if there exists a type of listener event that sees that a file was created in the current workspace folder.
Thank you!
I was looking through the vscode api, and I was wondering if there exists a type of listener event that sees that a file was created in the current workspace folder.
Thank you!
You can use a FileSystemWatcher for this, for instance if you wanted to know about the creation of .txt files in the current workspace:
let folders = vscode.workspace.workspaceFolders;
if (folders) {
let watcher = vscode.workspace.createFileSystemWatcher(
new vscode.RelativePattern(folders[0], "*.txt"));
watcher.onDidCreate(uri => console.log(`created ${uri}`));
}