Syntax highlighting / validation for outputs #7
Replies: 1 comment 15 replies
-
Yes, I completely agree that more immediate validation would be super useful. Since switching to AvalonEdit I'm been intending to turn on the syntax highlighting. Unfortunately that's not great for a lot of output formats; the list of supported highlighters is relatively small and there's not deep language validation. The link to the monaco editor is useful - I'd been looking for something like this but I think the issue with it is really that as well as the complicated hosting model you'd need to figure out a way to hook it up to the various VS code language server extensions. Once you've done that you're quite close to having VS Code which suggests... My first attempt at providing an interactive application was just to set up some filewatchers and to periodically write the output to a file then turn on VS code auto-save and auto-refresh and to use VS Code as the editor. That gets you all the syntax hightlighting/validation and extension goodness you could ever hope for but turned out to be a bit clunky in practice - VS Code had a habit of throwing errors while trying to refresh the ooutput from the Textrude Engine. So the real solution would probably be to put together a VS Code extension (probably a language server) to allow VS Code to the UI host. The Textrude Engine was written in a way that should make this relatively straightforward but I don't have the time atm to dive in the the world of VS Code extensions. I might add this to the issue list in case anyone else wants to take a run at it. It the meantime then a compromise might be to add the ability for textrudeinteractive to write out the ouput(s) to named files whenever they change..... |
Beta Was this translation helpful? Give feedback.
-
Currently, the output is just plain text, which is flexible, but errors / misspellings can occur when outputting for example C# source.
It would be cool, if the output field supported setting a specific language and syntax highlighting for the generated output. Validation would be the best thing, but hard to implement for every use case (e.g. only generating fragments), so at first this could be ignored, I think.
A colleague of mine suggested using Microsoft/monaco-editor, which would include support for a lot of languages, but would be a hassle to integrate (Web-Hosting control needed).
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions