saros
saros copied to clipboard
Allow Saros core to disable local resource listeners in IDE implementations
During the project/reference point negotiation, the Saros core potentially creates local resources on the receiving side. To avoid these resource creations causing unwanted resource activities, FileReplacementInProgressObservable was added. It is currently used to stop the local IDE implementation listeners from dispatching resource activities during the project/reference point negotiation.
A better solution would be to add a central component in the core with which all such resource listeners are registered and which can enable or disable such handlers if necessary. This allows for a much cleaner implementation and adds the possibility of increasing the scope of the disableable handlers if necessary. Furthermore, disabling the handlers instead of just stopping them from dispatching activities is much more resource efficient and avoids potential side effects caused by the rest of the handler logic.
The handlers which the core currently needs to disable are handlers for local filesystem changes (i.e. resource creations, deletions, moves, etc.) and local text edits.