Closed digital-ember closed 2 months ago
I've added this parameter in https://github.com/JetBrains/MPS-extensions/pull/832 but it won't help setting the selection. I couldn't figure out how to make it work. The fact that the nodes don't belong to the same root node probably plays a big role in why the normal way with something likeeditorContext.flushEvents(); editorContext.select(node)
doesn't work.
A more general question related to that (even though I understand it does not solve the selection issue here in querylist):
My go-to solution to similar issues used to be to call editorContext.getEditorComponent().rebuildEditorContent();
before trying to set the selection, but I see that editorContext.flushEvent()
also seems to work in cases where I needed to call editorContext.getEditorComponent().rebuildEditorContent()
before.
Is it better to call flushEvents() over rebuildign the editor to ensure selection is working?
flushEvents()
should be enough to process all the changes happening to the model. rebuildEditorContent()
invalidates the editor and layouts it again which is unnecessary.
The querylist operations for deleting and adding new elements currently do not provide editorContext. Especially for the use case of setting a selection after deleting or adding an element, this would be very useful.