mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 02:48:30 -05:00
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:
@@ -4,26 +4,21 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { BulkListenerCallback } from 'vs/base/common/eventEmitter';
|
||||
import { IMarkdownString } from 'vs/base/common/htmlContent';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes';
|
||||
import { LineTokens } from 'vs/editor/common/core/lineTokens';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Position, IPosition } from 'vs/editor/common/core/position';
|
||||
import { Range, IRange } from 'vs/editor/common/core/range';
|
||||
import { Selection, ISelection } from 'vs/editor/common/core/selection';
|
||||
import { IndentRanges } from 'vs/editor/common/model/indentRanges';
|
||||
import { ITextSource } from 'vs/editor/common/model/textSource';
|
||||
import {
|
||||
ModelRawContentChangedEvent, IModelContentChangedEvent, IModelDecorationsChangedEvent,
|
||||
IModelLanguageChangedEvent, IModelOptionsChangedEvent, IModelLanguageConfigurationChangedEvent
|
||||
IModelLanguageChangedEvent, IModelOptionsChangedEvent, IModelLanguageConfigurationChangedEvent, IModelTokensChangedEvent
|
||||
} from 'vs/editor/common/model/textModelEvents';
|
||||
import * as editorOptions from 'vs/editor/common/config/editorOptions';
|
||||
import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { ICursors, CursorConfiguration } from 'vs/editor/common/controller/cursorCommon';
|
||||
import { ThemeColor } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
/**
|
||||
@@ -895,11 +890,6 @@ export interface ITokenizedModel extends ITextModel {
|
||||
*/
|
||||
matchBracket(position: IPosition): [Range, Range];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
getIndentRanges(): IndentRanges;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@@ -1137,29 +1127,23 @@ export interface IModel extends IReadOnlyModel, IEditableTextModel, ITokenizedMo
|
||||
* @event
|
||||
*/
|
||||
onDidChangeLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted when the tokens associated with the model have changed.
|
||||
* @event
|
||||
* @internal
|
||||
*/
|
||||
onDidChangeTokens(listener: (e: IModelTokensChangedEvent) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted right before disposing the model.
|
||||
* @event
|
||||
*/
|
||||
onWillDispose(listener: () => void): IDisposable;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
addBulkListener(listener: BulkListenerCallback): IDisposable;
|
||||
|
||||
/**
|
||||
* A unique identifier associated with this model.
|
||||
*/
|
||||
readonly id: string;
|
||||
|
||||
/**
|
||||
* Destroy this model. This will unbind the model from the mode
|
||||
* and make all necessary clean-up to release this object to the GC.
|
||||
* @internal
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Destroy this model. This will unbind the model from the mode
|
||||
* and make all necessary clean-up to release this object to the GC.
|
||||
@@ -1240,12 +1224,6 @@ export interface ICharChange extends IChange {
|
||||
export interface ILineChange extends IChange {
|
||||
readonly charChanges: ICharChange[];
|
||||
}
|
||||
/**
|
||||
* Information about a line in the diff editor
|
||||
*/
|
||||
export interface IDiffLineInformation {
|
||||
readonly equivalentLineNumber: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -1277,51 +1255,6 @@ export interface INewScrollPosition {
|
||||
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 | TPromise<void>;
|
||||
}
|
||||
|
||||
export interface IEditorAction {
|
||||
readonly id: string;
|
||||
readonly label: string;
|
||||
@@ -1399,12 +1332,6 @@ export interface IEditor {
|
||||
*/
|
||||
getEditorType(): string;
|
||||
|
||||
/**
|
||||
* Destroy the editor.
|
||||
* @internal
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Update the editor's options after the editor has been created.
|
||||
*/
|
||||
@@ -1438,11 +1365,6 @@ export interface IEditor {
|
||||
*/
|
||||
isFocused(): boolean;
|
||||
|
||||
/**
|
||||
* Returns all actions associated with this editor.
|
||||
*/
|
||||
getActions(): IEditorAction[];
|
||||
|
||||
/**
|
||||
* Returns all actions associated with this editor.
|
||||
*/
|
||||
@@ -1725,333 +1647,6 @@ export interface IDecorationOptions {
|
||||
renderOptions?: IDecorationInstanceRenderOptions;
|
||||
}
|
||||
|
||||
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: editorOptions.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 before interpreting typed characters (on the keyboard).
|
||||
* @event
|
||||
* @internal
|
||||
*/
|
||||
onWillType(listener: (text: string) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted before interpreting typed characters (on the keyboard).
|
||||
* @event
|
||||
* @internal
|
||||
*/
|
||||
onDidType(listener: (text: string) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted when users paste text in the editor.
|
||||
* @event
|
||||
* @internal
|
||||
*/
|
||||
onDidPaste(listener: (range: Range) => 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;
|
||||
|
||||
/**
|
||||
* Execute `fn` with the editor's services.
|
||||
* @internal
|
||||
*/
|
||||
invokeWithinContext<T>(fn: (accessor: ServicesAccessor) => T): T;
|
||||
|
||||
/**
|
||||
* Type the getModel() of IEditor.
|
||||
*/
|
||||
getModel(): IModel;
|
||||
|
||||
/**
|
||||
* Returns the current editor's configuration
|
||||
*/
|
||||
getConfiguration(): editorOptions.InternalEditorOptions;
|
||||
|
||||
/**
|
||||
* Returns the 'raw' editor's configuration (without any validation or defaults).
|
||||
* @internal
|
||||
*/
|
||||
getRawConfiguration(): editorOptions.IEditorOptions;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
_getCursors(): ICursors;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
_getCursorConfiguration(): CursorConfiguration;
|
||||
|
||||
/**
|
||||
* 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[];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
setDecorations(decorationTypeKey: string, ranges: IDecorationOptions[]): void;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
setDecorationsFast(decorationTypeKey: string, ranges: IRange[]): void;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
removeDecorations(decorationTypeKey: string): void;
|
||||
|
||||
/**
|
||||
* Get the layout info for the editor.
|
||||
*/
|
||||
getLayoutInfo(): editorOptions.EditorLayoutInfo;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
getTelemetryData(): { [key: string]: any; };
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Returns whether the diff editor is ignoring trim whitespace or not.
|
||||
* @internal
|
||||
*/
|
||||
readonly ignoreTrimWhitespace: boolean;
|
||||
|
||||
/**
|
||||
* Returns whether the diff editor is rendering side by side or not.
|
||||
* @internal
|
||||
*/
|
||||
readonly renderSideBySide: boolean;
|
||||
/**
|
||||
* Returns whether the diff editor is rendering +/- indicators or not.
|
||||
* @internal
|
||||
*/
|
||||
readonly renderIndicators: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of the `IEditor`.
|
||||
*/
|
||||
@@ -2060,28 +1655,6 @@ export var EditorType = {
|
||||
IDiffEditor: 'vs.editor.IDiffEditor'
|
||||
};
|
||||
|
||||
/**
|
||||
*@internal
|
||||
*/
|
||||
export function isCommonCodeEditor(thing: any): thing is ICommonCodeEditor {
|
||||
if (thing && typeof (<ICommonCodeEditor>thing).getEditorType === 'function') {
|
||||
return (<ICommonCodeEditor>thing).getEditorType() === EditorType.ICodeEditor;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*@internal
|
||||
*/
|
||||
export function isCommonDiffEditor(thing: any): thing is ICommonDiffEditor {
|
||||
if (thing && typeof (<ICommonDiffEditor>thing).getEditorType === 'function') {
|
||||
return (<ICommonDiffEditor>thing).getEditorType() === EditorType.IDiffEditor;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Built-in commands.
|
||||
* @internal
|
||||
|
||||
Reference in New Issue
Block a user