MPS-extensions icon indicating copy to clipboard operation
MPS-extensions copied to clipboard

GrammarCells: flag cells should be automatically undoable via code completion menu

Open alexanderpann opened this issue 1 year ago • 2 comments

Normally, you enter some specific text and the flag is set to true. When you delete the displayed text, the flag is set to false (= removed). This works well when the flag is used like the public modifier in baselanguage. For example: boolean a = true -> enter "public" -> public boolean a = true When the editor changes heavily when the flag is set, the flag doesn't feel like a flag anymore and as a user I would try to undo it using the code completion menu, the same way I have added it. The user would have to delete the flag of course. Example: default component A -> enter "composition". -> component composition A. I think there should be a automatically created code completion menu entry with a customizable description (e.g., remove composition) that lets you set the flag to false in addition to the normal way of deleting the flag.

alexanderpann avatar Apr 28 '23 14:04 alexanderpann

There are users that expect things to be removed when they type something? That doesn't sound intuitive. Does the example describe the actual use case or is this too simplified to understand why this is necessary? I would like to see the actual use case.

slisson avatar Apr 28 '23 15:04 slisson

I've changed the wording a bit, but yes, this is the actual use case. I am not sure if my proposed change is really a good idea, and I also don't find the use case very intuitive. Normally, I would also expect the flag to not change the text, but there might be cases where the new wording comes from a specific domain, like in the mentioned case. Then you can't use flags like modifiers the way we are used to it. The gist is that the user might not interpret is as a flag, but it is implemented as a flag in the editor. In the example, a default component and component composition is interpreted as two completely different things by the user while in reality it is only a normal component with the composite flag set. If you think that this is nonsense, you can close the ticket, but I still think that this could be an additional option and shouldn't be the default.

alexanderpann avatar Apr 28 '23 15:04 alexanderpann

I'll close the ticket myself. If there is a need for this use case, it can be implemented as an intention in the project that needs this.

alexanderpann avatar Jun 30 '24 11:06 alexanderpann