-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Closed
Description
Users of IModelDecorationOptions.beforeContentClassName
or IModelDecorationOptions.afterContentClassName
:
-
breakpointEditorContribution.ts#L103
- reason: reserves space inline
-
breakpointEditorContribution.ts#L136
:- reason: renders a symbol inline
-
callStackEditorContribution.ts#L83
- reason: renders a symbol inline
- 💪 Get rid of before/after css rules in foldingDecorations #136740
- reason: renders
⋯
at end of folded lines
- reason: renders
Users of IThemeDecorationRenderOptions.before
or IThemeDecorationRenderOptions.after
:
- colorDetector.ts#L182 and colorDetector.ts#L191:
- reason: renders color boxes (e.g. in css)
- ghostTextWidget.ts#L276
- reason: old implementation
Users of IThemeDecorationRenderOptions.beforeInjectedText
or IThemeDecorationRenderOptions.afterInjectedText
:
-
inlayHintsController.ts#L249
- reason: generates dynamic CSS
Users of IThemeDecorationInstanceRenderOptions.after
:
breakpointWidget.ts#L70
- reason: renders a placeholder in the breakpoint editor widget e.g. "Message to log when breakpoint is hit"
-
debugEditorContribution.ts#L89
- reason: renders inline values when debugging
repl.ts#L693
- reason: renders a placeholder in the debug repl e.g. "Please start a debug session to evaluate expressions"
interactiveEditor.ts#L574
- reason: renders a placeholder in the interactive window e.g. "Type code here and press {0} to run"
commentThreadWidget.ts#L855
- reason: renders a placeholder in the comments widget e.g. "Type a new comment"
Sample showing how we could render a color box:
var jsCode = [
'"use strict";',
"function Person(age) {",
" if (age) {",
" this.age = age;",
" }",
"}",
"Person.prototype.getAge = function () {",
" return this.age;",
"};",
].join("\n");
var editor = monaco.editor.create(document.getElementById("container"), {
value: jsCode,
language: "javascript",
});
var decorations = editor.deltaDecorations(
[],
[
{
range: new monaco.Range(3, 6, 3, 7),
options: {
after: {
content: " ",
inlineClassName: "special-box",
inlineClassNameAffectsLetterSpacing: true,
}
}
}
]
);
.special-box {
border: solid 0.1em #000;
box-sizing: border-box;
margin: 0.1em 0.2em 0 0.2em;
width: 0.8em;
height: 0.8em;
background-color:red;
line-height: 0.8em;
display: inline-block;
}
Metadata
Metadata
Assignees
Labels
debtCode quality issuesCode quality issues