currently, we have async event queue per workspace for workspace events. and we have WorkspaceRegistration.WorkspaceChanged event.
our workspace events within the same workspace, we make sure all events are serialized. we guarantee the ordering of all events as they happens.
it gets interesting when a file is opened in the editor, we have this dance where the file is first added to misc workspace and then moved to another workspace such as VSWorkspace. same goes for when the file is closed.
it is interesting since a file is now interacting with 2 workspaces. currently, we don't have a way to preserve ordering of events between 2 different workspaces. when a file is moved between 2 workspaces, one might see the file added to 1 workspace before it is removed from the other workspace even though the actual event happened in reverse order since events are happening in 2 different async queues.
furthermore, WorkspaceRegistration.WorkspaceChanged events use the async queue of a workspace to raise "RegisterText", but use the synchronous event for "UnregisterText". also, since async queue raise event on UI thread but synchronous event happen on the thread it is called, we have a chance where the event raised concurrently.
we don't know what is the right fix for it yet. but opening the issue to make sure we figure out what to do after preview.
currently, we have async event queue per workspace for workspace events. and we have WorkspaceRegistration.WorkspaceChanged event.
our workspace events within the same workspace, we make sure all events are serialized. we guarantee the ordering of all events as they happens.
it gets interesting when a file is opened in the editor, we have this dance where the file is first added to misc workspace and then moved to another workspace such as VSWorkspace. same goes for when the file is closed.
it is interesting since a file is now interacting with 2 workspaces. currently, we don't have a way to preserve ordering of events between 2 different workspaces. when a file is moved between 2 workspaces, one might see the file added to 1 workspace before it is removed from the other workspace even though the actual event happened in reverse order since events are happening in 2 different async queues.
furthermore, WorkspaceRegistration.WorkspaceChanged events use the async queue of a workspace to raise "RegisterText", but use the synchronous event for "UnregisterText". also, since async queue raise event on UI thread but synchronous event happen on the thread it is called, we have a chance where the event raised concurrently.
we don't know what is the right fix for it yet. but opening the issue to make sure we figure out what to do after preview.