Merge from vscode 777931080477e28b7c27e8f7d4b0d69897945946 (#9220)

This commit is contained in:
Anthony Dresser
2020-02-19 22:27:53 -08:00
committed by GitHub
parent ab6fb810f8
commit 0cec223301
115 changed files with 1431 additions and 1133 deletions

43
src/vs/monaco.d.ts vendored
View File

@@ -638,10 +638,18 @@ declare namespace monaco {
* Return the end position (which will be after or equal to the start position)
*/
getEndPosition(): Position;
/**
* Return the end position (which will be after or equal to the start position)
*/
static getEndPosition(range: IRange): Position;
/**
* Return the start position (which will be before or equal to the end position)
*/
getStartPosition(): Position;
/**
* Return the start position (which will be before or equal to the end position)
*/
static getStartPosition(range: IRange): Position;
/**
* Transform to a user presentable string representation.
*/
@@ -1098,6 +1106,11 @@ declare namespace monaco.editor {
* Defaults to true.
*/
wordBasedSuggestions?: boolean;
/**
* Controls whether the semanticHighlighting is shown for the languages that support it.
* Defaults to true.
*/
'semanticHighlighting.enabled'?: boolean;
/**
* Keep peek editors open even when double clicking their content or when hitting `Escape`.
* Defaults to false.
@@ -1508,7 +1521,7 @@ declare namespace monaco.editor {
/**
* The range to replace. This can be empty to emulate a simple insert.
*/
range: Range;
range: IRange;
/**
* The text to replace with. This can be null to emulate a simple delete.
*/
@@ -1520,6 +1533,22 @@ declare namespace monaco.editor {
forceMoveMarkers?: boolean;
}
export interface IValidEditOperation {
/**
* The range to replace. This can be empty to emulate a simple insert.
*/
range: Range;
/**
* The text to replace with. This can be null to emulate a simple delete.
*/
text: string | null;
/**
* This indicates that this operation has "insert" semantics.
* i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.
*/
forceMoveMarkers: boolean;
}
/**
* A callback that can compute the cursor state after applying a series of edit operations.
*/
@@ -1527,7 +1556,7 @@ declare namespace monaco.editor {
/**
* A callback that can compute the resulting cursors state after some edit operations have been executed.
*/
(inverseEditOperations: IIdentifiedSingleEditOperation[]): Selection[] | null;
(inverseEditOperations: IValidEditOperation[]): Selection[] | null;
}
export class TextModelResolvedOptions {
@@ -1867,7 +1896,7 @@ declare namespace monaco.editor {
* @param operations The edit operations.
* @return The inverse edit operations, that, when applied, will bring the model back to the previous state.
*/
applyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[];
applyEdits(operations: IIdentifiedSingleEditOperation[]): IValidEditOperation[];
/**
* Change the end of line sequence without recording in the undo stack.
* This can have dire consequences on the undo stack! See @pushEOL for the preferred way.
@@ -1919,14 +1948,14 @@ declare namespace monaco.editor {
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
addEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;
/**
* Add a new edit operation (a replace operation).
* The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
addTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;
/**
* Track `selection` when applying edit operations.
* A best effort will be made to not grow/expand the selection.
@@ -1946,7 +1975,7 @@ declare namespace monaco.editor {
/**
* Get the inverse edit operations of the added edit operations.
*/
getInverseEditOperations(): IIdentifiedSingleEditOperation[];
getInverseEditOperations(): IValidEditOperation[];
/**
* Get a previously tracked selection.
* @param id The unique identifier returned by `trackSelection`.
@@ -6043,7 +6072,7 @@ declare namespace monaco.languages {
description?: string;
iconPath?: {
id: string;
} | {
} | Uri | {
light: Uri;
dark: Uri;
};