JetBrains / MPS-extensions

MPS-extensions aims to ease language development within MPS.
https://jetbrains.github.io/MPS-extensions/
Apache License 2.0
80 stars 47 forks source link

de.slisson.mps.conditionalEditor: "nextEditor" duplicates next available conditionalEditors with lower priority #855

Open arimer opened 3 weeks ago

arimer commented 3 weeks ago

In case a custom conditional editor is "overriding" an existing one, the next-editor cell seems to duplicate already available conditional editors with lower priorities.

In this example someone created a conditional editor to "override" an already existing one and the result looks like this:

grafik

The Inner "border" is the one from the original editor and the outer one is the one from the overriding one.

arimer commented 2 weeks ago

Idea: Add "overrides" support for conditional editors:

Adding a "overrides" functionality can't be directly implemented on the conditional editor at the moment, because internally conditional editors are just transformed into regular concept editors. Those do not hayve any default "overrides" functionality and therefor it is not supported by the editor framework at all.

alexanderpann commented 2 weeks ago

We could improve the [next-editor] cell though. It generates to next applicable editor which then calls getCellFactory().createEditorCell(node, excludedEditors). You could call this code directly and add new excluded editors. The only excluded editor at the moment is the current editor but you could reference some more editors in it.