Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EscapeSpecialCharactersInProperties enhancement script should not trigger in richtext #767

Open
malueck opened this issue Feb 13, 2024 · 1 comment

Comments

@malueck
Copy link

malueck commented Feb 13, 2024

The enhancement script EscapeSpecialCharactersInProperties from jetbrains.mps.lang.smodel shows a note next to any Text node from de.slisson.mps.richtext that happens to contain a linebreak.
It suggests "Escape special characters in property values" and will convert all \n to \\n, effectively making the text single-line.
It is clear why this suggestion exists, but clearly richtext is designed to exactly deal with the issues of linebreaks, so the message is confusing end users.

There is a MultilineUtil class as part of the plugin that does the escaping for the backing property of Word, but its code has been removed for a while now? At the moment it seems to do nothing.

It seems the only workaround is to clone the Word concept and re-implement the escaping, but this would be lots of pain since large parts of the plugin work with explicitly the Word (not IWord) concept and we would lose much of the functionality like normalization.
Is there any other way to get rid of the enhancement script or to change the way how Word stores its text in a property?
Thanks!

@alexanderpann
Copy link
Collaborator

There is nothing we can do on the platform side about the enhancement script. The only thing you can do is click on the arrow right next to the intention and select Disable This Intention. You can re-enable it in preferences-> Editor -> MPS Intentions.

The class MultilineUtil could be removed, this is true. Looking at the history of EscapeSpecialCharactersInProperties  and the comment, I feel like the enhanced script might be deprecated. @artem-tikhomirov you removed the code. Can you maybe comment on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants