mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -8,13 +8,30 @@ import { Part } from 'vs/workbench/browser/part';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { append, $, hide } from 'vs/base/browser/dom';
|
||||
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { TestStorageService, TestLayoutService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { Orientation } from 'vs/base/browser/ui/grid/grid';
|
||||
|
||||
class MyPart extends Part {
|
||||
class SimplePart extends Part {
|
||||
|
||||
minimumWidth: number;
|
||||
maximumWidth: number;
|
||||
minimumHeight: number;
|
||||
maximumHeight: number;
|
||||
|
||||
layout(width: number, height: number, orientation: Orientation): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
toJSON(): object {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
class MyPart extends SimplePart {
|
||||
|
||||
constructor(private expectedParent: HTMLElement) {
|
||||
super('myPart', { hasTitle: true }, new TestThemeService(), new TestStorageService());
|
||||
super('myPart', { hasTitle: true }, new TestThemeService(), new TestStorageService(), new TestLayoutService());
|
||||
}
|
||||
|
||||
createTitleArea(parent: HTMLElement): HTMLElement {
|
||||
@@ -36,10 +53,10 @@ class MyPart extends Part {
|
||||
}
|
||||
}
|
||||
|
||||
class MyPart2 extends Part {
|
||||
class MyPart2 extends SimplePart {
|
||||
|
||||
constructor() {
|
||||
super('myPart2', { hasTitle: true }, new TestThemeService(), new TestStorageService());
|
||||
super('myPart2', { hasTitle: true }, new TestThemeService(), new TestStorageService(), new TestLayoutService());
|
||||
}
|
||||
|
||||
createTitleArea(parent: HTMLElement): HTMLElement {
|
||||
@@ -61,10 +78,10 @@ class MyPart2 extends Part {
|
||||
}
|
||||
}
|
||||
|
||||
class MyPart3 extends Part {
|
||||
class MyPart3 extends SimplePart {
|
||||
|
||||
constructor() {
|
||||
super('myPart2', { hasTitle: false }, new TestThemeService(), new TestStorageService());
|
||||
super('myPart2', { hasTitle: false }, new TestThemeService(), new TestStorageService(), new TestLayoutService());
|
||||
}
|
||||
|
||||
createTitleArea(parent: HTMLElement): HTMLElement {
|
||||
|
||||
@@ -154,10 +154,10 @@ suite('Workbench base editor', () => {
|
||||
|
||||
let inst = new TestInstantiationService();
|
||||
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake'))).instantiate(inst);
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
|
||||
assert.strictEqual(editor.getId(), 'myEditor');
|
||||
|
||||
const otherEditor = EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', URI.file('/fake'))).instantiate(inst);
|
||||
const otherEditor = EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
|
||||
assert.strictEqual(otherEditor.getId(), 'myOtherEditor');
|
||||
|
||||
(<any>EditorRegistry).setEditors(oldEditors);
|
||||
@@ -173,14 +173,14 @@ suite('Workbench base editor', () => {
|
||||
|
||||
let inst = new TestInstantiationService();
|
||||
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake'))).instantiate(inst);
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
|
||||
assert.strictEqual('myOtherEditor', editor.getId());
|
||||
|
||||
(<any>EditorRegistry).setEditors(oldEditors);
|
||||
});
|
||||
|
||||
test('Editor Input Factory', function () {
|
||||
EditorInputRegistry.setInstantiationService(workbenchInstantiationService());
|
||||
workbenchInstantiationService().invokeFunction(accessor => EditorInputRegistry.start(accessor));
|
||||
EditorInputRegistry.registerEditorInputFactory('myInputId', MyInputFactory);
|
||||
|
||||
let factory = EditorInputRegistry.getEditorInputFactory('myInputId');
|
||||
@@ -211,12 +211,12 @@ suite('Workbench base editor', () => {
|
||||
memento.saveEditorState(testGroup0, URI.file('/A'), { line: 3 });
|
||||
res = memento.loadEditorState(testGroup0, URI.file('/A'));
|
||||
assert.ok(res);
|
||||
assert.equal(res.line, 3);
|
||||
assert.equal(res!.line, 3);
|
||||
|
||||
memento.saveEditorState(testGroup1, URI.file('/A'), { line: 5 });
|
||||
res = memento.loadEditorState(testGroup1, URI.file('/A'));
|
||||
assert.ok(res);
|
||||
assert.equal(res.line, 5);
|
||||
assert.equal(res!.line, 5);
|
||||
|
||||
// Ensure capped at 3 elements
|
||||
memento.saveEditorState(testGroup0, URI.file('/B'), { line: 1 });
|
||||
@@ -289,7 +289,7 @@ suite('Workbench base editor', () => {
|
||||
memento.saveEditorState(testGroup0, testInputA, { line: 3 });
|
||||
res = memento.loadEditorState(testGroup0, testInputA);
|
||||
assert.ok(res);
|
||||
assert.equal(res.line, 3);
|
||||
assert.equal(res!.line, 3);
|
||||
|
||||
// State removed when input gets disposed
|
||||
testInputA.dispose();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { ContributableViewsModel, ViewsService } from 'vs/workbench/browser/parts/views/views';
|
||||
import { ViewsRegistry, IViewDescriptor, IViewContainersRegistry, Extensions as ViewContainerExtensions, IViewsService } from 'vs/workbench/common/views';
|
||||
import { IViewsRegistry, IViewDescriptor, IViewContainersRegistry, Extensions as ViewContainerExtensions, IViewsService } from 'vs/workbench/common/views';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { move } from 'vs/base/common/arrays';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -15,6 +15,7 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
|
||||
import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService';
|
||||
|
||||
const container = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer('test');
|
||||
const ViewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry);
|
||||
|
||||
class ViewDescriptorSequence {
|
||||
|
||||
@@ -63,7 +64,7 @@ suite('ContributableViewsModel', () => {
|
||||
|
||||
const viewDescriptor: IViewDescriptor = {
|
||||
id: 'view1',
|
||||
ctor: null,
|
||||
ctorDescriptor: null!,
|
||||
name: 'Test View 1'
|
||||
};
|
||||
|
||||
@@ -89,7 +90,7 @@ suite('ContributableViewsModel', () => {
|
||||
|
||||
const viewDescriptor: IViewDescriptor = {
|
||||
id: 'view1',
|
||||
ctor: null,
|
||||
ctorDescriptor: null!,
|
||||
name: 'Test View 1',
|
||||
when: ContextKeyExpr.equals('showview1', true)
|
||||
};
|
||||
@@ -128,8 +129,8 @@ suite('ContributableViewsModel', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, name: 'Test View 1' };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, name: 'Test View 2', when: ContextKeyExpr.equals('showview2', true) };
|
||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1' };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2', when: ContextKeyExpr.equals('showview2', true) };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1], 'only view1 should be visible');
|
||||
@@ -151,8 +152,8 @@ suite('ContributableViewsModel', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, name: 'Test View 1', when: ContextKeyExpr.equals('showview1', true) };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, name: 'Test View 2' };
|
||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1', when: ContextKeyExpr.equals('showview1', true) };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2' };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view2], 'only view2 should be visible');
|
||||
@@ -174,9 +175,9 @@ suite('ContributableViewsModel', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, name: 'Test View 1', canToggleVisibility: true };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, name: 'Test View 2', canToggleVisibility: true };
|
||||
const view3: IViewDescriptor = { id: 'view3', ctor: null, name: 'Test View 3', canToggleVisibility: true };
|
||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1', canToggleVisibility: true };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2', canToggleVisibility: true };
|
||||
const view3: IViewDescriptor = { id: 'view3', ctorDescriptor: null!, name: 'Test View 3', canToggleVisibility: true };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2, view3], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2, view3]);
|
||||
@@ -219,9 +220,9 @@ suite('ContributableViewsModel', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, name: 'Test View 1' };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, name: 'Test View 2' };
|
||||
const view3: IViewDescriptor = { id: 'view3', ctor: null, name: 'Test View 3' };
|
||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1' };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2' };
|
||||
const view3: IViewDescriptor = { id: 'view3', ctorDescriptor: null!, name: 'Test View 3' };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2, view3], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2, view3], 'model views should be OK');
|
||||
|
||||
Reference in New Issue
Block a user