Skip to content

Commit

Permalink
Definitions for edge widgets in editorBrowser.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihailik committed Nov 24, 2017
1 parent 8feee8e commit 85220d2
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
39 changes: 39 additions & 0 deletions src/vs/editor/browser/editorBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,45 @@ export interface IOverlayWidget {
getPosition(): IOverlayWidgetPosition;
}

/**
* A positioning preference for rendering content widgets.
*/
export enum EdgeWidgetPositionEdge {
/**
* Place the edge widget at the top
*/
TOP,
/**
* Place the edge widget at the bottom
*/
BOTTOM
}
/**
* A position for rendering edge widgets.
*/
export interface IEdgeWidgetPosition {
size: number;
edge: EdgeWidgetPositionEdge;
}
/**
* An edge widget renders at the requested edge and pushed content inside.
*/
export interface IEdgeWidget {
/**
* Get a unique identifier of the edge widget.
*/
getId(): string;
/**
* Get the dom node of the content widget.
*/
getDomNode(): HTMLElement;
/**
* Get the placement of the content widget.
* If null is returned, the content widget will be placed off screen.
*/
getPosition(): IEdgeWidgetPosition;
}

/**
* Type of hit element with the mouse in the editor.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/vs/editor/standalone/browser/standaloneEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import 'vs/css!./standalone-tokens';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ICodeEditor, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { ICodeEditor, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType, EdgeWidgetPositionEdge } from 'vs/editor/browser/editorBrowser';
import { StandaloneEditor, IStandaloneCodeEditor, StandaloneDiffEditor, IStandaloneDiffEditor, IEditorConstructionOptions, IDiffEditorConstructionOptions } from 'vs/editor/standalone/browser/standaloneCodeEditor';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { IEditorOverrideServices, DynamicStandaloneServices, StaticServices } from 'vs/editor/standalone/browser/standaloneServices';
Expand Down Expand Up @@ -388,6 +388,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
TextEditorCursorBlinkingStyle: editorOptions.TextEditorCursorBlinkingStyle,
ContentWidgetPositionPreference: ContentWidgetPositionPreference,
OverlayWidgetPositionPreference: OverlayWidgetPositionPreference,
EdgeWidgetPositionEdge: EdgeWidgetPositionEdge,
RenderMinimap: editorOptions.RenderMinimap,
ScrollType: <any>ScrollType,
RenderLineNumbersType: <any>RenderLineNumbersType,
Expand Down
41 changes: 41 additions & 0 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3421,6 +3421,47 @@ declare module monaco.editor {
getPosition(): IOverlayWidgetPosition;
}

/**
* A positioning preference for rendering content widgets.
*/
export enum EdgeWidgetPositionEdge {
/**
* Place the edge widget at the top
*/
TOP = 0,
/**
* Place the edge widget at the bottom
*/
BOTTOM = 1,
}

/**
* A position for rendering edge widgets.
*/
export interface IEdgeWidgetPosition {
size: number;
edge: EdgeWidgetPositionEdge;
}

/**
* An edge widget renders at the requested edge and pushed content inside.
*/
export interface IEdgeWidget {
/**
* Get a unique identifier of the edge widget.
*/
getId(): string;
/**
* Get the dom node of the content widget.
*/
getDomNode(): HTMLElement;
/**
* Get the placement of the content widget.
* If null is returned, the content widget will be placed off screen.
*/
getPosition(): IEdgeWidgetPosition;
}

/**
* Type of hit element with the mouse in the editor.
*/
Expand Down

0 comments on commit 85220d2

Please sign in to comment.