提交 3f4f7303 编写于 作者: C Coenraad Stijne

expose stickyness decoration option

上级 e1b9f94c
...@@ -1616,6 +1616,7 @@ export interface IEditorContribution { ...@@ -1616,6 +1616,7 @@ export interface IEditorContribution {
* @internal * @internal
*/ */
export interface IThemeDecorationRenderOptions { export interface IThemeDecorationRenderOptions {
stickiness?: TrackedRangeStickiness;
backgroundColor?: string; backgroundColor?: string;
outline?: string; outline?: string;
......
...@@ -698,6 +698,16 @@ declare module 'vscode' { ...@@ -698,6 +698,16 @@ declare module 'vscode' {
Full = 7 Full = 7
} }
/**
* Describes the behaviour of decorations when typing/editing near their edges.
*/
export enum TrackedRangeStickiness {
AlwaysGrowsWhenTypingAtEdges = 0,
NeverGrowsWhenTypingAtEdges = 1,
GrowsOnlyWhenTypingBefore = 2,
GrowsOnlyWhenTypingAfter = 3
}
/** /**
* Represents options to configure the behavior of showing a [document](#TextDocument) in an [editor](#TextEditor). * Represents options to configure the behavior of showing a [document](#TextDocument) in an [editor](#TextEditor).
*/ */
...@@ -725,6 +735,12 @@ declare module 'vscode' { ...@@ -725,6 +735,12 @@ declare module 'vscode' {
* Represents theme specific rendering styles for a [text editor decoration](#TextEditorDecorationType). * Represents theme specific rendering styles for a [text editor decoration](#TextEditorDecorationType).
*/ */
export interface ThemableDecorationRenderOptions { export interface ThemableDecorationRenderOptions {
/**
* Customize the growing behaviour of the decoration when typing at the edges of the decoration.
* Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges
*/
stickiness?: TrackedRangeStickiness;
/** /**
* Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations. * Background color of the decoration. Use rgba() and define transparent background colors to play well with other decorations.
*/ */
......
...@@ -515,6 +515,7 @@ export function createApiFactory( ...@@ -515,6 +515,7 @@ export function createApiFactory(
OverviewRulerLane: EditorCommon.OverviewRulerLane, OverviewRulerLane: EditorCommon.OverviewRulerLane,
ParameterInformation: extHostTypes.ParameterInformation, ParameterInformation: extHostTypes.ParameterInformation,
Position: extHostTypes.Position, Position: extHostTypes.Position,
ProgressLocation: extHostTypes.ProgressLocation,
Range: extHostTypes.Range, Range: extHostTypes.Range,
Selection: extHostTypes.Selection, Selection: extHostTypes.Selection,
SignatureHelp: extHostTypes.SignatureHelp, SignatureHelp: extHostTypes.SignatureHelp,
...@@ -529,10 +530,10 @@ export function createApiFactory( ...@@ -529,10 +530,10 @@ export function createApiFactory(
TextEditorLineNumbersStyle: extHostTypes.TextEditorLineNumbersStyle, TextEditorLineNumbersStyle: extHostTypes.TextEditorLineNumbersStyle,
TextEditorRevealType: extHostTypes.TextEditorRevealType, TextEditorRevealType: extHostTypes.TextEditorRevealType,
TextEditorSelectionChangeKind: extHostTypes.TextEditorSelectionChangeKind, TextEditorSelectionChangeKind: extHostTypes.TextEditorSelectionChangeKind,
TrackedRangeStickiness: EditorCommon.TrackedRangeStickiness,
Uri: URI, Uri: URI,
ViewColumn: extHostTypes.ViewColumn, ViewColumn: extHostTypes.ViewColumn,
WorkspaceEdit: extHostTypes.WorkspaceEdit, WorkspaceEdit: extHostTypes.WorkspaceEdit,
ProgressLocation: extHostTypes.ProgressLocation,
// functions // functions
FileLocationKind: extHostTypes.FileLocationKind, FileLocationKind: extHostTypes.FileLocationKind,
ApplyToKind: extHostTypes.ApplyToKind, ApplyToKind: extHostTypes.ApplyToKind,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册