This PR fixes the constructor of FileResource so the listener of this.fileService.onDidChangeFileSystemProviderReadOnlyMessage is properly disposed when the resource is disposed.
Fixes #13877
How to test
You can run the playwright test in examples\playwright\src\tests\theia-application-shell.test.ts. Check the logs, you should not see any emitter memory leak warning related to onDidChangeFileSystemProviderReadOnlyMessage event.
Review checklist
[x] As an author, I have thoroughly tested my changes and carefully followed the review guidelines
What it does
This PR fixes the constructor of FileResource so the listener of
this.fileService.onDidChangeFileSystemProviderReadOnlyMessage
is properly disposed when the resource is disposed.Fixes #13877
How to test
You can run the playwright test in examples\playwright\src\tests\theia-application-shell.test.ts. Check the logs, you should not see any emitter memory leak warning related to
onDidChangeFileSystemProviderReadOnlyMessage
event.Review checklist
Reminder for reviewers