feat: prettier

This commit is contained in:
Fizz Pang 2023-03-12 15:47:52 +08:00
parent 4d3ed6fe28
commit 1431f4561f
3 changed files with 30 additions and 36 deletions

View file

@ -15,18 +15,16 @@ var editor = monaco.editor.create(document.getElementById("container"), {
language: "javascript", language: "javascript",
}); });
var decorations = editor.createDecorationsCollection( var decorations = editor.createDecorationsCollection([
[ {
{ range: new monaco.Range(3, 1, 5, 1),
range: new monaco.Range(3, 1, 5, 1), options: {
options: { isWholeLine: true,
isWholeLine: true, linesDecorationsClassName: "myLineDecoration",
linesDecorationsClassName: "myLineDecoration",
},
}, },
{ },
range: new monaco.Range(7, 1, 7, 24), {
options: { inlineClassName: "myInlineDecoration" }, range: new monaco.Range(7, 1, 7, 24),
}, options: { inlineClassName: "myInlineDecoration" },
] },
); ]);

View file

@ -17,18 +17,16 @@ var editor = monaco.editor.create(document.getElementById("container"), {
contextmenu: false, contextmenu: false,
}); });
var decorations = editor.createDecorationsCollection( var decorations = editor.createDecorationsCollection([
[ {
{ range: new monaco.Range(3, 1, 3, 1),
range: new monaco.Range(3, 1, 3, 1), options: {
options: { isWholeLine: true,
isWholeLine: true, className: "myContentClass",
className: "myContentClass", glyphMarginClassName: "myGlyphMarginClass",
glyphMarginClassName: "myGlyphMarginClass",
},
}, },
] },
); ]);
// Add a zone to make hit testing more interesting // Add a zone to make hit testing more interesting
var viewZoneId = null; var viewZoneId = null;

View file

@ -16,17 +16,15 @@ var editor = monaco.editor.create(document.getElementById("container"), {
glyphMargin: true, glyphMargin: true,
}); });
var decorations = editor.createDecorationsCollection( var decorations = editor.createDecorationsCollection([
[ {
{ range: new monaco.Range(3, 1, 3, 1),
range: new monaco.Range(3, 1, 3, 1), options: {
options: { isWholeLine: true,
isWholeLine: true, className: "myContentClass",
className: "myContentClass", glyphMarginClassName: "myGlyphMarginClass",
glyphMarginClassName: "myGlyphMarginClass",
},
}, },
] },
); ]);
// You can now use `decorations` to change or remove the decoration // You can now use `decorations` to change or remove the decoration