Interface IModelDecorationOptions
Expand description
interface IModelDecorationOptions {
after?: InjectedTextOptions;
afterContentClassName?: string;
before?: InjectedTextOptions;
beforeContentClassName?: string;
blockClassName?: string;
blockDoesNotCollapse?: boolean;
blockIsAfterEnd?: boolean;
blockPadding?: [
top: number,
right: number,
bottom: number,
left: number,
];
className?: string;
firstLineDecorationClassName?: string;
fontFamily?: string;
fontSize?: string;
fontStyle?: string;
fontWeight?: string;
glyphMargin?: IModelDecorationGlyphMarginOptions;
glyphMarginClassName?: string;
glyphMarginHoverMessage?: | IMarkdownString
| IMarkdownString[];
hoverMessage?: IMarkdownString
| IMarkdownString[];
inlineClassName?: string;
inlineClassNameAffectsLetterSpacing?: boolean;
isWholeLine?: boolean;
lineHeight?: number;
lineNumberClassName?: string;
lineNumberHoverMessage?:
| IMarkdownString
| IMarkdownString[];
linesDecorationsClassName?: string;
linesDecorationsTooltip?: string;
marginClassName?: string;
minimap?: IModelDecorationMinimapOptions;
overviewRuler?: IModelDecorationOverviewRulerOptions;
shouldFillLineOnLineBreak?: boolean;
showIfCollapsed?: boolean;
stickiness?: TrackedRangeStickiness;
textDirection?: TextDirection;
zIndex?: number;
}Properties§
after?: InjectedTextOptionsIf set, text will be injected in the view after the range.
after Content Class Name?: stringIf set, the decoration will be rendered after the text with this CSS class name.
before?: InjectedTextOptionsIf set, text will be injected in the view before the range.
before Content Class Name?: stringIf set, the decoration will be rendered before the text with this CSS class name.
block Class Name?: string§block Does Not Collapse?: boolean§block Is After End?: booleanIndicates if this block should be rendered after the last line. In this case, the range must be empty and set to the last line.
block Padding?: [top: number, right: number, bottom: number, left: number]§class Name?: stringCSS class name describing the decoration.
first Line Decoration Class Name?: stringIf set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping.
font Family?: stringFont family
font Size?: stringFont size
font Style?: stringFont style
font Weight?: stringFont weight
glyph Margin?: IModelDecorationGlyphMarginOptionsIf set and the decoration has glyphMarginClassName set, render this decoration with the specified IModelDecorationGlyphMarginOptions in the glyph margin.
glyph Margin Class Name?: stringIf set, the decoration will be rendered in the glyph margin with this CSS class name.
glyph Margin Hover Message?: IMarkdownString | IMarkdownString[]Message to be rendered when hovering over the glyph margin decoration.
hover Message?: IMarkdownString | IMarkdownString[]Array of MarkdownString to render as the decoration message.
inline Class Name?: stringIf set, the decoration will be rendered inline with the text with this CSS class name.
Please use this only for CSS rules that must impact the text. For example, use className
to have a background color decoration.
inline Class Name Affects Letter Spacing?: booleanIf there is an inlineClassName which affects letter spacing.
is Whole Line?: booleanShould the decoration expand to encompass a whole line.
line Height?: numberIf set, the decoration will override the line height of the lines it spans. Maximum value is 300px.
line Number Class Name?: stringIf set, the decoration will be rendered on the line number.
line Number Hover Message?: IMarkdownString | IMarkdownString[]Array of MarkdownString to render as the line number message.
lines Decorations Class Name?: stringIf set, the decoration will be rendered in the lines decorations with this CSS class name.
lines Decorations Tooltip?: stringControls the tooltip text of the line decoration.
margin Class Name?: stringIf set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.
minimap?: IModelDecorationMinimapOptionsIf set, render this decoration in the minimap.
overview Ruler?: IModelDecorationOverviewRulerOptionsIf set, render this decoration in the overview ruler.
should Fill Line On Line Break?: booleanIndicates whether the decoration should span across the entire line when it continues onto the next line.
show If Collapsed?: booleanAlways render the decoration (even when the range it encompasses is collapsed).
stickiness?: TrackedRangeStickinessCustomize the growing behavior of the decoration when typing at the edges of the decoration. Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges
text Direction?: TextDirectionThe text direction of the decoration.
z Index?: numberSpecifies the stack order of a decoration. A decoration with greater stack order is always in front of a decoration with a lower stack order when the decorations are on the same line.
Options for a model decoration.