mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 11:08:31 -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:
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { CursorColumns, CursorConfiguration, EditOperationResult, CursorContext, CursorState, RevealTarget, IColumnSelectData, ICursors, EditOperationType } from 'vs/editor/common/controller/cursorCommon';
|
||||
import { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperations';
|
||||
import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations';
|
||||
import { TextModelEventType, ModelRawContentChangedEvent, RawContentChangedType } from 'vs/editor/common/model/textModelEvents';
|
||||
import { RawContentChangedType } from 'vs/editor/common/model/textModelEvents';
|
||||
import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { IViewModel } from 'vs/editor/common/viewModel/viewModel';
|
||||
import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
||||
@@ -113,28 +113,12 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
|
||||
this._columnSelectData = null;
|
||||
this._prevEditOperationType = EditOperationType.Other;
|
||||
|
||||
this._register(this._model.addBulkListener((events) => {
|
||||
this._register(this._model.onDidChangeRawContent((e) => {
|
||||
if (this._isHandling) {
|
||||
return;
|
||||
}
|
||||
|
||||
let hadContentChange = false;
|
||||
let hadFlushEvent = false;
|
||||
for (let i = 0, len = events.length; i < len; i++) {
|
||||
const event = events[i];
|
||||
const eventType = event.type;
|
||||
|
||||
if (eventType === TextModelEventType.ModelRawContentChanged2) {
|
||||
hadContentChange = true;
|
||||
const rawChangeEvent = <ModelRawContentChangedEvent>event.data;
|
||||
hadFlushEvent = hadFlushEvent || rawChangeEvent.containsEvent(RawContentChangedType.Flush);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hadContentChange) {
|
||||
return;
|
||||
}
|
||||
|
||||
let hadFlushEvent = e.containsEvent(RawContentChangedType.Flush);
|
||||
this._onModelContentChanged(hadFlushEvent);
|
||||
}));
|
||||
|
||||
|
||||
@@ -82,7 +82,9 @@ export class CursorConfiguration {
|
||||
public readonly autoClosingPairsOpen: CharacterMap;
|
||||
public readonly autoClosingPairsClose: CharacterMap;
|
||||
public readonly surroundingPairs: CharacterMap;
|
||||
public readonly electricChars: { [key: string]: boolean; };
|
||||
|
||||
private readonly _languageIdentifier: LanguageIdentifier;
|
||||
private _electricChars: { [key: string]: boolean; };
|
||||
|
||||
public static shouldRecreate(e: IConfigurationChangedEvent): boolean {
|
||||
return (
|
||||
@@ -102,6 +104,8 @@ export class CursorConfiguration {
|
||||
modelOptions: TextModelResolvedOptions,
|
||||
configuration: IConfiguration
|
||||
) {
|
||||
this._languageIdentifier = languageIdentifier;
|
||||
|
||||
let c = configuration.editor;
|
||||
|
||||
this.readOnly = c.readOnly;
|
||||
@@ -119,14 +123,7 @@ export class CursorConfiguration {
|
||||
this.autoClosingPairsOpen = {};
|
||||
this.autoClosingPairsClose = {};
|
||||
this.surroundingPairs = {};
|
||||
this.electricChars = {};
|
||||
|
||||
let electricChars = CursorConfiguration._getElectricCharacters(languageIdentifier);
|
||||
if (electricChars) {
|
||||
for (let i = 0; i < electricChars.length; i++) {
|
||||
this.electricChars[electricChars[i]] = true;
|
||||
}
|
||||
}
|
||||
this._electricChars = null;
|
||||
|
||||
let autoClosingPairs = CursorConfiguration._getAutoClosingPairs(languageIdentifier);
|
||||
if (autoClosingPairs) {
|
||||
@@ -144,6 +141,19 @@ export class CursorConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
public get electricChars() {
|
||||
if (!this._electricChars) {
|
||||
this._electricChars = {};
|
||||
let electricChars = CursorConfiguration._getElectricCharacters(this._languageIdentifier);
|
||||
if (electricChars) {
|
||||
for (let i = 0; i < electricChars.length; i++) {
|
||||
this._electricChars[electricChars[i]] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this._electricChars;
|
||||
}
|
||||
|
||||
public normalizeIndentation(str: string): string {
|
||||
return TextModel.normalizeIndentation(str, this.tabSize, this.insertSpaces);
|
||||
}
|
||||
@@ -335,11 +345,6 @@ export class CursorContext {
|
||||
return this.viewModel.getCompletelyVisibleViewRangeAtScrollTop(scrollTop);
|
||||
}
|
||||
|
||||
public getCompletelyVisibleModelRangeAtScrollTop(scrollTop: number): Range {
|
||||
const viewRange = this.viewModel.getCompletelyVisibleViewRangeAtScrollTop(scrollTop);
|
||||
return this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange);
|
||||
}
|
||||
|
||||
public getVerticalOffsetForViewLine(viewLineNumber: number): number {
|
||||
return this.viewModel.viewLayout.getVerticalOffsetForLineNumber(viewLineNumber);
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ export namespace CursorMove {
|
||||
select?: boolean;
|
||||
by?: string;
|
||||
value?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export function parse(args: RawArguments): ParsedArguments {
|
||||
if (!args.to) {
|
||||
@@ -753,7 +753,7 @@ export namespace CursorMove {
|
||||
unit: Unit;
|
||||
select: boolean;
|
||||
value: number;
|
||||
};
|
||||
}
|
||||
|
||||
export const enum Direction {
|
||||
Left,
|
||||
@@ -772,7 +772,7 @@ export namespace CursorMove {
|
||||
ViewPortBottom,
|
||||
|
||||
ViewPortIfOutside,
|
||||
};
|
||||
}
|
||||
|
||||
export const enum Unit {
|
||||
None,
|
||||
@@ -780,6 +780,6 @@ export namespace CursorMove {
|
||||
WrappedLine,
|
||||
Character,
|
||||
HalfLine,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as strings from 'vs/base/common/strings';
|
||||
import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand';
|
||||
import { Selection } from 'vs/editor/common/core/selection';
|
||||
import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';
|
||||
import { IndentAction } from 'vs/editor/common/modes/languageConfiguration';
|
||||
import { IndentAction, EnterAction } from 'vs/editor/common/modes/languageConfiguration';
|
||||
import { SurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand';
|
||||
import { IElectricAction } from 'vs/editor/common/modes/supports/electricCharacter';
|
||||
import { getMapForWordSeparators, WordCharacterClass } from 'vs/editor/common/controller/wordCharacterClassifier';
|
||||
@@ -144,10 +144,10 @@ export class TypeOperations {
|
||||
}
|
||||
|
||||
private static _goodIndentForLine(config: CursorConfiguration, model: ITokenizedModel, lineNumber: number): string {
|
||||
let action;
|
||||
let indentation;
|
||||
let expectedIndentAction = LanguageConfigurationRegistry.getInheritIndentForLine(model, lineNumber, false);
|
||||
let action: IndentAction | EnterAction;
|
||||
let indentation: string;
|
||||
|
||||
let expectedIndentAction = config.autoIndent ? LanguageConfigurationRegistry.getInheritIndentForLine(model, lineNumber, false) : null;
|
||||
if (expectedIndentAction) {
|
||||
action = expectedIndentAction.action;
|
||||
indentation = expectedIndentAction.indentation;
|
||||
|
||||
Reference in New Issue
Block a user