Initial VS Code 1.19 source merge (#571)

* Initial 1.19 xcopy

* Fix yarn build

* Fix numerous build breaks

* Next batch of build break fixes

* More build break fixes

* Runtime breaks

* Additional post merge fixes

* Fix windows setup file

* Fix test failures.

* Update license header blocks to refer to source eula
This commit is contained in:
Karl Burtram
2018-01-28 23:37:17 -08:00
committed by GitHub
parent 9a1ac20710
commit 251ae01c3e
8009 changed files with 93378 additions and 35634 deletions

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

@@ -61,6 +61,7 @@ declare module monaco {
public static as(value: null): Promise<null>;
public static as(value: undefined): Promise<undefined>;
public static as<T>(value: PromiseLike<T>): PromiseLike<T>;
public static as<T, SomePromise extends PromiseLike<T>>(value: SomePromise): SomePromise;
public static as<T>(value: T): Promise<T>;
@@ -585,10 +586,6 @@ declare module monaco {
* Return the start position (which will be before or equal to the end position)
*/
getStartPosition(): Position;
/**
* Clone this range.
*/
cloneRange(): Range;
/**
* Transform to a user presentable string representation.
*/
@@ -786,7 +783,6 @@ declare module monaco.editor {
export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor;
export interface IDiffNavigator {
revealFirst: boolean;
canNavigate(): boolean;
next(): void;
previous(): void;
@@ -950,6 +946,51 @@ declare module monaco.editor {
label?: string;
}
/**
* Description of an action contribution
*/
export interface IActionDescriptor {
/**
* An unique identifier of the contributed action.
*/
id: string;
/**
* A label of the action that will be presented to the user.
*/
label: string;
/**
* Precondition rule.
*/
precondition?: string;
/**
* An array of keybindings for the action.
*/
keybindings?: number[];
/**
* The keybinding rule (condition on top of precondition).
*/
keybindingContext?: string;
/**
* Control if the action should show up in the context menu and where.
* The context menu of the editor has these default:
* navigation - The navigation group comes first in all cases.
* 1_modification - This group comes next and contains commands that modify your code.
* 9_cutcopypaste - The last default group with the basic editing commands.
* You can also create your own group.
* Defaults to null (don't show in context menu).
*/
contextMenuGroupId?: string;
/**
* Control the order in the context menu group.
*/
contextMenuOrder?: number;
/**
* Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convinience
*/
run(editor: ICodeEditor): void | Promise<void>;
}
/**
* The options to create an editor.
*/
@@ -1872,63 +1913,11 @@ declare module monaco.editor {
readonly charChanges: ICharChange[];
}
/**
* Information about a line in the diff editor
*/
export interface IDiffLineInformation {
readonly equivalentLineNumber: number;
}
export interface INewScrollPosition {
scrollLeft?: number;
scrollTop?: number;
}
/**
* Description of an action contribution
*/
export interface IActionDescriptor {
/**
* An unique identifier of the contributed action.
*/
id: string;
/**
* A label of the action that will be presented to the user.
*/
label: string;
/**
* Precondition rule.
*/
precondition?: string;
/**
* An array of keybindings for the action.
*/
keybindings?: number[];
/**
* The keybinding rule (condition on top of precondition).
*/
keybindingContext?: string;
/**
* Control if the action should show up in the context menu and where.
* The context menu of the editor has these default:
* navigation - The navigation group comes first in all cases.
* 1_modification - This group comes next and contains commands that modify your code.
* 9_cutcopypaste - The last default group with the basic editing commands.
* You can also create your own group.
* Defaults to null (don't show in context menu).
*/
contextMenuGroupId?: string;
/**
* Control the order in the context menu group.
*/
contextMenuOrder?: number;
/**
* Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convinience
*/
run(editor: ICommonCodeEditor): void | Promise<void>;
}
export interface IEditorAction {
readonly id: string;
readonly label: string;
@@ -2025,10 +2014,6 @@ declare module monaco.editor {
* Returns true if this editor has keyboard focus (e.g. cursor is blinking).
*/
isFocused(): boolean;
/**
* Returns all actions associated with this editor.
*/
getActions(): IEditorAction[];
/**
* Returns all actions associated with this editor.
*/
@@ -2183,234 +2168,6 @@ declare module monaco.editor {
restoreViewState?(state: any): void;
}
export interface ICommonCodeEditor extends IEditor {
/**
* An event emitted when the content of the current model has changed.
* @event
*/
onDidChangeModelContent(listener: (e: IModelContentChangedEvent) => void): IDisposable;
/**
* An event emitted when the language of the current model has changed.
* @event
*/
onDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable;
/**
* An event emitted when the language configuration of the current model has changed.
* @event
*/
onDidChangeModelLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;
/**
* An event emitted when the options of the current model has changed.
* @event
*/
onDidChangeModelOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable;
/**
* An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)
* @event
*/
onDidChangeConfiguration(listener: (e: IConfigurationChangedEvent) => void): IDisposable;
/**
* An event emitted when the cursor position has changed.
* @event
*/
onDidChangeCursorPosition(listener: (e: ICursorPositionChangedEvent) => void): IDisposable;
/**
* An event emitted when the cursor selection has changed.
* @event
*/
onDidChangeCursorSelection(listener: (e: ICursorSelectionChangedEvent) => void): IDisposable;
/**
* An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
* @event
*/
onDidChangeModel(listener: (e: IModelChangedEvent) => void): IDisposable;
/**
* An event emitted when the decorations of the current model have changed.
* @event
*/
onDidChangeModelDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable;
/**
* An event emitted when the text inside this editor gained focus (i.e. cursor blinking).
* @event
*/
onDidFocusEditorText(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor lost focus.
* @event
*/
onDidBlurEditorText(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor or an editor widget gained focus.
* @event
*/
onDidFocusEditor(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor or an editor widget lost focus.
* @event
*/
onDidBlurEditor(listener: () => void): IDisposable;
/**
* Saves current view state of the editor in a serializable object.
*/
saveViewState(): ICodeEditorViewState;
/**
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
*/
restoreViewState(state: ICodeEditorViewState): void;
/**
* Returns true if this editor or one of its widgets has keyboard focus.
*/
hasWidgetFocus(): boolean;
/**
* Get a contribution of this editor.
* @id Unique identifier of the contribution.
* @return The contribution or null if contribution not found.
*/
getContribution<T extends IEditorContribution>(id: string): T;
/**
* Type the getModel() of IEditor.
*/
getModel(): IModel;
/**
* Returns the current editor's configuration
*/
getConfiguration(): InternalEditorOptions;
/**
* Get value of the current model attached to this editor.
* @see IModel.getValue
*/
getValue(options?: {
preserveBOM: boolean;
lineEnding: string;
}): string;
/**
* Set the value of the current model attached to this editor.
* @see IModel.setValue
*/
setValue(newValue: string): void;
/**
* Get the scrollWidth of the editor's viewport.
*/
getScrollWidth(): number;
/**
* Get the scrollLeft of the editor's viewport.
*/
getScrollLeft(): number;
/**
* Get the scrollHeight of the editor's viewport.
*/
getScrollHeight(): number;
/**
* Get the scrollTop of the editor's viewport.
*/
getScrollTop(): number;
/**
* Change the scrollLeft of the editor's viewport.
*/
setScrollLeft(newScrollLeft: number): void;
/**
* Change the scrollTop of the editor's viewport.
*/
setScrollTop(newScrollTop: number): void;
/**
* Change the scroll position of the editor's viewport.
*/
setScrollPosition(position: INewScrollPosition): void;
/**
* Get an action that is a contribution to this editor.
* @id Unique identifier of the contribution.
* @return The action or null if action not found.
*/
getAction(id: string): IEditorAction;
/**
* Execute a command on the editor.
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
* @param source The source of the call.
* @param command The command to execute
*/
executeCommand(source: string, command: ICommand): void;
/**
* Push an "undo stop" in the undo-redo stack.
*/
pushUndoStop(): boolean;
/**
* Execute edits on the editor.
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
* @param source The source of the call.
* @param edits The edits to execute.
* @param endCursoState Cursor state after the edits were applied.
*/
executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursoState?: Selection[]): boolean;
/**
* Execute multiple (concommitent) commands on the editor.
* @param source The source of the call.
* @param command The commands to execute
*/
executeCommands(source: string, commands: ICommand[]): void;
/**
* Get all the decorations on a line (filtering out decorations from other editors).
*/
getLineDecorations(lineNumber: number): IModelDecoration[];
/**
* All decorations added through this call will get the ownerId of this editor.
* @see IModel.deltaDecorations
*/
deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
/**
* Get the layout info for the editor.
*/
getLayoutInfo(): EditorLayoutInfo;
}
export interface ICommonDiffEditor extends IEditor {
/**
* An event emitted when the diff information computed by this diff editor has been updated.
* @event
*/
onDidUpdateDiff(listener: () => void): IDisposable;
/**
* Saves current view state of the editor in a serializable object.
*/
saveViewState(): IDiffEditorViewState;
/**
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
*/
restoreViewState(state: IDiffEditorViewState): void;
/**
* Type the getModel() of IEditor.
*/
getModel(): IDiffEditorModel;
/**
* Get the `original` editor.
*/
getOriginalEditor(): ICommonCodeEditor;
/**
* Get the `modified` editor.
*/
getModifiedEditor(): ICommonCodeEditor;
/**
* Get the computed diff information.
*/
getLineChanges(): ILineChange[];
/**
* Get information based on computed diff about a line number from the original model.
* If the diff computation is not finished or the model is missing, will return null.
*/
getDiffLineInformationForOriginal(lineNumber: number): IDiffLineInformation;
/**
* Get information based on computed diff about a line number from the modified model.
* If the diff computation is not finished or the model is missing, will return null.
*/
getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation;
/**
* @see ICodeEditor.getValue
*/
getValue(options?: {
preserveBOM: boolean;
lineEnding: string;
}): string;
}
/**
* The type of the `IEditor`.
*/
@@ -2732,7 +2489,7 @@ declare module monaco.editor {
* Otherwise, line numbers will not be rendered.
* Defaults to true.
*/
lineNumbers?: 'on' | 'off' | 'relative' | ((lineNumber: number) => string);
lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
/**
* Should the corresponding line be selected when clicking on the line number?
* Defaults to true.
@@ -3258,14 +3015,21 @@ declare module monaco.editor {
readonly wordWrapBreakObtrusiveCharacters: string;
}
export const enum RenderLineNumbersType {
Off = 0,
On = 1,
Relative = 2,
Interval = 3,
Custom = 4,
}
export interface InternalEditorViewOptions {
readonly extraEditorClassName: string;
readonly disableMonospaceOptimizations: boolean;
readonly rulers: number[];
readonly ariaLabel: string;
readonly renderLineNumbers: boolean;
readonly renderLineNumbers: RenderLineNumbersType;
readonly renderCustomLineNumbers: (lineNumber: number) => string;
readonly renderRelativeLineNumbers: boolean;
readonly selectOnLineNumbers: boolean;
readonly glyphMargin: boolean;
readonly revealHorizontalRightPadding: number;
@@ -3760,7 +3524,72 @@ declare module monaco.editor {
/**
* A rich code editor.
*/
export interface ICodeEditor extends ICommonCodeEditor {
export interface ICodeEditor extends IEditor {
/**
* An event emitted when the content of the current model has changed.
* @event
*/
onDidChangeModelContent(listener: (e: IModelContentChangedEvent) => void): IDisposable;
/**
* An event emitted when the language of the current model has changed.
* @event
*/
onDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable;
/**
* An event emitted when the language configuration of the current model has changed.
* @event
*/
onDidChangeModelLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;
/**
* An event emitted when the options of the current model has changed.
* @event
*/
onDidChangeModelOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable;
/**
* An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)
* @event
*/
onDidChangeConfiguration(listener: (e: IConfigurationChangedEvent) => void): IDisposable;
/**
* An event emitted when the cursor position has changed.
* @event
*/
onDidChangeCursorPosition(listener: (e: ICursorPositionChangedEvent) => void): IDisposable;
/**
* An event emitted when the cursor selection has changed.
* @event
*/
onDidChangeCursorSelection(listener: (e: ICursorSelectionChangedEvent) => void): IDisposable;
/**
* An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
* @event
*/
onDidChangeModel(listener: (e: IModelChangedEvent) => void): IDisposable;
/**
* An event emitted when the decorations of the current model have changed.
* @event
*/
onDidChangeModelDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable;
/**
* An event emitted when the text inside this editor gained focus (i.e. cursor blinking).
* @event
*/
onDidFocusEditorText(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor lost focus.
* @event
*/
onDidBlurEditorText(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor or an editor widget gained focus.
* @event
*/
onDidFocusEditor(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor or an editor widget lost focus.
* @event
*/
onDidBlurEditor(listener: () => void): IDisposable;
/**
* An event emitted on a "mouseup".
* @event
@@ -3806,6 +3635,129 @@ declare module monaco.editor {
* @event
*/
onDidScrollChange(listener: (e: IScrollEvent) => void): IDisposable;
/**
* Saves current view state of the editor in a serializable object.
*/
saveViewState(): ICodeEditorViewState;
/**
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
*/
restoreViewState(state: ICodeEditorViewState): void;
/**
* Returns true if this editor or one of its widgets has keyboard focus.
*/
hasWidgetFocus(): boolean;
/**
* Get a contribution of this editor.
* @id Unique identifier of the contribution.
* @return The contribution or null if contribution not found.
*/
getContribution<T extends IEditorContribution>(id: string): T;
/**
* Type the getModel() of IEditor.
*/
getModel(): IModel;
/**
* Returns the current editor's configuration
*/
getConfiguration(): InternalEditorOptions;
/**
* Get value of the current model attached to this editor.
* @see IModel.getValue
*/
getValue(options?: {
preserveBOM: boolean;
lineEnding: string;
}): string;
/**
* Set the value of the current model attached to this editor.
* @see IModel.setValue
*/
setValue(newValue: string): void;
/**
* Get the scrollWidth of the editor's viewport.
*/
getScrollWidth(): number;
/**
* Get the scrollLeft of the editor's viewport.
*/
getScrollLeft(): number;
/**
* Get the scrollHeight of the editor's viewport.
*/
getScrollHeight(): number;
/**
* Get the scrollTop of the editor's viewport.
*/
getScrollTop(): number;
/**
* Change the scrollLeft of the editor's viewport.
*/
setScrollLeft(newScrollLeft: number): void;
/**
* Change the scrollTop of the editor's viewport.
*/
setScrollTop(newScrollTop: number): void;
/**
* Change the scroll position of the editor's viewport.
*/
setScrollPosition(position: INewScrollPosition): void;
/**
* Get an action that is a contribution to this editor.
* @id Unique identifier of the contribution.
* @return The action or null if action not found.
*/
getAction(id: string): IEditorAction;
/**
* Execute a command on the editor.
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
* @param source The source of the call.
* @param command The command to execute
*/
executeCommand(source: string, command: ICommand): void;
/**
* Push an "undo stop" in the undo-redo stack.
*/
pushUndoStop(): boolean;
/**
* Execute edits on the editor.
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
* @param source The source of the call.
* @param edits The edits to execute.
* @param endCursoState Cursor state after the edits were applied.
*/
executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursoState?: Selection[]): boolean;
/**
* Execute multiple (concommitent) commands on the editor.
* @param source The source of the call.
* @param command The commands to execute
*/
executeCommands(source: string, commands: ICommand[]): void;
/**
* Get all the decorations on a line (filtering out decorations from other editors).
*/
getLineDecorations(lineNumber: number): IModelDecoration[];
/**
* All decorations added through this call will get the ownerId of this editor.
* @see IModel.deltaDecorations
*/
deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
/**
* Get the layout info for the editor.
*/
getLayoutInfo(): EditorLayoutInfo;
/**
* Returns the range that is currently centered in the view port.
*/
getCenteredRangeInViewport(): Range;
/**
* Get the vertical position (top offset) for the line w.r.t. to the first line.
*/
getTopForLineNumber(lineNumber: number): number;
/**
* Get the vertical position (top offset) for the position w.r.t. to the first line.
*/
getTopForPosition(lineNumber: number, column: number): number;
/**
* Returns the editor's dom node
*/
@@ -3840,10 +3792,6 @@ declare module monaco.editor {
* Change the view zones. View zones are lost when a new model is attached to the editor.
*/
changeViewZones(callback: (accessor: IViewZoneChangeAccessor) => void): void;
/**
* Returns the range that is currently centered in the view port.
*/
getCenteredRangeInViewport(): Range;
/**
* Get the horizontal position (left offset) for the column w.r.t to the beginning of the line.
* This method works only if the line `lineNumber` is currently rendered (in the editor's viewport).
@@ -3854,14 +3802,6 @@ declare module monaco.editor {
* Force an editor render now.
*/
render(): void;
/**
* Get the vertical position (top offset) for the line w.r.t. to the first line.
*/
getTopForLineNumber(lineNumber: number): number;
/**
* Get the vertical position (top offset) for the position w.r.t. to the first line.
*/
getTopForPosition(lineNumber: number, column: number): number;
/**
* Get the hit test target at coordinates `clientX` and `clientY`.
* The coordinates are relative to the top-left of the viewport.
@@ -3887,14 +3827,60 @@ declare module monaco.editor {
applyFontInfo(target: HTMLElement): void;
}
/**
* Information about a line in the diff editor
*/
export interface IDiffLineInformation {
readonly equivalentLineNumber: number;
}
/**
* A rich diff editor.
*/
export interface IDiffEditor extends ICommonDiffEditor {
export interface IDiffEditor extends IEditor {
/**
* @see ICodeEditor.getDomNode
*/
getDomNode(): HTMLElement;
/**
* An event emitted when the diff information computed by this diff editor has been updated.
* @event
*/
onDidUpdateDiff(listener: () => void): IDisposable;
/**
* Saves current view state of the editor in a serializable object.
*/
saveViewState(): IDiffEditorViewState;
/**
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
*/
restoreViewState(state: IDiffEditorViewState): void;
/**
* Type the getModel() of IEditor.
*/
getModel(): IDiffEditorModel;
/**
* Get the `original` editor.
*/
getOriginalEditor(): ICodeEditor;
/**
* Get the `modified` editor.
*/
getModifiedEditor(): ICodeEditor;
/**
* Get the computed diff information.
*/
getLineChanges(): ILineChange[];
/**
* Get information based on computed diff about a line number from the original model.
* If the diff computation is not finished or the model is missing, will return null.
*/
getDiffLineInformationForOriginal(lineNumber: number): IDiffLineInformation;
/**
* Get information based on computed diff about a line number from the modified model.
* If the diff computation is not finished or the model is missing, will return null.
*/
getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation;
}
export class FontInfo extends BareFontInfo {
@@ -4094,7 +4080,7 @@ declare module monaco.languages {
/**
* Provide commands for the given document and range.
*/
provideCodeActions(model: editor.IReadOnlyModel, range: Range, context: CodeActionContext, token: CancellationToken): Command[] | Thenable<Command[]>;
provideCodeActions(model: editor.IReadOnlyModel, range: Range, context: CodeActionContext, token: CancellationToken): (Command | CodeAction)[] | Thenable<(Command | CodeAction)[]>;
}
/**
@@ -4530,6 +4516,13 @@ declare module monaco.languages {
TriggerCharacter = 1,
}
export interface CodeAction {
title: string;
command?: Command;
edits?: WorkspaceEdit;
diagnostics?: editor.IMarkerData[];
}
/**
* Represents a parameter of a callable-signature. A parameter can
* have a label and a doc-comment.