Skip to content

How to detect changes happening in the workspace? #14360

Discussion options

You must be logged in to vote

Hey @YathindraNikshipth,

you can use the FileService service to register the appropriate events. Note that there are two different kinds of workspace changes; Those who are happening on the file system (from the outside) and those initiated by the user. Here's an example on how to hook into both:

protected registerFileSystemChanges(): void {
// Event listener for disk based events
this.fileService.onDidFilesChange(event => {
const changes: types.FileChange[] = [];
for (const change of event.changes) {
const path = this.utils.getProtocolPath(change.resource);

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@YathindraNikshipth
Comment options

@YathindraNikshipth
Comment options

@msujew
Comment options

@YathindraNikshipth
Comment options

Answer selected by YathindraNikshipth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants