builder icon indicating copy to clipboard operation
builder copied to clipboard

the builder may need to introduce configuration capabilities, similar to VSCode.

Open LiusCraft opened this issue 9 months ago • 0 comments

It supports configuration through the UI or in JSON.

updateOptions example: view playground

// Through the options literal, the behaviour of the editor can be easily customized.
// Here are a few examples of config options that can be passed to the editor.
// You can also call editor.updateOptions at any time to change the options.

var editor = monaco.editor.create(document.getElementById("container"), {
	value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line",
	language: "javascript",

	lineNumbers: "off",
	roundedSelection: false,
	scrollBeyondLastLine: false,
	readOnly: false,
	theme: "vs-dark",
  fontSize: 23,
});
setTimeout(function () {
	editor.updateOptions({
		lineNumbers: "on",
    fontSize: 16
	});
}, 2000);

Variable EditorOptions: https://microsoft.github.io/monaco-editor/typedoc/variables/editor.EditorOptions.html

expect JSON: a quick way to implement a configurable approach is to use JSON. I understand that as long as it can be properly converted into an object, it can be loaded into the monaco-editor configuration.

Image

UI: Image

LiusCraft avatar Mar 01 '25 15:03 LiusCraft