Open trbrc opened 5 years ago
I think this is going to require a new CodeMirror Mode for Svelte, which seems worth it anyway. I do not see a way to override the existing add-ons/mode config to handle this logic, but it's very possible I'm just missing something.
It would require overlaying or reusing parts of the existing Handlebars/JSX modes (jsx already handles the auto closing issue when {}
is inside an xml open tag) on top of HTML.
In addition, the Vue mode has a good example for handling different languages in script/style/markup blocks so a Svelte specific mode would have other benefits along the lines of supporting preprocessors.
It looks like the overall useful sveltejs/svelte-repl#14 / sveltejs/svelte-repl#17 is getting in the way in a few situations. Try for example to type out the following examples character by character:
When you get to the greater than signs, you will end up with the following result: