Open jwillmer opened 3 years ago
May I add one idea to this one..... Every expression (if activity allows) can be changed to be Javascript expression. And inside this expressions one might write complex JS (closures, etc, as long at it returns value of good type). However this is hard to do since editor is single line only. Would be nice to have some ability to extend editor area if you need such complex expressions. And add ability to beautify it as well, not just to JS Activity, but all JS Expressions.
yes, agree. Should be implemented in the js editor that is used by all activities. And a switch to JS expression should increase the input field / let the user increase it.
FYI:
editor.getAction('editor.action.formatDocument').run()
will format the documentmonaco.editor.create(document.getElementById("container"), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: "javascript",
formatOnType: true,
formatOnPaste: true
});
Try at: https://microsoft.github.io/monaco-editor/playground.html
I like to have a button to beautify my JS code.
@SipkeSchoorstraRTL Maybe an option to beautify on enter (if no errors are detected)?