|
@@ -705,6 +705,10 @@ declare namespace monaco {
|
|
|
* Create a new empty range using this range's start position.
|
|
|
*/
|
|
|
collapseToStart(): Range;
|
|
|
+ /**
|
|
|
+ * Moves the range by the given amount of lines.
|
|
|
+ */
|
|
|
+ delta(lineCount: number): Range;
|
|
|
/**
|
|
|
* Create a new empty range using this range's start position.
|
|
|
*/
|
|
@@ -926,6 +930,50 @@ declare namespace monaco.editor {
|
|
|
|
|
|
export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator;
|
|
|
|
|
|
+ /**
|
|
|
+ * Description of a command contribution
|
|
|
+ */
|
|
|
+ export interface ICommandDescriptor {
|
|
|
+ /**
|
|
|
+ * An unique identifier of the contributed command.
|
|
|
+ */
|
|
|
+ id: string;
|
|
|
+ /**
|
|
|
+ * Callback that will be executed when the command is triggered.
|
|
|
+ */
|
|
|
+ run: ICommandHandler;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add a command.
|
|
|
+ */
|
|
|
+ export function addCommand(descriptor: ICommandDescriptor): IDisposable;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add an action to all editors.
|
|
|
+ */
|
|
|
+ export function addEditorAction(descriptor: IActionDescriptor): IDisposable;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * A keybinding rule.
|
|
|
+ */
|
|
|
+ export interface IKeybindingRule {
|
|
|
+ keybinding: number;
|
|
|
+ command?: string | null;
|
|
|
+ commandArgs?: any;
|
|
|
+ when?: string | null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add a keybinding rule.
|
|
|
+ */
|
|
|
+ export function addKeybindingRule(rule: IKeybindingRule): IDisposable;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add keybinding rules.
|
|
|
+ */
|
|
|
+ export function addKeybindingRules(rules: IKeybindingRule[]): IDisposable;
|
|
|
+
|
|
|
/**
|
|
|
* Create a new editor model.
|
|
|
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
|
|
@@ -1489,6 +1537,11 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
className?: string | null;
|
|
|
blockClassName?: string | null;
|
|
|
+ /**
|
|
|
+ * Indicates if this block should be rendered after the last line.
|
|
|
+ * In this case, the range must be empty and set to the last line.
|
|
|
+ */
|
|
|
+ blockIsAfterEnd?: boolean | null;
|
|
|
/**
|
|
|
* Message to be rendered when hovering over the glyph margin decoration.
|
|
|
*/
|
|
@@ -1501,6 +1554,10 @@ declare namespace monaco.editor {
|
|
|
* Should the decoration expand to encompass a whole line.
|
|
|
*/
|
|
|
isWholeLine?: boolean;
|
|
|
+ /**
|
|
|
+ * Always render the decoration (even when the range it encompasses is collapsed).
|
|
|
+ */
|
|
|
+ showIfCollapsed?: boolean;
|
|
|
/**
|
|
|
* Specifies the stack order of a decoration.
|
|
|
* A decoration with greater stack order is always in front of a decoration with
|
|
@@ -1743,6 +1800,15 @@ declare namespace monaco.editor {
|
|
|
GrowsOnlyWhenTypingAfter = 3
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Text snapshot that works like an iterator.
|
|
|
+ * Will try to return chunks of roughly ~64KB size.
|
|
|
+ * Will return null when finished.
|
|
|
+ */
|
|
|
+ export interface ITextSnapshot {
|
|
|
+ read(): string | null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* A model.
|
|
|
*/
|
|
@@ -1774,7 +1840,7 @@ declare namespace monaco.editor {
|
|
|
/**
|
|
|
* Replace the entire text buffer value contained in this model.
|
|
|
*/
|
|
|
- setValue(newValue: string): void;
|
|
|
+ setValue(newValue: string | ITextSnapshot): void;
|
|
|
/**
|
|
|
* Get the text stored in this model.
|
|
|
* @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`.
|
|
@@ -1782,6 +1848,12 @@ declare namespace monaco.editor {
|
|
|
* @return The text.
|
|
|
*/
|
|
|
getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;
|
|
|
+ /**
|
|
|
+ * Get the text stored in this model.
|
|
|
+ * @param preserverBOM Preserve a BOM character if it was detected when the model was constructed.
|
|
|
+ * @return The text snapshot (it is safe to consume it asynchronously).
|
|
|
+ */
|
|
|
+ createSnapshot(preserveBOM?: boolean): ITextSnapshot;
|
|
|
/**
|
|
|
* Get the length of the text stored in this model.
|
|
|
*/
|
|
@@ -2000,7 +2072,7 @@ declare namespace monaco.editor {
|
|
|
* @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
|
|
|
* @return An array with the decorations
|
|
|
*/
|
|
|
- getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];
|
|
|
+ getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[];
|
|
|
/**
|
|
|
* Gets all the decorations as an array.
|
|
|
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
|
@@ -2616,6 +2688,10 @@ declare namespace monaco.editor {
|
|
|
* New language
|
|
|
*/
|
|
|
readonly newLanguage: string;
|
|
|
+ /**
|
|
|
+ * Source of the call that caused the event.
|
|
|
+ */
|
|
|
+ readonly source: string;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2936,6 +3012,10 @@ declare namespace monaco.editor {
|
|
|
* Control the behavior and rendering of the scrollbars.
|
|
|
*/
|
|
|
scrollbar?: IEditorScrollbarOptions;
|
|
|
+ /**
|
|
|
+ * Control the behavior of sticky scroll options
|
|
|
+ */
|
|
|
+ stickyScroll?: IEditorStickyScrollOptions;
|
|
|
/**
|
|
|
* Control the behavior and rendering of the minimap.
|
|
|
*/
|
|
@@ -3025,8 +3105,7 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
smoothScrolling?: boolean;
|
|
|
/**
|
|
|
- * Enable that the editor will install an interval to check if its container dom node size has changed.
|
|
|
- * Enabling this might have a severe performance impact.
|
|
|
+ * Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.
|
|
|
* Defaults to false.
|
|
|
*/
|
|
|
automaticLayout?: boolean;
|
|
@@ -3403,6 +3482,10 @@ declare namespace monaco.editor {
|
|
|
* Controls strikethrough deprecated variables.
|
|
|
*/
|
|
|
showDeprecated?: boolean;
|
|
|
+ /**
|
|
|
+ * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
|
|
|
+ */
|
|
|
+ matchOnWordStartOnly?: boolean;
|
|
|
/**
|
|
|
* Control the behavior and rendering of the inline hints.
|
|
|
*/
|
|
@@ -3425,11 +3508,11 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
bracketPairColorization?: IBracketPairColorizationOptions;
|
|
|
/**
|
|
|
- * Enables dropping into the editor from an external source.
|
|
|
+ * Controls dropping into the editor from an external source.
|
|
|
*
|
|
|
- * This shows a preview of the drop location and triggers an `onDropIntoEditor` event.
|
|
|
+ * When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event.
|
|
|
*/
|
|
|
- enableDropIntoEditor?: boolean;
|
|
|
+ dropIntoEditor?: IDropIntoEditorOptions;
|
|
|
}
|
|
|
|
|
|
export interface IDiffEditorBaseOptions {
|
|
@@ -3487,6 +3570,10 @@ declare namespace monaco.editor {
|
|
|
* Control the wrapping of the diff editor.
|
|
|
*/
|
|
|
diffWordWrap?: 'off' | 'on' | 'inherit';
|
|
|
+ /**
|
|
|
+ * Diff Algorithm
|
|
|
+ */
|
|
|
+ diffAlgorithm?: 'smart' | 'experimental';
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3794,6 +3881,17 @@ declare namespace monaco.editor {
|
|
|
enabled?: boolean;
|
|
|
}
|
|
|
|
|
|
+ export interface IEditorStickyScrollOptions {
|
|
|
+ /**
|
|
|
+ * Enable the sticky scroll
|
|
|
+ */
|
|
|
+ enabled?: boolean;
|
|
|
+ /**
|
|
|
+ * Maximum number of sticky lines to show
|
|
|
+ */
|
|
|
+ maxLineCount?: number;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Configuration options for editor inlayHints
|
|
|
*/
|
|
@@ -4175,6 +4273,10 @@ declare namespace monaco.editor {
|
|
|
* Show deprecated-suggestions.
|
|
|
*/
|
|
|
showDeprecated?: boolean;
|
|
|
+ /**
|
|
|
+ * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
|
|
|
+ */
|
|
|
+ matchOnWordStartOnly?: boolean;
|
|
|
/**
|
|
|
* Show field-suggestions.
|
|
|
*/
|
|
@@ -4306,6 +4408,17 @@ declare namespace monaco.editor {
|
|
|
readonly wrappingColumn: number;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Configuration options for editor drop into behavior
|
|
|
+ */
|
|
|
+ export interface IDropIntoEditorOptions {
|
|
|
+ /**
|
|
|
+ * Enable the dropping into editor.
|
|
|
+ * Defaults to true.
|
|
|
+ */
|
|
|
+ enabled?: boolean;
|
|
|
+ }
|
|
|
+
|
|
|
export enum EditorOption {
|
|
|
acceptSuggestionOnCommitCharacter = 0,
|
|
|
acceptSuggestionOnEnter = 1,
|
|
@@ -4339,7 +4452,7 @@ declare namespace monaco.editor {
|
|
|
disableMonospaceOptimizations = 29,
|
|
|
domReadOnly = 30,
|
|
|
dragAndDrop = 31,
|
|
|
- enableDropIntoEditor = 32,
|
|
|
+ dropIntoEditor = 32,
|
|
|
emptySelectionClipboard = 33,
|
|
|
extraEditorClassName = 34,
|
|
|
fastScrollSensitivity = 35,
|
|
@@ -4412,35 +4525,36 @@ declare namespace monaco.editor {
|
|
|
snippetSuggestions = 102,
|
|
|
smartSelect = 103,
|
|
|
smoothScrolling = 104,
|
|
|
- stickyTabStops = 105,
|
|
|
- stopRenderingLineAfter = 106,
|
|
|
- suggest = 107,
|
|
|
- suggestFontSize = 108,
|
|
|
- suggestLineHeight = 109,
|
|
|
- suggestOnTriggerCharacters = 110,
|
|
|
- suggestSelection = 111,
|
|
|
- tabCompletion = 112,
|
|
|
- tabIndex = 113,
|
|
|
- unicodeHighlighting = 114,
|
|
|
- unusualLineTerminators = 115,
|
|
|
- useShadowDOM = 116,
|
|
|
- useTabStops = 117,
|
|
|
- wordSeparators = 118,
|
|
|
- wordWrap = 119,
|
|
|
- wordWrapBreakAfterCharacters = 120,
|
|
|
- wordWrapBreakBeforeCharacters = 121,
|
|
|
- wordWrapColumn = 122,
|
|
|
- wordWrapOverride1 = 123,
|
|
|
- wordWrapOverride2 = 124,
|
|
|
- wrappingIndent = 125,
|
|
|
- wrappingStrategy = 126,
|
|
|
- showDeprecated = 127,
|
|
|
- inlayHints = 128,
|
|
|
- editorClassName = 129,
|
|
|
- pixelRatio = 130,
|
|
|
- tabFocusMode = 131,
|
|
|
- layoutInfo = 132,
|
|
|
- wrappingInfo = 133
|
|
|
+ stickyScroll = 105,
|
|
|
+ stickyTabStops = 106,
|
|
|
+ stopRenderingLineAfter = 107,
|
|
|
+ suggest = 108,
|
|
|
+ suggestFontSize = 109,
|
|
|
+ suggestLineHeight = 110,
|
|
|
+ suggestOnTriggerCharacters = 111,
|
|
|
+ suggestSelection = 112,
|
|
|
+ tabCompletion = 113,
|
|
|
+ tabIndex = 114,
|
|
|
+ unicodeHighlighting = 115,
|
|
|
+ unusualLineTerminators = 116,
|
|
|
+ useShadowDOM = 117,
|
|
|
+ useTabStops = 118,
|
|
|
+ wordSeparators = 119,
|
|
|
+ wordWrap = 120,
|
|
|
+ wordWrapBreakAfterCharacters = 121,
|
|
|
+ wordWrapBreakBeforeCharacters = 122,
|
|
|
+ wordWrapColumn = 123,
|
|
|
+ wordWrapOverride1 = 124,
|
|
|
+ wordWrapOverride2 = 125,
|
|
|
+ wrappingIndent = 126,
|
|
|
+ wrappingStrategy = 127,
|
|
|
+ showDeprecated = 128,
|
|
|
+ inlayHints = 129,
|
|
|
+ editorClassName = 130,
|
|
|
+ pixelRatio = 131,
|
|
|
+ tabFocusMode = 132,
|
|
|
+ layoutInfo = 133,
|
|
|
+ wrappingInfo = 134
|
|
|
}
|
|
|
|
|
|
export const EditorOptions: {
|
|
@@ -4478,7 +4592,8 @@ declare namespace monaco.editor {
|
|
|
domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
|
|
|
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
|
|
|
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
|
|
|
- enableDropIntoEditor: IEditorOption<EditorOption.enableDropIntoEditor, boolean>;
|
|
|
+ dropIntoEditor: IEditorOption<EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>;
|
|
|
+ stickyScroll: IEditorOption<EditorOption.stickyScroll, Readonly<Required<IEditorStickyScrollOptions>>>;
|
|
|
extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
|
|
|
fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
|
|
|
find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>;
|
|
@@ -4984,6 +5099,8 @@ declare namespace monaco.editor {
|
|
|
|
|
|
export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
|
|
|
readonly type: MouseTargetType.OUTSIDE_EDITOR;
|
|
|
+ readonly outsidePosition: 'above' | 'below' | 'left' | 'right';
|
|
|
+ readonly outsideDistance: number;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -5278,7 +5395,7 @@ declare namespace monaco.editor {
|
|
|
* @id Unique identifier of the contribution.
|
|
|
* @return The action or null if action not found.
|
|
|
*/
|
|
|
- getAction(id: string): IEditorAction;
|
|
|
+ getAction(id: string): IEditorAction | null;
|
|
|
/**
|
|
|
* Execute a command on the editor.
|
|
|
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
|
|
@@ -5335,9 +5452,13 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
getVisibleRanges(): Range[];
|
|
|
/**
|
|
|
- * Get the vertical position (top offset) for the line w.r.t. to the first line.
|
|
|
+ * Get the vertical position (top offset) for the line's top w.r.t. to the first line.
|
|
|
*/
|
|
|
getTopForLineNumber(lineNumber: number): number;
|
|
|
+ /**
|
|
|
+ * Get the vertical position (top offset) for the line's bottom w.r.t. to the first line.
|
|
|
+ */
|
|
|
+ getBottomForLineNumber(lineNumber: number): number;
|
|
|
/**
|
|
|
* Get the vertical position (top offset) for the position w.r.t. to the first line.
|
|
|
*/
|
|
@@ -5436,6 +5557,11 @@ declare namespace monaco.editor {
|
|
|
* @event
|
|
|
*/
|
|
|
readonly onDidUpdateDiff: IEvent<void>;
|
|
|
+ /**
|
|
|
+ * An event emitted when the diff model is changed (i.e. the diff editor shows new content).
|
|
|
+ * @event
|
|
|
+ */
|
|
|
+ readonly onDidChangeModel: IEvent<void>;
|
|
|
/**
|
|
|
* Saves current view state of the editor in a serializable object.
|
|
|
*/
|
|
@@ -5838,6 +5964,10 @@ declare namespace monaco.languages {
|
|
|
* Requested kind of actions to return.
|
|
|
*/
|
|
|
readonly only?: string;
|
|
|
+ /**
|
|
|
+ * The reason why code actions were requested.
|
|
|
+ */
|
|
|
+ readonly trigger: CodeActionTriggerType;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -5868,6 +5998,10 @@ declare namespace monaco.languages {
|
|
|
* such as `["quickfix.removeLine", "source.fixAll" ...]`.
|
|
|
*/
|
|
|
readonly providedCodeActionKinds?: readonly string[];
|
|
|
+ readonly documentation?: ReadonlyArray<{
|
|
|
+ readonly kind: string;
|
|
|
+ readonly command: Command;
|
|
|
+ }>;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -6440,6 +6574,11 @@ declare namespace monaco.languages {
|
|
|
disabled?: string;
|
|
|
}
|
|
|
|
|
|
+ export enum CodeActionTriggerType {
|
|
|
+ Invoke = 1,
|
|
|
+ Auto = 2
|
|
|
+ }
|
|
|
+
|
|
|
export interface CodeActionList extends IDisposable {
|
|
|
readonly actions: ReadonlyArray<CodeAction>;
|
|
|
}
|
|
@@ -6776,11 +6915,11 @@ declare namespace monaco.languages {
|
|
|
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
|
|
}
|
|
|
|
|
|
- export type TextEdit = {
|
|
|
+ export interface TextEdit {
|
|
|
range: IRange;
|
|
|
text: string;
|
|
|
eol?: editor.EndOfLineSequence;
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Interface used to format a model
|
|
@@ -7018,6 +7157,7 @@ declare namespace monaco.languages {
|
|
|
folder?: boolean;
|
|
|
skipTrashBin?: boolean;
|
|
|
maxSize?: number;
|
|
|
+ contentsBase64?: string;
|
|
|
}
|
|
|
|
|
|
export interface IWorkspaceFileEdit {
|