mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-20 20:10:11 -04: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:
@@ -5,6 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!./bracketMatching';
|
||||
import * as nls from 'vs/nls';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -13,13 +14,13 @@ import { Position } from 'vs/editor/common/core/position';
|
||||
import { Selection } from 'vs/editor/common/core/selection';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
|
||||
import { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
@editorAction
|
||||
class SelectBracketAction extends EditorAction {
|
||||
constructor() {
|
||||
super({
|
||||
@@ -34,7 +35,7 @@ class SelectBracketAction extends EditorAction {
|
||||
});
|
||||
}
|
||||
|
||||
public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void {
|
||||
public run(accessor: ServicesAccessor, editor: ICodeEditor): void {
|
||||
let controller = BracketMatchingController.get(editor);
|
||||
if (!controller) {
|
||||
return;
|
||||
@@ -55,15 +56,14 @@ class BracketsData {
|
||||
}
|
||||
}
|
||||
|
||||
@commonEditorContribution
|
||||
export class BracketMatchingController extends Disposable implements editorCommon.IEditorContribution {
|
||||
private static ID = 'editor.contrib.bracketMatchingController';
|
||||
private static readonly ID = 'editor.contrib.bracketMatchingController';
|
||||
|
||||
public static get(editor: editorCommon.ICommonCodeEditor): BracketMatchingController {
|
||||
public static get(editor: ICodeEditor): BracketMatchingController {
|
||||
return editor.getContribution<BracketMatchingController>(BracketMatchingController.ID);
|
||||
}
|
||||
|
||||
private readonly _editor: editorCommon.ICommonCodeEditor;
|
||||
private readonly _editor: ICodeEditor;
|
||||
|
||||
private _lastBracketsData: BracketsData[];
|
||||
private _lastVersionId: number;
|
||||
@@ -72,7 +72,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
|
||||
private _matchBrackets: boolean;
|
||||
|
||||
constructor(
|
||||
editor: editorCommon.ICommonCodeEditor
|
||||
editor: ICodeEditor
|
||||
) {
|
||||
super();
|
||||
this._editor = editor;
|
||||
@@ -148,7 +148,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
|
||||
this._editor.revealRange(newSelections[0]);
|
||||
}
|
||||
|
||||
private static _DECORATION_OPTIONS = ModelDecorationOptions.register({
|
||||
private static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'bracket-match'
|
||||
});
|
||||
@@ -226,6 +226,8 @@ export class BracketMatchingController extends Disposable implements editorCommo
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(BracketMatchingController);
|
||||
registerEditorAction(SelectBracketAction);
|
||||
registerThemingParticipant((theme, collector) => {
|
||||
let bracketMatchBackground = theme.getColor(editorBracketMatchBackground);
|
||||
if (bracketMatchBackground) {
|
||||
@@ -5,18 +5,18 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor';
|
||||
import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { Model } from 'vs/editor/common/model/model';
|
||||
import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';
|
||||
import { MockMode } from 'vs/editor/test/common/mocks/mockMode';
|
||||
import { LanguageIdentifier } from 'vs/editor/common/modes';
|
||||
import { BracketMatchingController } from 'vs/editor/contrib/bracketMatching/common/bracketMatching';
|
||||
import { BracketMatchingController } from 'vs/editor/contrib/bracketMatching/bracketMatching';
|
||||
|
||||
suite('bracket matching', () => {
|
||||
class BracketMode extends MockMode {
|
||||
|
||||
private static _id = new LanguageIdentifier('bracketMode', 3);
|
||||
private static readonly _id = new LanguageIdentifier('bracketMode', 3);
|
||||
|
||||
constructor() {
|
||||
super(BracketMode._id);
|
||||
@@ -34,7 +34,7 @@ suite('bracket matching', () => {
|
||||
let mode = new BracketMode();
|
||||
let model = Model.createFromString('var x = (3 + (5-7)) + ((5+3)+5);', undefined, mode.getLanguageIdentifier());
|
||||
|
||||
withMockCodeEditor(null, { model: model }, (editor, cursor) => {
|
||||
withTestCodeEditor(null, { model: model }, (editor, cursor) => {
|
||||
let bracketMatchingController = editor.registerAndInstantiateContribution<BracketMatchingController>(BracketMatchingController);
|
||||
|
||||
// start on closing bracket
|
||||
@@ -66,7 +66,7 @@ suite('bracket matching', () => {
|
||||
let mode = new BracketMode();
|
||||
let model = Model.createFromString('var x = (3 + (5-7)); y();', undefined, mode.getLanguageIdentifier());
|
||||
|
||||
withMockCodeEditor(null, { model: model }, (editor, cursor) => {
|
||||
withTestCodeEditor(null, { model: model }, (editor, cursor) => {
|
||||
let bracketMatchingController = editor.registerAndInstantiateContribution<BracketMatchingController>(BracketMatchingController);
|
||||
|
||||
// start position between brackets
|
||||
Reference in New Issue
Block a user