mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 11:08:31 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -19,12 +19,12 @@ class MyPart extends Part {
|
||||
|
||||
createTitleArea(parent: HTMLElement): HTMLElement {
|
||||
assert.strictEqual(parent, this.expectedParent);
|
||||
return super.createTitleArea(parent);
|
||||
return super.createTitleArea(parent)!;
|
||||
}
|
||||
|
||||
createContentArea(parent: HTMLElement): HTMLElement {
|
||||
assert.strictEqual(parent, this.expectedParent);
|
||||
return super.createContentArea(parent);
|
||||
return super.createContentArea(parent)!;
|
||||
}
|
||||
|
||||
getMemento(scope: StorageScope) {
|
||||
@@ -68,7 +68,7 @@ class MyPart3 extends Part {
|
||||
}
|
||||
|
||||
createTitleArea(parent: HTMLElement): HTMLElement {
|
||||
return null;
|
||||
return null!;
|
||||
}
|
||||
|
||||
createContentArea(parent: HTMLElement): HTMLElement {
|
||||
@@ -97,7 +97,7 @@ suite('Workbench parts', () => {
|
||||
|
||||
test('Creation', () => {
|
||||
let b = document.createElement('div');
|
||||
document.getElementById(fixtureId).appendChild(b);
|
||||
document.getElementById(fixtureId)!.appendChild(b);
|
||||
hide(b);
|
||||
|
||||
let part = new MyPart(b);
|
||||
@@ -134,7 +134,7 @@ suite('Workbench parts', () => {
|
||||
|
||||
test('Part Layout with Title and Content', function () {
|
||||
let b = document.createElement('div');
|
||||
document.getElementById(fixtureId).appendChild(b);
|
||||
document.getElementById(fixtureId)!.appendChild(b);
|
||||
hide(b);
|
||||
|
||||
let part = new MyPart2();
|
||||
@@ -146,7 +146,7 @@ suite('Workbench parts', () => {
|
||||
|
||||
test('Part Layout with Content only', function () {
|
||||
let b = document.createElement('div');
|
||||
document.getElementById(fixtureId).appendChild(b);
|
||||
document.getElementById(fixtureId)!.appendChild(b);
|
||||
hide(b);
|
||||
|
||||
let part = new MyPart3();
|
||||
|
||||
@@ -267,7 +267,7 @@ suite('Workbench base editor', () => {
|
||||
super();
|
||||
}
|
||||
public getTypeId() { return 'testEditorInput'; }
|
||||
public resolve(): Thenable<IEditorModel> { return Promise.resolve(null); }
|
||||
public resolve(): Promise<IEditorModel> { return Promise.resolve(null!); }
|
||||
|
||||
public matches(other: TestEditorInput): boolean {
|
||||
return other && this.id === other.id && other instanceof TestEditorInput;
|
||||
|
||||
@@ -40,7 +40,7 @@ suite('Editor - Range decorations', () => {
|
||||
model = aModel(URI.file('some_file'));
|
||||
codeEditor = createTestCodeEditor({ model: model });
|
||||
|
||||
instantiationService.stub(IEditorService, 'activeEditor', { getResource: () => { return codeEditor.getModel().uri; } });
|
||||
instantiationService.stub(IEditorService, 'activeEditor', { getResource: () => { return codeEditor.getModel()!.uri; } });
|
||||
instantiationService.stub(IEditorService, 'activeTextEditorWidget', codeEditor);
|
||||
|
||||
testObject = instantiationService.createInstance(RangeHighlightDecorations);
|
||||
|
||||
@@ -46,7 +46,7 @@ suite('ContributableViewsModel', () => {
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
ViewsRegistry.deregisterViews(ViewsRegistry.getViews(container).map(({ id }) => id), container);
|
||||
ViewsRegistry.deregisterViews(ViewsRegistry.getViews(container), container);
|
||||
});
|
||||
|
||||
test('empty model', function () {
|
||||
@@ -64,18 +64,17 @@ suite('ContributableViewsModel', () => {
|
||||
const viewDescriptor: IViewDescriptor = {
|
||||
id: 'view1',
|
||||
ctor: null,
|
||||
container,
|
||||
name: 'Test View 1'
|
||||
};
|
||||
|
||||
ViewsRegistry.registerViews([viewDescriptor]);
|
||||
ViewsRegistry.registerViews([viewDescriptor], container);
|
||||
|
||||
assert.equal(model.visibleViewDescriptors.length, 1);
|
||||
assert.equal(seq.elements.length, 1);
|
||||
assert.deepEqual(model.visibleViewDescriptors[0], viewDescriptor);
|
||||
assert.deepEqual(seq.elements[0], viewDescriptor);
|
||||
|
||||
ViewsRegistry.deregisterViews(['view1'], container);
|
||||
ViewsRegistry.deregisterViews([viewDescriptor], container);
|
||||
|
||||
assert.equal(model.visibleViewDescriptors.length, 0);
|
||||
assert.equal(seq.elements.length, 0);
|
||||
@@ -91,12 +90,11 @@ suite('ContributableViewsModel', () => {
|
||||
const viewDescriptor: IViewDescriptor = {
|
||||
id: 'view1',
|
||||
ctor: null,
|
||||
container,
|
||||
name: 'Test View 1',
|
||||
when: ContextKeyExpr.equals('showview1', true)
|
||||
};
|
||||
|
||||
ViewsRegistry.registerViews([viewDescriptor]);
|
||||
ViewsRegistry.registerViews([viewDescriptor], container);
|
||||
assert.equal(model.visibleViewDescriptors.length, 0, 'view should not appear since context isnt in');
|
||||
assert.equal(seq.elements.length, 0);
|
||||
|
||||
@@ -116,7 +114,7 @@ suite('ContributableViewsModel', () => {
|
||||
assert.equal(model.visibleViewDescriptors.length, 0, 'view should disappear');
|
||||
assert.equal(seq.elements.length, 0);
|
||||
|
||||
ViewsRegistry.deregisterViews(['view1'], container);
|
||||
ViewsRegistry.deregisterViews([viewDescriptor], container);
|
||||
assert.equal(model.visibleViewDescriptors.length, 0, 'view should not be there anymore');
|
||||
assert.equal(seq.elements.length, 0);
|
||||
|
||||
@@ -130,10 +128,10 @@ suite('ContributableViewsModel', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, container, name: 'Test View 1' };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, container, name: 'Test View 2', when: ContextKeyExpr.equals('showview2', true) };
|
||||
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) };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2]);
|
||||
ViewsRegistry.registerViews([view1, view2], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1], 'only view1 should be visible');
|
||||
assert.deepEqual(seq.elements, [view1], 'only view1 should be visible');
|
||||
|
||||
@@ -146,17 +144,17 @@ suite('ContributableViewsModel', () => {
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2], 'both views should be visible');
|
||||
assert.deepEqual(seq.elements, [view1, view2], 'both views should be visible');
|
||||
|
||||
ViewsRegistry.deregisterViews([view1.id, view2.id], container);
|
||||
ViewsRegistry.deregisterViews([view1, view2], container);
|
||||
});
|
||||
|
||||
test('when contexts - multiple 2', async function () {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, container, name: 'Test View 1', when: ContextKeyExpr.equals('showview1', true) };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, container, name: 'Test View 2' };
|
||||
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' };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2]);
|
||||
ViewsRegistry.registerViews([view1, view2], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view2], 'only view2 should be visible');
|
||||
assert.deepEqual(seq.elements, [view2], 'only view2 should be visible');
|
||||
|
||||
@@ -169,18 +167,18 @@ suite('ContributableViewsModel', () => {
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2], 'both views should be visible');
|
||||
assert.deepEqual(seq.elements, [view1, view2], 'both views should be visible');
|
||||
|
||||
ViewsRegistry.deregisterViews([view1.id, view2.id], container);
|
||||
ViewsRegistry.deregisterViews([view1, view2], container);
|
||||
});
|
||||
|
||||
test('setVisible', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, container, name: 'Test View 1', canToggleVisibility: true };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, container, name: 'Test View 2', canToggleVisibility: true };
|
||||
const view3: IViewDescriptor = { id: 'view3', ctor: null, container, name: 'Test View 3', canToggleVisibility: true };
|
||||
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 };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2, view3]);
|
||||
ViewsRegistry.registerViews([view1, view2, view3], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2, view3]);
|
||||
assert.deepEqual(seq.elements, [view1, view2, view3]);
|
||||
|
||||
@@ -212,7 +210,7 @@ suite('ContributableViewsModel', () => {
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2, view3], 'view2 should show');
|
||||
assert.deepEqual(seq.elements, [view1, view2, view3]);
|
||||
|
||||
ViewsRegistry.deregisterViews([view1.id, view2.id, view3.id], container);
|
||||
ViewsRegistry.deregisterViews([view1, view2, view3], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, []);
|
||||
assert.deepEqual(seq.elements, []);
|
||||
});
|
||||
@@ -221,11 +219,11 @@ suite('ContributableViewsModel', () => {
|
||||
const model = new ContributableViewsModel(container, viewsService);
|
||||
const seq = new ViewDescriptorSequence(model);
|
||||
|
||||
const view1: IViewDescriptor = { id: 'view1', ctor: null, container, name: 'Test View 1' };
|
||||
const view2: IViewDescriptor = { id: 'view2', ctor: null, container, name: 'Test View 2' };
|
||||
const view3: IViewDescriptor = { id: 'view3', ctor: null, container, name: 'Test View 3' };
|
||||
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' };
|
||||
|
||||
ViewsRegistry.registerViews([view1, view2, view3]);
|
||||
ViewsRegistry.registerViews([view1, view2, view3], container);
|
||||
assert.deepEqual(model.visibleViewDescriptors, [view1, view2, view3], 'model views should be OK');
|
||||
assert.deepEqual(seq.elements, [view1, view2, view3], 'sql views should be OK');
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpen
|
||||
export class TestQuickOpenService implements IQuickOpenService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private callback: (prefix: string) => void;
|
||||
private callback?: (prefix?: string) => void;
|
||||
|
||||
constructor(callback?: (prefix: string) => void) {
|
||||
constructor(callback?: (prefix?: string) => void) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export class TestQuickOpenService implements IQuickOpenService {
|
||||
close(): void {
|
||||
}
|
||||
|
||||
show(prefix?: string, options?: any): Thenable<void> {
|
||||
show(prefix?: string, options?: any): Promise<void> {
|
||||
if (this.callback) {
|
||||
this.callback(prefix);
|
||||
}
|
||||
@@ -37,11 +37,11 @@ export class TestQuickOpenService implements IQuickOpenService {
|
||||
}
|
||||
|
||||
get onShow(): Event<void> {
|
||||
return null;
|
||||
return null!;
|
||||
}
|
||||
|
||||
get onHide(): Event<void> {
|
||||
return null;
|
||||
return null!;
|
||||
}
|
||||
|
||||
public dispose() { }
|
||||
@@ -59,7 +59,7 @@ suite('QuickOpen', () => {
|
||||
'testhandler',
|
||||
',',
|
||||
'Handler',
|
||||
null
|
||||
null!
|
||||
);
|
||||
|
||||
registry.registerQuickOpenHandler(handler);
|
||||
@@ -71,7 +71,7 @@ suite('QuickOpen', () => {
|
||||
});
|
||||
|
||||
test('QuickOpen Action', () => {
|
||||
let defaultAction = new QuickOpenAction('id', 'label', void 0, new TestQuickOpenService((prefix: string) => assert(!prefix)));
|
||||
let defaultAction = new QuickOpenAction('id', 'label', (undefined)!, new TestQuickOpenService((prefix: string) => assert(!prefix)));
|
||||
let prefixAction = new QuickOpenAction('id', 'label', ',', new TestQuickOpenService((prefix: string) => assert(!!prefix)));
|
||||
|
||||
defaultAction.run();
|
||||
|
||||
@@ -13,7 +13,7 @@ suite('Viewlets', () => {
|
||||
class TestViewlet extends Viewlet {
|
||||
|
||||
constructor() {
|
||||
super('id', null, null, null, null, null);
|
||||
super('id', null!, null!, null!, null!, null!);
|
||||
}
|
||||
|
||||
public layout(dimension: any): void {
|
||||
|
||||
@@ -20,7 +20,7 @@ suite('DataUriEditorInput', () => {
|
||||
|
||||
test('simple', () => {
|
||||
const resource = URI.parse('data:image/png;label:SomeLabel;description:SomeDescription;size:1024;base64,77+9UE5');
|
||||
const input: DataUriEditorInput = instantiationService.createInstance(DataUriEditorInput, void 0, void 0, resource);
|
||||
const input: DataUriEditorInput = instantiationService.createInstance(DataUriEditorInput, undefined, undefined, resource);
|
||||
|
||||
assert.equal(input.getName(), 'SomeLabel');
|
||||
assert.equal(input.getDescription(), 'SomeDescription');
|
||||
|
||||
@@ -32,7 +32,7 @@ class FileEditorInput extends EditorInput {
|
||||
return this.resource;
|
||||
}
|
||||
|
||||
resolve(): Thenable<IEditorModel> {
|
||||
resolve(): Promise<IEditorModel> {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,19 +37,19 @@ suite('Workbench editor model', () => {
|
||||
|
||||
test('TextDiffEditorModel', () => {
|
||||
const dispose = accessor.textModelResolverService.registerTextModelContentProvider('test', {
|
||||
provideTextContent: function (resource: URI): Thenable<ITextModel> {
|
||||
provideTextContent: function (resource: URI): Promise<ITextModel> {
|
||||
if (resource.scheme === 'test') {
|
||||
let modelContent = 'Hello Test';
|
||||
let languageSelection = accessor.modeService.create('json');
|
||||
return Promise.resolve(accessor.modelService.createModel(modelContent, languageSelection, resource));
|
||||
}
|
||||
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
let input = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.from({ scheme: 'test', authority: null, path: 'thePath' }));
|
||||
let otherInput = instantiationService.createInstance(ResourceEditorInput, 'name2', 'description', URI.from({ scheme: 'test', authority: null, path: 'thePath' }));
|
||||
let input = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.from({ scheme: 'test', authority: null!, path: 'thePath' }));
|
||||
let otherInput = instantiationService.createInstance(ResourceEditorInput, 'name2', 'description', URI.from({ scheme: 'test', authority: null!, path: 'thePath' }));
|
||||
let diffInput = new DiffEditorInput('name', 'description', input, otherInput);
|
||||
|
||||
return diffInput.resolve().then((model: any) => {
|
||||
|
||||
@@ -29,7 +29,7 @@ function inst(): IInstantiationService {
|
||||
inst.stub(ITelemetryService, NullTelemetryService);
|
||||
|
||||
const config = new TestConfigurationService();
|
||||
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
|
||||
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right', focusRecentEditorAfterClose: true } });
|
||||
inst.stub(IConfigurationService, config);
|
||||
|
||||
return inst;
|
||||
@@ -77,7 +77,7 @@ class TestEditorInput extends EditorInput {
|
||||
super();
|
||||
}
|
||||
getTypeId() { return 'testEditorInputForGroups'; }
|
||||
resolve(): Thenable<IEditorModel> { return Promise.resolve(null); }
|
||||
resolve(): Promise<IEditorModel> { return Promise.resolve(null!); }
|
||||
|
||||
matches(other: TestEditorInput): boolean {
|
||||
return other && this.id === other.id && other instanceof TestEditorInput;
|
||||
@@ -97,7 +97,7 @@ class NonSerializableTestEditorInput extends EditorInput {
|
||||
super();
|
||||
}
|
||||
getTypeId() { return 'testEditorInputForGroups-nonSerializable'; }
|
||||
resolve(): Thenable<IEditorModel> { return Promise.resolve(null); }
|
||||
resolve(): Promise<IEditorModel> { return Promise.resolve(null!); }
|
||||
|
||||
matches(other: NonSerializableTestEditorInput): boolean {
|
||||
return other && this.id === other.id && other instanceof NonSerializableTestEditorInput;
|
||||
@@ -110,7 +110,7 @@ class TestFileEditorInput extends EditorInput implements IFileEditorInput {
|
||||
super();
|
||||
}
|
||||
getTypeId() { return 'testFileEditorInputForGroups'; }
|
||||
resolve(): Thenable<IEditorModel> { return Promise.resolve(null); }
|
||||
resolve(): Promise<IEditorModel> { return Promise.resolve(null!); }
|
||||
|
||||
matches(other: TestFileEditorInput): boolean {
|
||||
return other && this.id === other.id && other instanceof TestFileEditorInput;
|
||||
@@ -120,7 +120,7 @@ class TestFileEditorInput extends EditorInput implements IFileEditorInput {
|
||||
}
|
||||
|
||||
getEncoding(): string {
|
||||
return null;
|
||||
return null!;
|
||||
}
|
||||
|
||||
setPreferredEncoding(encoding: string) {
|
||||
@@ -262,7 +262,7 @@ suite('Workbench editor groups', () => {
|
||||
assert.equal(index, 0);
|
||||
assert.equal(group.count, 0);
|
||||
assert.equal(group.getEditors(true).length, 0);
|
||||
assert.equal(group.activeEditor, void 0);
|
||||
assert.equal(group.activeEditor, undefined);
|
||||
assert.equal(events.closed[0].editor, input1);
|
||||
assert.equal(events.closed[0].index, 0);
|
||||
assert.equal(events.closed[0].replaced, false);
|
||||
@@ -285,7 +285,7 @@ suite('Workbench editor groups', () => {
|
||||
group.closeEditor(input2);
|
||||
assert.equal(group.count, 0);
|
||||
assert.equal(group.getEditors(true).length, 0);
|
||||
assert.equal(group.activeEditor, void 0);
|
||||
assert.equal(group.activeEditor, undefined);
|
||||
assert.equal(events.closed[1].editor, input2);
|
||||
assert.equal(events.closed[1].index, 0);
|
||||
assert.equal(events.closed[1].replaced, false);
|
||||
@@ -294,7 +294,7 @@ suite('Workbench editor groups', () => {
|
||||
assert.ok(typeof index !== 'number');
|
||||
assert.equal(group.count, 0);
|
||||
assert.equal(group.getEditors(true).length, 0);
|
||||
assert.equal(group.activeEditor, void 0);
|
||||
assert.equal(group.activeEditor, undefined);
|
||||
assert.equal(events.closed[1].editor, input2);
|
||||
|
||||
// Nonactive && Pinned => gets active because its first editor
|
||||
@@ -315,7 +315,7 @@ suite('Workbench editor groups', () => {
|
||||
group.closeEditor(input3);
|
||||
assert.equal(group.count, 0);
|
||||
assert.equal(group.getEditors(true).length, 0);
|
||||
assert.equal(group.activeEditor, void 0);
|
||||
assert.equal(group.activeEditor, undefined);
|
||||
assert.equal(events.closed[2].editor, input3);
|
||||
|
||||
assert.equal(events.opened[2], input3);
|
||||
@@ -324,7 +324,7 @@ suite('Workbench editor groups', () => {
|
||||
group.closeEditor(input3);
|
||||
assert.equal(group.count, 0);
|
||||
assert.equal(group.getEditors(true).length, 0);
|
||||
assert.equal(group.activeEditor, void 0);
|
||||
assert.equal(group.activeEditor, undefined);
|
||||
assert.equal(events.closed[2].editor, input3);
|
||||
|
||||
// Nonactive && Preview => gets active because its first editor
|
||||
@@ -345,7 +345,7 @@ suite('Workbench editor groups', () => {
|
||||
group.closeEditor(input4);
|
||||
assert.equal(group.count, 0);
|
||||
assert.equal(group.getEditors(true).length, 0);
|
||||
assert.equal(group.activeEditor, void 0);
|
||||
assert.equal(group.activeEditor, undefined);
|
||||
assert.equal(events.closed[3].editor, input4);
|
||||
});
|
||||
|
||||
@@ -420,7 +420,7 @@ suite('Workbench editor groups', () => {
|
||||
inst.stub(IConfigurationService, config);
|
||||
config.setUserConfiguration('workbench', { editor: { openPositioning: 'left' } });
|
||||
|
||||
const group: EditorGroup = inst.createInstance(EditorGroup, void 0);
|
||||
const group: EditorGroup = inst.createInstance(EditorGroup, undefined);
|
||||
|
||||
const events = groupListener(group);
|
||||
|
||||
@@ -645,6 +645,64 @@ suite('Workbench editor groups', () => {
|
||||
assert.equal(group.count, 0);
|
||||
});
|
||||
|
||||
test('Multiple Editors - closing picks next to the right', function () {
|
||||
let inst = new TestInstantiationService();
|
||||
inst.stub(IStorageService, new TestStorageService());
|
||||
inst.stub(ILifecycleService, new TestLifecycleService());
|
||||
inst.stub(IWorkspaceContextService, new TestContextService());
|
||||
inst.stub(ITelemetryService, NullTelemetryService);
|
||||
|
||||
const config = new TestConfigurationService();
|
||||
config.setUserConfiguration('workbench', { editor: { focusRecentEditorAfterClose: false } });
|
||||
inst.stub(IConfigurationService, config);
|
||||
|
||||
const group = inst.createInstance(EditorGroup);
|
||||
const events = groupListener(group);
|
||||
|
||||
const input1 = input();
|
||||
const input2 = input();
|
||||
const input3 = input();
|
||||
const input4 = input();
|
||||
const input5 = input();
|
||||
|
||||
group.openEditor(input1, { pinned: true, active: true });
|
||||
group.openEditor(input2, { pinned: true, active: true });
|
||||
group.openEditor(input3, { pinned: true, active: true });
|
||||
group.openEditor(input4, { pinned: true, active: true });
|
||||
group.openEditor(input5, { pinned: true, active: true });
|
||||
|
||||
assert.equal(group.activeEditor, input5);
|
||||
assert.equal(group.getEditors(true)[0], input5);
|
||||
assert.equal(group.count, 5);
|
||||
|
||||
group.closeEditor(input5);
|
||||
assert.equal(group.activeEditor, input4);
|
||||
assert.equal(events.activated[5], input4);
|
||||
assert.equal(group.count, 4);
|
||||
|
||||
group.setActive(input1);
|
||||
group.closeEditor(input1);
|
||||
|
||||
assert.equal(group.activeEditor, input2);
|
||||
assert.equal(group.count, 3);
|
||||
|
||||
group.setActive(input3);
|
||||
group.closeEditor(input3);
|
||||
|
||||
assert.equal(group.activeEditor, input4);
|
||||
assert.equal(group.count, 2);
|
||||
|
||||
group.closeEditor(input4);
|
||||
|
||||
assert.equal(group.activeEditor, input2);
|
||||
assert.equal(group.count, 1);
|
||||
|
||||
group.closeEditor(input2);
|
||||
|
||||
assert.ok(!group.activeEditor);
|
||||
assert.equal(group.count, 0);
|
||||
});
|
||||
|
||||
test('Multiple Editors - move editor', function () {
|
||||
const group = createGroup();
|
||||
const events = groupListener(group);
|
||||
@@ -781,7 +839,7 @@ suite('Workbench editor groups', () => {
|
||||
group.openEditor(input5, { active: true, pinned: true });
|
||||
|
||||
// Close Others
|
||||
group.closeEditors(group.activeEditor);
|
||||
group.closeEditors(group.activeEditor!);
|
||||
assert.equal(group.activeEditor, input5);
|
||||
assert.equal(group.count, 1);
|
||||
|
||||
@@ -795,7 +853,7 @@ suite('Workbench editor groups', () => {
|
||||
|
||||
// Close Left
|
||||
assert.equal(group.activeEditor, input3);
|
||||
group.closeEditors(group.activeEditor, CloseDirection.LEFT);
|
||||
group.closeEditors(group.activeEditor!, CloseDirection.LEFT);
|
||||
assert.equal(group.activeEditor, input3);
|
||||
assert.equal(group.count, 3);
|
||||
assert.equal(group.getEditors()[0], input3);
|
||||
@@ -812,7 +870,7 @@ suite('Workbench editor groups', () => {
|
||||
|
||||
// Close Right
|
||||
assert.equal(group.activeEditor, input3);
|
||||
group.closeEditors(group.activeEditor, CloseDirection.RIGHT);
|
||||
group.closeEditors(group.activeEditor!, CloseDirection.RIGHT);
|
||||
assert.equal(group.activeEditor, input3);
|
||||
assert.equal(group.count, 3);
|
||||
assert.equal(group.getEditors()[0], input1);
|
||||
@@ -953,16 +1011,16 @@ suite('Workbench editor groups', () => {
|
||||
group.openEditor(input1);
|
||||
|
||||
assert.equal(group.count, 1);
|
||||
assert.equal(group.activeEditor.matches(input1), true);
|
||||
assert.equal(group.previewEditor.matches(input1), true);
|
||||
assert.equal(group.activeEditor!.matches(input1), true);
|
||||
assert.equal(group.previewEditor!.matches(input1), true);
|
||||
assert.equal(group.isActive(input1), true);
|
||||
|
||||
// Create model again - should load from storage
|
||||
group = inst.createInstance(EditorGroup, group.serialize());
|
||||
|
||||
assert.equal(group.count, 1);
|
||||
assert.equal(group.activeEditor.matches(input1), true);
|
||||
assert.equal(group.previewEditor.matches(input1), true);
|
||||
assert.equal(group.activeEditor!.matches(input1), true);
|
||||
assert.equal(group.previewEditor!.matches(input1), true);
|
||||
assert.equal(group.isActive(input1), true);
|
||||
});
|
||||
|
||||
@@ -1003,10 +1061,10 @@ suite('Workbench editor groups', () => {
|
||||
|
||||
assert.equal(group1.count, 3);
|
||||
assert.equal(group2.count, 3);
|
||||
assert.equal(group1.activeEditor.matches(g1_input2), true);
|
||||
assert.equal(group2.activeEditor.matches(g2_input1), true);
|
||||
assert.equal(group1.previewEditor.matches(g1_input2), true);
|
||||
assert.equal(group2.previewEditor.matches(g2_input2), true);
|
||||
assert.equal(group1.activeEditor!.matches(g1_input2), true);
|
||||
assert.equal(group2.activeEditor!.matches(g2_input1), true);
|
||||
assert.equal(group1.previewEditor!.matches(g1_input2), true);
|
||||
assert.equal(group2.previewEditor!.matches(g2_input2), true);
|
||||
|
||||
assert.equal(group1.getEditors(true)[0].matches(g1_input2), true);
|
||||
assert.equal(group1.getEditors(true)[1].matches(g1_input1), true);
|
||||
@@ -1022,10 +1080,10 @@ suite('Workbench editor groups', () => {
|
||||
|
||||
assert.equal(group1.count, 3);
|
||||
assert.equal(group2.count, 3);
|
||||
assert.equal(group1.activeEditor.matches(g1_input2), true);
|
||||
assert.equal(group2.activeEditor.matches(g2_input1), true);
|
||||
assert.equal(group1.previewEditor.matches(g1_input2), true);
|
||||
assert.equal(group2.previewEditor.matches(g2_input2), true);
|
||||
assert.equal(group1.activeEditor!.matches(g1_input2), true);
|
||||
assert.equal(group2.activeEditor!.matches(g2_input1), true);
|
||||
assert.equal(group1.previewEditor!.matches(g1_input2), true);
|
||||
assert.equal(group2.previewEditor!.matches(g2_input2), true);
|
||||
|
||||
assert.equal(group1.getEditors(true)[0].matches(g1_input2), true);
|
||||
assert.equal(group1.getEditors(true)[1].matches(g1_input1), true);
|
||||
@@ -1062,8 +1120,8 @@ suite('Workbench editor groups', () => {
|
||||
group.openEditor(serializableInput2, { active: false, pinned: true });
|
||||
|
||||
assert.equal(group.count, 3);
|
||||
assert.equal(group.activeEditor.matches(nonSerializableInput2), true);
|
||||
assert.equal(group.previewEditor.matches(nonSerializableInput2), true);
|
||||
assert.equal(group.activeEditor!.matches(nonSerializableInput2), true);
|
||||
assert.equal(group.previewEditor!.matches(nonSerializableInput2), true);
|
||||
|
||||
assert.equal(group.getEditors(true)[0].matches(nonSerializableInput2), true);
|
||||
assert.equal(group.getEditors(true)[1].matches(serializableInput1), true);
|
||||
@@ -1073,7 +1131,7 @@ suite('Workbench editor groups', () => {
|
||||
group = inst.createInstance(EditorGroup, group.serialize());
|
||||
|
||||
assert.equal(group.count, 2);
|
||||
assert.equal(group.activeEditor.matches(serializableInput1), true);
|
||||
assert.equal(group.activeEditor!.matches(serializableInput1), true);
|
||||
assert.equal(group.previewEditor, null);
|
||||
|
||||
assert.equal(group.getEditors(true)[0].matches(serializableInput1), true);
|
||||
@@ -1122,7 +1180,7 @@ suite('Workbench editor groups', () => {
|
||||
|
||||
const input1Resource = URI.file('/hello/world.txt');
|
||||
const input1ResourceUpper = URI.file('/hello/WORLD.txt');
|
||||
const input1 = input(void 0, false, input1Resource);
|
||||
const input1 = input(undefined, false, input1Resource);
|
||||
group1.openEditor(input1);
|
||||
|
||||
assert.ok(group1.contains(input1Resource));
|
||||
@@ -1141,7 +1199,7 @@ suite('Workbench editor groups', () => {
|
||||
assert.equal(group2.getEditor(input1Resource), input1);
|
||||
|
||||
const input1ResourceClone = URI.file('/hello/world.txt');
|
||||
const input1Clone = input(void 0, false, input1ResourceClone);
|
||||
const input1Clone = input(undefined, false, input1ResourceClone);
|
||||
group1.openEditor(input1Clone);
|
||||
|
||||
assert.ok(group1.contains(input1Resource));
|
||||
|
||||
@@ -64,9 +64,8 @@ suite('Workbench editor model', () => {
|
||||
let m = new MyTextEditorModel(modelService, modeService);
|
||||
return m.load().then((model: MyTextEditorModel) => {
|
||||
assert(model === m);
|
||||
return model.createTextEditorModel(createTextBufferFactory('foo'), null, 'text/plain').then(() => {
|
||||
assert.strictEqual(m.isResolved(), true);
|
||||
});
|
||||
model.createTextEditorModel(createTextBufferFactory('foo'), null!, 'text/plain');
|
||||
assert.strictEqual(m.isResolved(), true);
|
||||
}).then(() => {
|
||||
m.dispose();
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ suite('Workbench resource editor input', () => {
|
||||
});
|
||||
|
||||
test('simple', () => {
|
||||
let resource = URI.from({ scheme: 'inmemory', authority: null, path: 'thePath' });
|
||||
let resource = URI.from({ scheme: 'inmemory', authority: null!, path: 'thePath' });
|
||||
accessor.modelService.createModel('function test() {}', accessor.modeService.create('text'), resource);
|
||||
let input: ResourceEditorInput = instantiationService.createInstance(ResourceEditorInput, 'The Name', 'The Description', resource);
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ suite('Workbench untitled editors', () => {
|
||||
config.setUserConfiguration('files', { 'defaultLanguage': defaultLanguage });
|
||||
|
||||
const service = accessor.untitledEditorService;
|
||||
const input = service.createOrGet(null, modeId);
|
||||
const input = service.createOrGet(null!, modeId);
|
||||
|
||||
assert.equal(input.getModeId(), modeId);
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ suite('Memento', () => {
|
||||
assert.deepEqual(memento, { foo: 'Hello World' });
|
||||
|
||||
// Assert the Mementos are stored properly in storage
|
||||
assert.deepEqual(JSON.parse(storage.get('memento/memento.test', StorageScope.GLOBAL)), { foo: [1, 2, 3] });
|
||||
assert.deepEqual(JSON.parse(storage.get('memento/memento.test', StorageScope.GLOBAL)!), { foo: [1, 2, 3] });
|
||||
|
||||
assert.deepEqual(JSON.parse(storage.get('memento/memento.test', StorageScope.WORKSPACE)), { foo: 'Hello World' });
|
||||
assert.deepEqual(JSON.parse(storage.get('memento/memento.test', StorageScope.WORKSPACE)!), { foo: 'Hello World' });
|
||||
|
||||
// Delete Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
delete memento.foo;
|
||||
|
||||
// Delete Workspace
|
||||
@@ -59,7 +59,7 @@ suite('Memento', () => {
|
||||
myMemento.saveMemento();
|
||||
|
||||
// Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
assert.deepEqual(memento, {});
|
||||
|
||||
// Workspace
|
||||
@@ -67,16 +67,16 @@ suite('Memento', () => {
|
||||
assert.deepEqual(memento, {});
|
||||
|
||||
// Assert the Mementos are also removed from storage
|
||||
assert.strictEqual(storage.get('memento/memento.test', StorageScope.GLOBAL, null), null);
|
||||
assert.strictEqual(storage.get('memento/memento.test', StorageScope.GLOBAL, null!), null);
|
||||
|
||||
assert.strictEqual(storage.get('memento/memento.test', StorageScope.WORKSPACE, null), null);
|
||||
assert.strictEqual(storage.get('memento/memento.test', StorageScope.WORKSPACE, null!), null);
|
||||
});
|
||||
|
||||
test('Save and Load', () => {
|
||||
let myMemento = new Memento('memento.test', storage);
|
||||
|
||||
// Global
|
||||
let memento: any = myMemento.getMemento(context);
|
||||
let memento: any = myMemento.getMemento(context!);
|
||||
memento.foo = [1, 2, 3];
|
||||
|
||||
// Workspace
|
||||
@@ -87,7 +87,7 @@ suite('Memento', () => {
|
||||
myMemento.saveMemento();
|
||||
|
||||
// Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
assert.deepEqual(memento, { foo: [1, 2, 3] });
|
||||
let globalMemento = myMemento.getMemento(StorageScope.GLOBAL);
|
||||
assert.deepEqual(globalMemento, memento);
|
||||
@@ -97,7 +97,7 @@ suite('Memento', () => {
|
||||
assert.deepEqual(memento, { foo: 'Hello World' });
|
||||
|
||||
// Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
memento.foo = [4, 5, 6];
|
||||
|
||||
// Workspace
|
||||
@@ -108,7 +108,7 @@ suite('Memento', () => {
|
||||
myMemento.saveMemento();
|
||||
|
||||
// Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
assert.deepEqual(memento, { foo: [4, 5, 6] });
|
||||
globalMemento = myMemento.getMemento(StorageScope.GLOBAL);
|
||||
assert.deepEqual(globalMemento, memento);
|
||||
@@ -118,7 +118,7 @@ suite('Memento', () => {
|
||||
assert.deepEqual(memento, { foo: 'World Hello' });
|
||||
|
||||
// Delete Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
delete memento.foo;
|
||||
|
||||
// Delete Workspace
|
||||
@@ -128,7 +128,7 @@ suite('Memento', () => {
|
||||
myMemento.saveMemento();
|
||||
|
||||
// Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
assert.deepEqual(memento, {});
|
||||
|
||||
// Workspace
|
||||
@@ -141,10 +141,10 @@ suite('Memento', () => {
|
||||
let myMemento2 = new Memento('memento.test', storage);
|
||||
|
||||
// Global
|
||||
let memento: any = myMemento.getMemento(context);
|
||||
let memento: any = myMemento.getMemento(context!);
|
||||
memento.foo = [1, 2, 3];
|
||||
|
||||
memento = myMemento2.getMemento(context);
|
||||
memento = myMemento2.getMemento(context!);
|
||||
memento.bar = [1, 2, 3];
|
||||
|
||||
// Workspace
|
||||
@@ -160,12 +160,12 @@ suite('Memento', () => {
|
||||
myMemento2.saveMemento();
|
||||
|
||||
// Global
|
||||
memento = myMemento.getMemento(context);
|
||||
memento = myMemento.getMemento(context!);
|
||||
assert.deepEqual(memento, { foo: [1, 2, 3], bar: [1, 2, 3] });
|
||||
let globalMemento = myMemento.getMemento(StorageScope.GLOBAL);
|
||||
assert.deepEqual(globalMemento, memento);
|
||||
|
||||
memento = myMemento2.getMemento(context);
|
||||
memento = myMemento2.getMemento(context!);
|
||||
assert.deepEqual(memento, { foo: [1, 2, 3], bar: [1, 2, 3] });
|
||||
globalMemento = myMemento2.getMemento(StorageScope.GLOBAL);
|
||||
assert.deepEqual(globalMemento, memento);
|
||||
|
||||
@@ -15,14 +15,14 @@ suite('Notifications', () => {
|
||||
|
||||
// Invalid
|
||||
assert.ok(!NotificationViewItem.create({ severity: Severity.Error, message: '' }));
|
||||
assert.ok(!NotificationViewItem.create({ severity: Severity.Error, message: null }));
|
||||
assert.ok(!NotificationViewItem.create({ severity: Severity.Error, message: null! }));
|
||||
|
||||
// Duplicates
|
||||
let item1 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' });
|
||||
let item2 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' });
|
||||
let item3 = NotificationViewItem.create({ severity: Severity.Info, message: 'Info Message' });
|
||||
let item4 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message', source: 'Source' });
|
||||
let item5 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message', actions: { primary: [new Action('id', 'label')] } });
|
||||
let item1 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' })!;
|
||||
let item2 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message' })!;
|
||||
let item3 = NotificationViewItem.create({ severity: Severity.Info, message: 'Info Message' })!;
|
||||
let item4 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message', source: 'Source' })!;
|
||||
let item5 = NotificationViewItem.create({ severity: Severity.Error, message: 'Error Message', actions: { primary: [new Action('id', 'label')] } })!;
|
||||
|
||||
assert.equal(item1.equals(item1), true);
|
||||
assert.equal(item2.equals(item2), true);
|
||||
@@ -102,11 +102,11 @@ suite('Notifications', () => {
|
||||
assert.equal(called, 1);
|
||||
|
||||
// Error with Action
|
||||
let item6 = NotificationViewItem.create({ severity: Severity.Error, message: createErrorWithActions('Hello Error', { actions: [new Action('id', 'label')] }) });
|
||||
assert.equal(item6.actions.primary.length, 1);
|
||||
let item6 = NotificationViewItem.create({ severity: Severity.Error, message: createErrorWithActions('Hello Error', { actions: [new Action('id', 'label')] }) })!;
|
||||
assert.equal(item6.actions.primary!.length, 1);
|
||||
|
||||
// Links
|
||||
let item7 = NotificationViewItem.create({ severity: Severity.Info, message: 'Unable to [Link 1](http://link1.com) open [Link 2](https://link2.com) and [Invalid Link3](ftp://link3.com)' });
|
||||
let item7 = NotificationViewItem.create({ severity: Severity.Info, message: 'Unable to [Link 1](http://link1.com) open [Link 2](https://link2.com) and [Invalid Link3](ftp://link3.com)' })!;
|
||||
|
||||
const links = item7.message.links;
|
||||
assert.equal(links.length, 2);
|
||||
@@ -124,7 +124,7 @@ suite('Notifications', () => {
|
||||
test('Model', () => {
|
||||
const model = new NotificationsModel();
|
||||
|
||||
let lastEvent: INotificationChangeEvent;
|
||||
let lastEvent!: INotificationChangeEvent;
|
||||
model.onDidNotificationChange(e => {
|
||||
lastEvent = e;
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ let commands: ExtHostCommands;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let originalErrorHandler: (e: any) => any;
|
||||
|
||||
function assertRejects(fn: () => Thenable<any>, message: string = 'Expected rejection') {
|
||||
function assertRejects(fn: () => Promise<any>, message: string = 'Expected rejection') {
|
||||
return fn().then(() => assert.ok(false, message), _err => assert.ok(true));
|
||||
}
|
||||
|
||||
@@ -564,6 +564,35 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
assert.equal(b.commitCharacters, undefined);
|
||||
});
|
||||
|
||||
// --- signatureHelp
|
||||
|
||||
test('Parameter Hints, back and forth', async () => {
|
||||
disposables.push(extHost.registerSignatureHelpProvider(nullExtensionDescription, defaultSelector, new class implements vscode.SignatureHelpProvider {
|
||||
provideSignatureHelp(_document, _position, _token, context: vscode.SignatureHelpContext): vscode.SignatureHelp {
|
||||
return {
|
||||
activeSignature: 0,
|
||||
activeParameter: 1,
|
||||
signatures: [
|
||||
{
|
||||
label: 'abc',
|
||||
documentation: `${context.triggerKind === 1 /* vscode.SignatureHelpTriggerKind.Invoke */ ? 'invoked' : 'unknown'} ${context.triggerCharacter}`,
|
||||
parameters: []
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}, []));
|
||||
|
||||
await rpcProtocol.sync();
|
||||
|
||||
const firstValue = await commands.executeCommand<vscode.SignatureHelp>('vscode.executeSignatureHelpProvider', model.uri, new types.Position(0, 1), ',');
|
||||
assert.strictEqual(firstValue.activeSignature, 0);
|
||||
assert.strictEqual(firstValue.activeParameter, 1);
|
||||
assert.strictEqual(firstValue.signatures.length, 1);
|
||||
assert.strictEqual(firstValue.signatures[0].label, 'abc');
|
||||
assert.strictEqual(firstValue.signatures[0].documentation, 'invoked ,');
|
||||
});
|
||||
|
||||
// --- quickfix
|
||||
|
||||
test('QuickFix, back and forth', function () {
|
||||
@@ -772,7 +801,10 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||
|
||||
disposables.push(extHost.registerSelectionRangeProvider(nullExtensionDescription, defaultSelector, <vscode.SelectionRangeProvider>{
|
||||
provideSelectionRanges() {
|
||||
return [new types.Range(0, 10, 0, 18), new types.Range(0, 2, 0, 20)];
|
||||
return [
|
||||
new types.SelectionRange(new types.Range(0, 10, 0, 18), types.SelectionRangeKind.Empty),
|
||||
new types.SelectionRange(new types.Range(0, 2, 0, 20), types.SelectionRangeKind.Empty)
|
||||
];
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ suite('ExtHostCommands', function () {
|
||||
}
|
||||
};
|
||||
|
||||
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), undefined, new NullLogService());
|
||||
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), undefined!, new NullLogService());
|
||||
commands.registerCommand(true, 'foo', (): any => { }).dispose();
|
||||
assert.equal(lastUnregister, 'foo');
|
||||
assert.equal(lastUnregister!, 'foo');
|
||||
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
|
||||
|
||||
});
|
||||
@@ -46,7 +46,7 @@ suite('ExtHostCommands', function () {
|
||||
}
|
||||
};
|
||||
|
||||
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), undefined, new NullLogService());
|
||||
const commands = new ExtHostCommands(SingleProxyRPCProtocol(shape), undefined!, new NullLogService());
|
||||
const reg = commands.registerCommand(true, 'foo', (): any => { });
|
||||
reg.dispose();
|
||||
reg.dispose();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as assert from 'assert';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
|
||||
import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration';
|
||||
import { ExtHostConfigProvider } from 'vs/workbench/api/node/extHostConfiguration';
|
||||
import { MainThreadConfigurationShape, IConfigurationInitData } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { ConfigurationModel } from 'vs/platform/configuration/common/configurationModels';
|
||||
import { TestRPCProtocol } from './testRPCProtocol';
|
||||
@@ -23,7 +23,7 @@ suite('ExtHostConfiguration', function () {
|
||||
lastArgs: [ConfigurationTarget, string, any];
|
||||
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): Promise<void> {
|
||||
this.lastArgs = [target, key, value];
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ suite('ExtHostConfiguration', function () {
|
||||
if (!shape) {
|
||||
shape = new class extends mock<MainThreadConfigurationShape>() { };
|
||||
}
|
||||
return new ExtHostConfiguration(shape, new ExtHostWorkspace(new TestRPCProtocol(), null, new NullLogService(), new Counter()), createConfigurationData(contents));
|
||||
return new ExtHostConfigProvider(shape, new ExtHostWorkspace(new TestRPCProtocol(), null, new NullLogService(), new Counter()), createConfigurationData(contents));
|
||||
}
|
||||
|
||||
function createConfigurationData(contents: any): IConfigurationInitData {
|
||||
@@ -263,7 +263,7 @@ suite('ExtHostConfiguration', function () {
|
||||
});
|
||||
|
||||
test('inspect in no workspace context', function () {
|
||||
const testObject = new ExtHostConfiguration(
|
||||
const testObject = new ExtHostConfigProvider(
|
||||
new class extends mock<MainThreadConfigurationShape>() { },
|
||||
new ExtHostWorkspace(new TestRPCProtocol(), null, new NullLogService(), new Counter()),
|
||||
{
|
||||
@@ -306,7 +306,7 @@ suite('ExtHostConfiguration', function () {
|
||||
}
|
||||
}, ['editor.wordWrap']);
|
||||
folders[workspaceUri.toString()] = workspace;
|
||||
const testObject = new ExtHostConfiguration(
|
||||
const testObject = new ExtHostConfigProvider(
|
||||
new class extends mock<MainThreadConfigurationShape>() { },
|
||||
new ExtHostWorkspace(new TestRPCProtocol(), {
|
||||
'id': 'foo',
|
||||
@@ -380,7 +380,7 @@ suite('ExtHostConfiguration', function () {
|
||||
}, ['editor.wordWrap']);
|
||||
folders[thirdRoot.toString()] = new ConfigurationModel({}, []);
|
||||
|
||||
const testObject = new ExtHostConfiguration(
|
||||
const testObject = new ExtHostConfigProvider(
|
||||
new class extends mock<MainThreadConfigurationShape>() { },
|
||||
new ExtHostWorkspace(new TestRPCProtocol(), {
|
||||
'id': 'foo',
|
||||
@@ -589,7 +589,7 @@ suite('ExtHostConfiguration', function () {
|
||||
test('configuration change event', (done) => {
|
||||
|
||||
const workspaceFolder = aWorkspaceFolder(URI.file('folder1'), 0);
|
||||
const testObject = new ExtHostConfiguration(
|
||||
const testObject = new ExtHostConfigProvider(
|
||||
new class extends mock<MainThreadConfigurationShape>() { },
|
||||
new ExtHostWorkspace(new TestRPCProtocol(), {
|
||||
'id': 'foo',
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Diagnostic, DiagnosticSeverity, Range, DiagnosticRelatedInformation, Lo
|
||||
import { MainThreadDiagnosticsShape, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
import { Emitter, toPromise } from 'vs/base/common/event';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
|
||||
suite('ExtHostDiagnostics', () => {
|
||||
|
||||
@@ -37,7 +37,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
assert.throws(() => collection.get(URI.parse('aa:bb')));
|
||||
assert.throws(() => collection.has(URI.parse('aa:bb')));
|
||||
assert.throws(() => collection.set(URI.parse('aa:bb'), []));
|
||||
assert.throws(() => collection.set(URI.parse('aa:bb'), undefined));
|
||||
assert.throws(() => collection.set(URI.parse('aa:bb'), undefined!));
|
||||
});
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
collection.set([
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-1')]],
|
||||
[URI.parse('some:thing'), [new Diagnostic(new Range(0, 0, 1, 1), 'something')]],
|
||||
[uri, undefined]
|
||||
[uri, undefined!]
|
||||
]);
|
||||
assert.ok(!collection.has(uri));
|
||||
|
||||
@@ -144,7 +144,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
collection.set([
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-1')]],
|
||||
[URI.parse('some:thing'), [new Diagnostic(new Range(0, 0, 1, 1), 'something')]],
|
||||
[uri, undefined],
|
||||
[uri, undefined!],
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-2')]],
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-3')]],
|
||||
]);
|
||||
@@ -160,7 +160,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
test('diagnostics collection, set tuple overrides, #11547', function () {
|
||||
|
||||
let lastEntries: [UriComponents, IMarkerData[]][];
|
||||
let lastEntries!: [UriComponents, IMarkerData[]][];
|
||||
let collection = new DiagnosticCollection('test', 'test', 100, new class extends DiagnosticsShape {
|
||||
$changeMany(owner: string, entries: [UriComponents, IMarkerData[]][]): void {
|
||||
lastEntries = entries;
|
||||
@@ -176,7 +176,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
let [[, data1]] = lastEntries;
|
||||
assert.equal(data1.length, 1);
|
||||
assert.equal(data1[0].message, 'error');
|
||||
lastEntries = undefined;
|
||||
lastEntries = undefined!;
|
||||
|
||||
collection.set([[uri, [new Diagnostic(new Range(0, 0, 1, 1), 'warning')]]]);
|
||||
assert.equal(collection.get(uri).length, 1);
|
||||
@@ -185,7 +185,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
let [[, data2]] = lastEntries;
|
||||
assert.equal(data2.length, 1);
|
||||
assert.equal(data2[0].message, 'warning');
|
||||
lastEntries = undefined;
|
||||
lastEntries = undefined!;
|
||||
});
|
||||
|
||||
test('don\'t send message when not making a change', function () {
|
||||
@@ -222,11 +222,11 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
collection.set([
|
||||
[uri, [diag, diag, diag]],
|
||||
[uri, undefined],
|
||||
[uri, undefined!],
|
||||
[uri, [diag]],
|
||||
|
||||
[uri2, [diag, diag]],
|
||||
[uri2, undefined],
|
||||
[uri2, undefined!],
|
||||
[uri2, [diag]],
|
||||
]);
|
||||
|
||||
@@ -244,7 +244,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
let diag = new Diagnostic(new Range(0, 0, 0, 1), i.toString());
|
||||
|
||||
tuples.push([uri, [diag, diag, diag]]);
|
||||
tuples.push([uri, undefined]);
|
||||
tuples.push([uri, undefined!]);
|
||||
tuples.push([uri, [diag]]);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
test('diagnostic capping', function () {
|
||||
|
||||
let lastEntries: [UriComponents, IMarkerData[]][];
|
||||
let lastEntries!: [UriComponents, IMarkerData[]][];
|
||||
let collection = new DiagnosticCollection('test', 'test', 250, new class extends DiagnosticsShape {
|
||||
$changeMany(owner: string, entries: [UriComponents, IMarkerData[]][]): void {
|
||||
lastEntries = entries;
|
||||
@@ -285,14 +285,14 @@ suite('ExtHostDiagnostics', () => {
|
||||
});
|
||||
|
||||
test('diagnostic eventing', async function () {
|
||||
let emitter = new Emitter<(string | URI)[]>();
|
||||
let emitter = new Emitter<Array<string | URI>>();
|
||||
let collection = new DiagnosticCollection('ddd', 'test', 100, new DiagnosticsShape(), emitter);
|
||||
|
||||
let diag1 = new Diagnostic(new Range(1, 1, 2, 3), 'diag1');
|
||||
let diag2 = new Diagnostic(new Range(1, 1, 2, 3), 'diag2');
|
||||
let diag3 = new Diagnostic(new Range(1, 1, 2, 3), 'diag3');
|
||||
|
||||
let p = toPromise(emitter.event).then(a => {
|
||||
let p = Event.toPromise(emitter.event).then(a => {
|
||||
assert.equal(a.length, 1);
|
||||
assert.equal(a[0].toString(), 'aa:bb');
|
||||
assert.ok(URI.isUri(a[0]));
|
||||
@@ -300,7 +300,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
collection.set(URI.parse('aa:bb'), []);
|
||||
await p;
|
||||
|
||||
p = toPromise(emitter.event).then(e => {
|
||||
p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e.length, 2);
|
||||
assert.ok(URI.isUri(e[0]));
|
||||
assert.ok(URI.isUri(e[1]));
|
||||
@@ -313,7 +313,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
]);
|
||||
await p;
|
||||
|
||||
p = toPromise(emitter.event).then(e => {
|
||||
p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e.length, 2);
|
||||
assert.ok(typeof e[0] === 'string');
|
||||
assert.ok(typeof e[1] === 'string');
|
||||
@@ -323,14 +323,14 @@ suite('ExtHostDiagnostics', () => {
|
||||
});
|
||||
|
||||
test('vscode.languages.onDidChangeDiagnostics Does Not Provide Document URI #49582', async function () {
|
||||
let emitter = new Emitter<(string | URI)[]>();
|
||||
let emitter = new Emitter<Array<string | URI>>();
|
||||
let collection = new DiagnosticCollection('ddd', 'test', 100, new DiagnosticsShape(), emitter);
|
||||
|
||||
let diag1 = new Diagnostic(new Range(1, 1, 2, 3), 'diag1');
|
||||
|
||||
// delete
|
||||
collection.set(URI.parse('aa:bb'), [diag1]);
|
||||
let p = toPromise(emitter.event).then(e => {
|
||||
let p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e[0].toString(), 'aa:bb');
|
||||
});
|
||||
collection.delete(URI.parse('aa:bb'));
|
||||
@@ -338,10 +338,10 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
// set->undefined (as delete)
|
||||
collection.set(URI.parse('aa:bb'), [diag1]);
|
||||
p = toPromise(emitter.event).then(e => {
|
||||
p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e[0].toString(), 'aa:bb');
|
||||
});
|
||||
collection.set(URI.parse('aa:bb'), undefined);
|
||||
collection.set(URI.parse('aa:bb'), undefined!);
|
||||
await p;
|
||||
});
|
||||
|
||||
@@ -355,9 +355,9 @@ suite('ExtHostDiagnostics', () => {
|
||||
assert.equal(data.length, 1);
|
||||
|
||||
let [diag] = data;
|
||||
assert.equal(diag.relatedInformation.length, 2);
|
||||
assert.equal(diag.relatedInformation[0].message, 'more1');
|
||||
assert.equal(diag.relatedInformation[1].message, 'more2');
|
||||
assert.equal(diag.relatedInformation!.length, 2);
|
||||
assert.equal(diag.relatedInformation![0].message, 'more1');
|
||||
assert.equal(diag.relatedInformation![1].message, 'more2');
|
||||
done();
|
||||
}
|
||||
}, new Emitter<any>());
|
||||
|
||||
@@ -30,7 +30,7 @@ suite('ExtHostDocumentData', () => {
|
||||
}
|
||||
|
||||
setup(function () {
|
||||
data = new ExtHostDocumentData(undefined, URI.file(''), [
|
||||
data = new ExtHostDocumentData(undefined!, URI.file(''), [
|
||||
'This is line one', //16
|
||||
'and this is line number two', //27
|
||||
'it is followed by #3', //20
|
||||
@@ -39,7 +39,7 @@ suite('ExtHostDocumentData', () => {
|
||||
});
|
||||
|
||||
test('readonly-ness', () => {
|
||||
assert.throws((): void => (data as any).document.uri = null);
|
||||
assert.throws(() => (data as any).document.uri = null);
|
||||
assert.throws(() => (data as any).document.fileName = 'foofile');
|
||||
assert.throws(() => (data as any).document.isDirty = false);
|
||||
assert.throws(() => (data as any).document.isUntitled = false);
|
||||
@@ -98,12 +98,12 @@ suite('ExtHostDocumentData', () => {
|
||||
data.onEvents({
|
||||
changes: [{
|
||||
range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 },
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: '\t '
|
||||
}],
|
||||
eol: undefined,
|
||||
versionId: undefined,
|
||||
eol: undefined!,
|
||||
versionId: undefined!,
|
||||
});
|
||||
|
||||
// line didn't change
|
||||
@@ -155,12 +155,12 @@ suite('ExtHostDocumentData', () => {
|
||||
data.onEvents({
|
||||
changes: [{
|
||||
range: { startLineNumber: 1, startColumn: 3, endLineNumber: 1, endColumn: 6 },
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: ''
|
||||
}],
|
||||
eol: undefined,
|
||||
versionId: undefined,
|
||||
eol: undefined!,
|
||||
versionId: undefined!,
|
||||
});
|
||||
|
||||
assertOffsetAt(0, 1, 1);
|
||||
@@ -173,12 +173,12 @@ suite('ExtHostDocumentData', () => {
|
||||
data.onEvents({
|
||||
changes: [{
|
||||
range: { startLineNumber: 1, startColumn: 3, endLineNumber: 1, endColumn: 6 },
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: 'is could be'
|
||||
}],
|
||||
eol: undefined,
|
||||
versionId: undefined,
|
||||
eol: undefined!,
|
||||
versionId: undefined!,
|
||||
});
|
||||
|
||||
assertOffsetAt(0, 1, 1);
|
||||
@@ -191,12 +191,12 @@ suite('ExtHostDocumentData', () => {
|
||||
data.onEvents({
|
||||
changes: [{
|
||||
range: { startLineNumber: 1, startColumn: 3, endLineNumber: 1, endColumn: 6 },
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: 'is could be\na line with number'
|
||||
}],
|
||||
eol: undefined,
|
||||
versionId: undefined,
|
||||
eol: undefined!,
|
||||
versionId: undefined!,
|
||||
});
|
||||
|
||||
assertOffsetAt(0, 1, 1);
|
||||
@@ -212,12 +212,12 @@ suite('ExtHostDocumentData', () => {
|
||||
data.onEvents({
|
||||
changes: [{
|
||||
range: { startLineNumber: 1, startColumn: 3, endLineNumber: 2, endColumn: 6 },
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: ''
|
||||
}],
|
||||
eol: undefined,
|
||||
versionId: undefined,
|
||||
eol: undefined!,
|
||||
versionId: undefined!,
|
||||
});
|
||||
|
||||
assertOffsetAt(0, 1, 1);
|
||||
@@ -240,41 +240,41 @@ suite('ExtHostDocumentData', () => {
|
||||
});
|
||||
|
||||
test('getWordRangeAtPosition', () => {
|
||||
data = new ExtHostDocumentData(undefined, URI.file(''), [
|
||||
data = new ExtHostDocumentData(undefined!, URI.file(''), [
|
||||
'aaaa bbbb+cccc abc'
|
||||
], '\n', 'text', 1, false);
|
||||
|
||||
let range = data.document.getWordRangeAtPosition(new Position(0, 2));
|
||||
let range = data.document.getWordRangeAtPosition(new Position(0, 2))!;
|
||||
assert.equal(range.start.line, 0);
|
||||
assert.equal(range.start.character, 0);
|
||||
assert.equal(range.end.line, 0);
|
||||
assert.equal(range.end.character, 4);
|
||||
|
||||
// ignore bad regular expresson /.*/
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 2), /.*/);
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 2), /.*/)!;
|
||||
assert.equal(range.start.line, 0);
|
||||
assert.equal(range.start.character, 0);
|
||||
assert.equal(range.end.line, 0);
|
||||
assert.equal(range.end.character, 4);
|
||||
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 5), /[a-z+]+/);
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 5), /[a-z+]+/)!;
|
||||
assert.equal(range.start.line, 0);
|
||||
assert.equal(range.start.character, 5);
|
||||
assert.equal(range.end.line, 0);
|
||||
assert.equal(range.end.character, 14);
|
||||
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 17), /[a-z+]+/);
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 17), /[a-z+]+/)!;
|
||||
assert.equal(range.start.line, 0);
|
||||
assert.equal(range.start.character, 15);
|
||||
assert.equal(range.end.line, 0);
|
||||
assert.equal(range.end.character, 18);
|
||||
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 11), /yy/);
|
||||
range = data.document.getWordRangeAtPosition(new Position(0, 11), /yy/)!;
|
||||
assert.equal(range, undefined);
|
||||
});
|
||||
|
||||
test('getWordRangeAtPosition doesn\'t quite use the regex as expected, #29102', function () {
|
||||
data = new ExtHostDocumentData(undefined, URI.file(''), [
|
||||
data = new ExtHostDocumentData(undefined!, URI.file(''), [
|
||||
'some text here',
|
||||
'/** foo bar */',
|
||||
'function() {',
|
||||
@@ -285,7 +285,7 @@ suite('ExtHostDocumentData', () => {
|
||||
let range = data.document.getWordRangeAtPosition(new Position(0, 0), /\/\*.+\*\//);
|
||||
assert.equal(range, undefined);
|
||||
|
||||
range = data.document.getWordRangeAtPosition(new Position(1, 0), /\/\*.+\*\//);
|
||||
range = data.document.getWordRangeAtPosition(new Position(1, 0), /\/\*.+\*\//)!;
|
||||
assert.equal(range.start.line, 1);
|
||||
assert.equal(range.start.character, 0);
|
||||
assert.equal(range.end.line, 1);
|
||||
@@ -294,7 +294,7 @@ suite('ExtHostDocumentData', () => {
|
||||
range = data.document.getWordRangeAtPosition(new Position(3, 0), /("|').*\1/);
|
||||
assert.equal(range, undefined);
|
||||
|
||||
range = data.document.getWordRangeAtPosition(new Position(3, 1), /("|').*\1/);
|
||||
range = data.document.getWordRangeAtPosition(new Position(3, 1), /("|').*\1/)!;
|
||||
assert.equal(range.start.line, 3);
|
||||
assert.equal(range.start.character, 1);
|
||||
assert.equal(range.end.line, 3);
|
||||
@@ -346,17 +346,17 @@ suite('ExtHostDocumentData updates line mapping', () => {
|
||||
return {
|
||||
changes: [{
|
||||
range: range,
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: text
|
||||
}],
|
||||
eol: eol,
|
||||
versionId: undefined,
|
||||
eol: eol!,
|
||||
versionId: undefined!,
|
||||
};
|
||||
}
|
||||
|
||||
function testLineMappingDirectionAfterEvents(lines: string[], eol: string, direction: AssertDocumentLineMappingDirection, e: IModelChangedEvent): void {
|
||||
let myDocument = new ExtHostDocumentData(undefined, URI.file(''), lines.slice(0), eol, 'text', 1, false);
|
||||
let myDocument = new ExtHostDocumentData(undefined!, URI.file(''), lines.slice(0), eol, 'text', 1, false);
|
||||
assertDocumentLineMapping(myDocument, direction);
|
||||
|
||||
myDocument.onEvents(e);
|
||||
@@ -377,7 +377,7 @@ suite('ExtHostDocumentData updates line mapping', () => {
|
||||
'and this is line number two',
|
||||
'it is followed by #3',
|
||||
'and finished with the fourth.',
|
||||
], { changes: [], eol: undefined, versionId: 7 });
|
||||
], { changes: [], eol: undefined!, versionId: 7 });
|
||||
});
|
||||
|
||||
test('after remove', () => {
|
||||
|
||||
@@ -17,6 +17,7 @@ import { IExtensionDescription } from 'vs/workbench/services/extensions/common/e
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { isResourceTextEdit, ResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
suite('ExtHostDocumentSaveParticipant', () => {
|
||||
|
||||
@@ -25,15 +26,15 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
||||
let documents: ExtHostDocuments;
|
||||
let nullLogService = new NullLogService();
|
||||
let nullExtensionDescription: IExtensionDescription = {
|
||||
id: 'nullExtensionDescription',
|
||||
identifier: new ExtensionIdentifier('nullExtensionDescription'),
|
||||
name: 'Null Extension Description',
|
||||
publisher: 'vscode',
|
||||
enableProposedApi: false,
|
||||
engines: undefined,
|
||||
extensionLocation: undefined,
|
||||
engines: undefined!,
|
||||
extensionLocation: undefined!,
|
||||
isBuiltin: false,
|
||||
isUnderDevelopment: false,
|
||||
version: undefined
|
||||
version: undefined!
|
||||
};
|
||||
|
||||
setup(() => {
|
||||
@@ -85,7 +86,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
||||
sub.dispose();
|
||||
|
||||
assert.ok(event);
|
||||
assert.throws(() => { event.document = null; });
|
||||
assert.throws(() => { event.document = null!; });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -212,7 +213,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
assert.throws(() => event.waitUntil(timeout(10)));
|
||||
resolve(void 0);
|
||||
resolve(undefined);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
@@ -300,11 +301,11 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
||||
documents.$acceptModelChanged(resource, {
|
||||
changes: [{
|
||||
range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 },
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
text: 'bar'
|
||||
}],
|
||||
eol: undefined,
|
||||
eol: undefined!,
|
||||
versionId: 2
|
||||
}, true);
|
||||
|
||||
@@ -336,10 +337,10 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
||||
changes: [{
|
||||
range,
|
||||
text,
|
||||
rangeOffset: undefined,
|
||||
rangeLength: undefined,
|
||||
rangeOffset: undefined!,
|
||||
rangeLength: undefined!,
|
||||
}],
|
||||
eol: undefined,
|
||||
eol: undefined!,
|
||||
versionId: documents.getDocumentData(uri).version + 1
|
||||
}, true);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ suite('ExtHostDocumentsAndEditors', () => {
|
||||
|
||||
setup(function () {
|
||||
editors = new ExtHostDocumentsAndEditors({
|
||||
getProxy: () => { return undefined; },
|
||||
set: undefined,
|
||||
assertRegistered: undefined
|
||||
getProxy: () => { return undefined!; },
|
||||
set: undefined!,
|
||||
assertRegistered: undefined!
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -12,17 +12,17 @@ suite('ExtHostFileSystemEventService', () => {
|
||||
test('FileSystemWatcher ignore events properties are reversed #26851', function () {
|
||||
|
||||
const protocol: IMainContext = {
|
||||
getProxy: () => { return undefined; },
|
||||
set: undefined,
|
||||
assertRegistered: undefined
|
||||
getProxy: () => { return undefined!; },
|
||||
set: undefined!,
|
||||
assertRegistered: undefined!
|
||||
};
|
||||
|
||||
const watcher1 = new ExtHostFileSystemEventService(protocol, undefined).createFileSystemWatcher('**/somethingInteresting', false, false, false);
|
||||
const watcher1 = new ExtHostFileSystemEventService(protocol, undefined!).createFileSystemWatcher('**/somethingInteresting', false, false, false);
|
||||
assert.equal(watcher1.ignoreChangeEvents, false);
|
||||
assert.equal(watcher1.ignoreCreateEvents, false);
|
||||
assert.equal(watcher1.ignoreDeleteEvents, false);
|
||||
|
||||
const watcher2 = new ExtHostFileSystemEventService(protocol, undefined).createFileSystemWatcher('**/somethingBoring', true, true, true);
|
||||
const watcher2 = new ExtHostFileSystemEventService(protocol, undefined!).createFileSystemWatcher('**/somethingBoring', true, true, true);
|
||||
assert.equal(watcher2.ignoreChangeEvents, true);
|
||||
assert.equal(watcher2.ignoreCreateEvents, true);
|
||||
assert.equal(watcher2.ignoreDeleteEvents, true);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ const emptyCommandService: ICommandService = {
|
||||
_serviceBrand: undefined,
|
||||
onWillExecuteCommand: () => ({ dispose: () => { } }),
|
||||
executeCommand: (commandId: string, ...args: any[]): Promise<any> => {
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,9 +78,9 @@ suite('ExtHostMessageService', function () {
|
||||
|
||||
test('propagte handle on select', async function () {
|
||||
|
||||
let service = new MainThreadMessageService(null, new EmptyNotificationService(notification => {
|
||||
assert.equal(notification.actions.primary.length, 1);
|
||||
setImmediate(() => notification.actions.primary[0].run());
|
||||
let service = new MainThreadMessageService(null!, new EmptyNotificationService(notification => {
|
||||
assert.equal(notification.actions!.primary!.length, 1);
|
||||
setImmediate(() => notification.actions!.primary![0].run());
|
||||
}), emptyCommandService, emptyDialogService);
|
||||
|
||||
const handle = await service.$showMessage(1, 'h', {}, [{ handle: 42, title: 'a thing', isCloseAffordance: true }]);
|
||||
@@ -89,7 +89,7 @@ suite('ExtHostMessageService', function () {
|
||||
|
||||
suite('modal', () => {
|
||||
test('calls dialog service', async () => {
|
||||
const service = new MainThreadMessageService(null, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
const service = new MainThreadMessageService(null!, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
show(severity, message, buttons) {
|
||||
assert.equal(severity, 1);
|
||||
assert.equal(message, 'h');
|
||||
@@ -104,7 +104,7 @@ suite('ExtHostMessageService', function () {
|
||||
});
|
||||
|
||||
test('returns undefined when cancelled', async () => {
|
||||
const service = new MainThreadMessageService(null, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
const service = new MainThreadMessageService(null!, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
show(severity, message, buttons) {
|
||||
return Promise.resolve(1);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ suite('ExtHostMessageService', function () {
|
||||
});
|
||||
|
||||
test('hides Cancel button when not needed', async () => {
|
||||
const service = new MainThreadMessageService(null, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
const service = new MainThreadMessageService(null!, emptyNotificationService, emptyCommandService, new class extends mock<IDialogService>() {
|
||||
show(severity, message, buttons) {
|
||||
assert.equal(buttons.length, 1);
|
||||
return Promise.resolve(0);
|
||||
|
||||
@@ -12,7 +12,6 @@ import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import * as extfs from 'vs/base/node/extfs';
|
||||
import { IFileMatch, IFileQuery, IPatternInfo, IRawFileMatch2, ISearchCompleteStats, ISearchQuery, ITextQuery, QueryType, resultIsMatch } from 'vs/platform/search/common/search';
|
||||
import { MainContext, MainThreadSearchShape } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration';
|
||||
import { ExtHostSearch } from 'vs/workbench/api/node/extHostSearch';
|
||||
import { Range } from 'vs/workbench/api/node/extHostTypes';
|
||||
import { extensionResultIsMatch } from 'vs/workbench/services/search/node/textSearchManager';
|
||||
@@ -28,7 +27,7 @@ let mockMainThreadSearch: MockMainThreadSearch;
|
||||
class MockMainThreadSearch implements MainThreadSearchShape {
|
||||
lastHandle: number;
|
||||
|
||||
results: (UriComponents | IRawFileMatch2)[] = [];
|
||||
results: Array<UriComponents | IRawFileMatch2> = [];
|
||||
|
||||
$registerFileSearchProvider(handle: number, scheme: string): void {
|
||||
this.lastHandle = handle;
|
||||
@@ -60,12 +59,6 @@ class MockMainThreadSearch implements MainThreadSearchShape {
|
||||
}
|
||||
}
|
||||
|
||||
class MockExtHostConfiguration {
|
||||
getConfiguration(section?: string, resource?: URI, extensionId?: string): vscode.WorkspaceConfiguration {
|
||||
return <vscode.WorkspaceConfiguration>{};
|
||||
}
|
||||
}
|
||||
|
||||
let mockExtfs: Partial<typeof extfs>;
|
||||
|
||||
suite('ExtHostSearch', () => {
|
||||
@@ -100,7 +93,7 @@ suite('ExtHostSearch', () => {
|
||||
await rpcProtocol.sync();
|
||||
return {
|
||||
results: (<UriComponents[]>mockMainThreadSearch.results).map(r => URI.revive(r)),
|
||||
stats
|
||||
stats: stats!
|
||||
};
|
||||
}
|
||||
|
||||
@@ -130,7 +123,7 @@ suite('ExtHostSearch', () => {
|
||||
}
|
||||
}));
|
||||
|
||||
return { results, stats };
|
||||
return { results, stats: stats! };
|
||||
}
|
||||
|
||||
setup(() => {
|
||||
@@ -138,12 +131,11 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
mockMainThreadSearch = new MockMainThreadSearch();
|
||||
const logService = new TestLogService();
|
||||
const ehConfiguration: ExtHostConfiguration = new MockExtHostConfiguration() as any;
|
||||
|
||||
rpcProtocol.set(MainContext.MainThreadSearch, mockMainThreadSearch);
|
||||
|
||||
mockExtfs = {};
|
||||
extHostSearch = new ExtHostSearch(rpcProtocol, null, logService, ehConfiguration, mockExtfs as typeof extfs);
|
||||
extHostSearch = new ExtHostSearch(rpcProtocol, null!, logService, mockExtfs as typeof extfs);
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
@@ -179,8 +171,8 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('no results', async () => {
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
return Promise.resolve(null);
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -197,7 +189,7 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
return Promise.resolve(reportedResults);
|
||||
}
|
||||
});
|
||||
@@ -211,7 +203,7 @@ suite('ExtHostSearch', () => {
|
||||
test('Search canceled', async () => {
|
||||
let cancelRequested = false;
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
token.onCancellationRequested(() => {
|
||||
cancelRequested = true;
|
||||
@@ -229,8 +221,8 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('provider returns null', async () => {
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
return null;
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
return null!;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -244,9 +236,9 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('all provider calls get global include/excludes', async () => {
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
assert(options.excludes.length === 2 && options.includes.length === 2, 'Missing global include/excludes');
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -273,7 +265,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('global/local include/excludes combined', async () => {
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
if (options.folder.toString() === rootFolderA.toString()) {
|
||||
assert.deepEqual(options.includes.sort(), ['*.ts', 'foo']);
|
||||
assert.deepEqual(options.excludes.sort(), ['*.js', 'bar']);
|
||||
@@ -282,7 +274,7 @@ suite('ExtHostSearch', () => {
|
||||
assert.deepEqual(options.excludes.sort(), ['*.js']);
|
||||
}
|
||||
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -315,11 +307,11 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('include/excludes resolved correctly', async () => {
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
assert.deepEqual(options.includes.sort(), ['*.jsx', '*.ts']);
|
||||
assert.deepEqual(options.excludes.sort(), []);
|
||||
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -358,7 +350,7 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
return Promise.resolve(reportedResults
|
||||
.map(relativePath => joinPath(options.folder, relativePath)));
|
||||
}
|
||||
@@ -389,7 +381,7 @@ suite('ExtHostSearch', () => {
|
||||
test('multiroot sibling exclude clause', async () => {
|
||||
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
let reportedResults: URI[];
|
||||
if (options.folder.fsPath === rootFolderA.fsPath) {
|
||||
reportedResults = [
|
||||
@@ -459,7 +451,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
let wasCanceled = false;
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
token.onCancellationRequested(() => wasCanceled = true);
|
||||
|
||||
return Promise.resolve(reportedResults);
|
||||
@@ -495,7 +487,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
let wasCanceled = false;
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
token.onCancellationRequested(() => wasCanceled = true);
|
||||
|
||||
return Promise.resolve(reportedResults);
|
||||
@@ -530,7 +522,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
let wasCanceled = false;
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
token.onCancellationRequested(() => wasCanceled = true);
|
||||
|
||||
return Promise.resolve(reportedResults);
|
||||
@@ -603,7 +595,7 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestFileSearchProvider({
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Thenable<URI[]> {
|
||||
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
|
||||
return Promise.resolve(reportedResults);
|
||||
}
|
||||
}, fancyScheme);
|
||||
@@ -627,7 +619,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
function makePreview(text: string): vscode.TextSearchMatch['preview'] {
|
||||
return {
|
||||
matches: new Range(0, 0, 0, text.length),
|
||||
matches: [new Range(0, 0, 0, text.length)],
|
||||
text
|
||||
};
|
||||
}
|
||||
@@ -635,7 +627,7 @@ suite('ExtHostSearch', () => {
|
||||
function makeTextResult(baseFolder: URI, relativePath: string): vscode.TextSearchMatch {
|
||||
return {
|
||||
preview: makePreview('foo'),
|
||||
ranges: new Range(0, 0, 0, 3),
|
||||
ranges: [new Range(0, 0, 0, 3)],
|
||||
uri: joinPath(baseFolder, relativePath)
|
||||
};
|
||||
}
|
||||
@@ -661,7 +653,7 @@ suite('ExtHostSearch', () => {
|
||||
const actualTextSearchResults: vscode.TextSearchResult[] = [];
|
||||
for (let fileMatch of actual) {
|
||||
// Make relative
|
||||
for (let lineResult of fileMatch.results) {
|
||||
for (let lineResult of fileMatch.results!) {
|
||||
if (resultIsMatch(lineResult)) {
|
||||
actualTextSearchResults.push({
|
||||
preview: {
|
||||
@@ -714,8 +706,8 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('no results', async () => {
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
return Promise.resolve(null);
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -731,9 +723,9 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -744,10 +736,10 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('all provider calls get global include/excludes', async () => {
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
assert.equal(options.includes.length, 1);
|
||||
assert.equal(options.excludes.length, 1);
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -774,7 +766,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('global/local include/excludes combined', async () => {
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
if (options.folder.toString() === rootFolderA.toString()) {
|
||||
assert.deepEqual(options.includes.sort(), ['*.ts', 'foo']);
|
||||
assert.deepEqual(options.excludes.sort(), ['*.js', 'bar']);
|
||||
@@ -783,7 +775,7 @@ suite('ExtHostSearch', () => {
|
||||
assert.deepEqual(options.excludes.sort(), ['*.js']);
|
||||
}
|
||||
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -816,11 +808,11 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('include/excludes resolved correctly', async () => {
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
assert.deepEqual(options.includes.sort(), ['*.jsx', '*.ts']);
|
||||
assert.deepEqual(options.excludes.sort(), []);
|
||||
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -854,7 +846,7 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
test('provider fail', async () => {
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
throw new Error('Provider fail');
|
||||
}
|
||||
});
|
||||
@@ -870,12 +862,12 @@ suite('ExtHostSearch', () => {
|
||||
test('basic sibling clause', async () => {
|
||||
mockExtfs.readdir = (_path: string, callback: (error: Error, files: string[]) => void) => {
|
||||
if (_path === rootFolderA.fsPath) {
|
||||
callback(null, [
|
||||
callback(null!, [
|
||||
'file1.js',
|
||||
'file1.ts'
|
||||
]);
|
||||
} else {
|
||||
callback(new Error('Wrong path'), null);
|
||||
callback(new Error('Wrong path'), null!);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -885,9 +877,9 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -913,24 +905,24 @@ suite('ExtHostSearch', () => {
|
||||
test('multiroot sibling clause', async () => {
|
||||
mockExtfs.readdir = (_path: string, callback: (error: Error, files: string[]) => void) => {
|
||||
if (_path === joinPath(rootFolderA, 'folder').fsPath) {
|
||||
callback(null, [
|
||||
callback(null!, [
|
||||
'fileA.scss',
|
||||
'fileA.css',
|
||||
'file2.css'
|
||||
]);
|
||||
} else if (_path === rootFolderB.fsPath) {
|
||||
callback(null, [
|
||||
callback(null!, [
|
||||
'fileB.ts',
|
||||
'fileB.js',
|
||||
'file3.js'
|
||||
]);
|
||||
} else {
|
||||
callback(new Error('Wrong path'), null);
|
||||
callback(new Error('Wrong path'), null!);
|
||||
}
|
||||
};
|
||||
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
let reportedResults;
|
||||
if (options.folder.fsPath === rootFolderA.fsPath) {
|
||||
reportedResults = [
|
||||
@@ -947,7 +939,7 @@ suite('ExtHostSearch', () => {
|
||||
}
|
||||
|
||||
reportedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -995,9 +987,9 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1026,10 +1018,10 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
let wasCanceled = false;
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
token.onCancellationRequested(() => wasCanceled = true);
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1059,10 +1051,10 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
let wasCanceled = false;
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
token.onCancellationRequested(() => wasCanceled = true);
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1091,10 +1083,10 @@ suite('ExtHostSearch', () => {
|
||||
|
||||
let wasCanceled = false;
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
token.onCancellationRequested(() => wasCanceled = true);
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1123,7 +1115,7 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve({ limitHit: true });
|
||||
}
|
||||
@@ -1156,7 +1148,7 @@ suite('ExtHostSearch', () => {
|
||||
'file2.ts',
|
||||
'file3.ts',
|
||||
].forEach(f => progress.report(makeTextResult(options.folder, f)));
|
||||
return null;
|
||||
return null!;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1185,9 +1177,9 @@ suite('ExtHostSearch', () => {
|
||||
];
|
||||
|
||||
await registerTestTextSearchProvider({
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Thenable<vscode.TextSearchComplete> {
|
||||
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
|
||||
providedResults.forEach(r => progress.report(r));
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(null!);
|
||||
}
|
||||
}, fancyScheme);
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
suite('ExtHostTextEditor', () => {
|
||||
|
||||
let editor: ExtHostTextEditor;
|
||||
let doc = new ExtHostDocumentData(undefined, URI.file(''), [
|
||||
let doc = new ExtHostDocumentData(undefined!, URI.file(''), [
|
||||
'aaaa bbbb+cccc abc'
|
||||
], '\n', 'text', 1, false);
|
||||
|
||||
setup(() => {
|
||||
editor = new ExtHostTextEditor(null, 'fake', doc, [], { cursorStyle: 0, insertSpaces: true, lineNumbers: 1, tabSize: 4 }, [], 1);
|
||||
editor = new ExtHostTextEditor(null!, 'fake', doc, [], { cursorStyle: 0, insertSpaces: true, lineNumbers: 1, tabSize: 4 }, [], 1);
|
||||
});
|
||||
|
||||
test('disposed editor', () => {
|
||||
@@ -34,7 +34,7 @@ suite('ExtHostTextEditor', () => {
|
||||
assert.equal(3, editor.viewColumn);
|
||||
|
||||
assert.ok(editor.document);
|
||||
assert.throws(() => editor._acceptOptions(null));
|
||||
assert.throws(() => editor._acceptOptions(null!));
|
||||
assert.throws(() => editor._acceptSelections([]));
|
||||
});
|
||||
|
||||
@@ -66,25 +66,25 @@ suite('ExtHostTextEditorOptions', () => {
|
||||
setup(() => {
|
||||
calls = [];
|
||||
let mockProxy: MainThreadTextEditorsShape = {
|
||||
dispose: undefined,
|
||||
dispose: undefined!,
|
||||
$trySetOptions: (id: string, options: ITextEditorConfigurationUpdate) => {
|
||||
assert.equal(id, '1');
|
||||
calls.push(options);
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
},
|
||||
$tryShowTextDocument: undefined,
|
||||
$registerTextEditorDecorationType: undefined,
|
||||
$removeTextEditorDecorationType: undefined,
|
||||
$tryShowEditor: undefined,
|
||||
$tryHideEditor: undefined,
|
||||
$trySetDecorations: undefined,
|
||||
$trySetDecorationsFast: undefined,
|
||||
$tryRevealRange: undefined,
|
||||
$trySetSelections: undefined,
|
||||
$tryApplyEdits: undefined,
|
||||
$tryApplyWorkspaceEdit: undefined,
|
||||
$tryInsertSnippet: undefined,
|
||||
$getDiffInformation: undefined
|
||||
$tryShowTextDocument: undefined!,
|
||||
$registerTextEditorDecorationType: undefined!,
|
||||
$removeTextEditorDecorationType: undefined!,
|
||||
$tryShowEditor: undefined!,
|
||||
$tryHideEditor: undefined!,
|
||||
$trySetDecorations: undefined!,
|
||||
$trySetDecorationsFast: undefined!,
|
||||
$tryRevealRange: undefined!,
|
||||
$trySetSelections: undefined!,
|
||||
$tryApplyEdits: undefined!,
|
||||
$tryApplyWorkspaceEdit: undefined!,
|
||||
$tryInsertSnippet: undefined!,
|
||||
$getDiffInformation: undefined!
|
||||
};
|
||||
opts = new ExtHostTextEditorOptions(mockProxy, '1', {
|
||||
tabSize: 4,
|
||||
@@ -95,8 +95,8 @@ suite('ExtHostTextEditorOptions', () => {
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
opts = null;
|
||||
calls = null;
|
||||
opts = null!;
|
||||
calls = null!;
|
||||
});
|
||||
|
||||
function assertState(opts: ExtHostTextEditorOptions, expected: IResolvedTextEditorConfiguration): void {
|
||||
@@ -165,7 +165,7 @@ suite('ExtHostTextEditorOptions', () => {
|
||||
});
|
||||
|
||||
test('ignores invalid tabSize 1', () => {
|
||||
opts.tabSize = null;
|
||||
opts.tabSize = null!;
|
||||
assertState(opts, {
|
||||
tabSize: 4,
|
||||
insertSpaces: false,
|
||||
|
||||
@@ -19,7 +19,7 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
|
||||
let workspaceResourceEdits: WorkspaceEditDto;
|
||||
|
||||
setup(() => {
|
||||
workspaceResourceEdits = null;
|
||||
workspaceResourceEdits = null!;
|
||||
|
||||
let rpcProtocol = new TestRPCProtocol();
|
||||
rpcProtocol.set(MainContext.MainThreadTextEditors, new class extends mock<MainThreadTextEditorsShape>() {
|
||||
|
||||
@@ -41,7 +41,7 @@ suite('ExtHostTreeView', function () {
|
||||
|
||||
let testObject: ExtHostTreeViews;
|
||||
let target: RecordingShape;
|
||||
let onDidChangeTreeNode: Emitter<{ key: string }>;
|
||||
let onDidChangeTreeNode: Emitter<{ key: string } | undefined>;
|
||||
let onDidChangeTreeNodeWithId: Emitter<{ key: string }>;
|
||||
let tree, labels, nodes;
|
||||
|
||||
@@ -199,7 +199,7 @@ suite('ExtHostTreeView', function () {
|
||||
.then(() => { assert.fail('Should fail with duplicate id'); done(); }, () => done());
|
||||
});
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh root', function (done) {
|
||||
@@ -207,7 +207,7 @@ suite('ExtHostTreeView', function () {
|
||||
assert.equal(undefined, actuals);
|
||||
done();
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh a parent node', () => {
|
||||
@@ -219,7 +219,7 @@ suite('ExtHostTreeView', function () {
|
||||
label: { label: 'b' },
|
||||
collapsibleState: TreeItemCollapsibleState.Collapsed
|
||||
});
|
||||
c(null);
|
||||
c(undefined);
|
||||
});
|
||||
onDidChangeTreeNode.fire(getNode('b'));
|
||||
});
|
||||
@@ -300,10 +300,10 @@ suite('ExtHostTreeView', function () {
|
||||
assert.equal(undefined, actuals);
|
||||
done();
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh calls are throttled on elements', function (done) {
|
||||
@@ -339,7 +339,7 @@ suite('ExtHostTreeView', function () {
|
||||
onDidChangeTreeNode.fire(getNode('a'));
|
||||
onDidChangeTreeNode.fire(getNode('b'));
|
||||
onDidChangeTreeNode.fire(getNode('g'));
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh calls are throttled on elements and root', function (done) {
|
||||
@@ -350,7 +350,7 @@ suite('ExtHostTreeView', function () {
|
||||
|
||||
onDidChangeTreeNode.fire(getNode('a'));
|
||||
onDidChangeTreeNode.fire(getNode('b'));
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(getNode('a'));
|
||||
});
|
||||
|
||||
@@ -366,7 +366,7 @@ suite('ExtHostTreeView', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('tree with duplicate labels', (done) => {
|
||||
@@ -415,7 +415,7 @@ suite('ExtHostTreeView', function () {
|
||||
});
|
||||
});
|
||||
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('getChildren is not returned from cache if refreshed', (done) => {
|
||||
@@ -431,7 +431,7 @@ suite('ExtHostTreeView', function () {
|
||||
});
|
||||
});
|
||||
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('getChildren is returned from cache if not refreshed', () => {
|
||||
@@ -596,7 +596,7 @@ suite('ExtHostTreeView', function () {
|
||||
if (typeof obj === 'object') {
|
||||
const result = {};
|
||||
for (const key of Object.keys(obj)) {
|
||||
if (obj[key] !== void 0) {
|
||||
if (obj[key] !== undefined) {
|
||||
result[key] = removeUnsetKeys(obj[key]);
|
||||
}
|
||||
}
|
||||
@@ -627,7 +627,7 @@ suite('ExtHostTreeView', function () {
|
||||
},
|
||||
getParent: ({ key }: { key: string }): { key: string } => {
|
||||
const parentKey = key.substring(0, key.length - 1);
|
||||
return parentKey ? new Key(parentKey) : void 0;
|
||||
return parentKey ? new Key(parentKey) : undefined;
|
||||
},
|
||||
onDidChangeTreeData: onDidChangeTreeNode.event
|
||||
};
|
||||
|
||||
@@ -29,34 +29,34 @@ suite('ExtHostTypeConverter', function () {
|
||||
|
||||
data = MarkdownString.from('Hello [link](foo:path)');
|
||||
assert.equal(data.value, 'Hello [link](foo:path)');
|
||||
assert.equal(size(data.uris), 1);
|
||||
assert.ok(!!data.uris['foo:path']);
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['foo:path']);
|
||||
|
||||
data = MarkdownString.from('hello@foo.bar');
|
||||
assert.equal(data.value, 'hello@foo.bar');
|
||||
assert.equal(size(data.uris), 1);
|
||||
assert.ok(!!data.uris['mailto:hello@foo.bar']);
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['mailto:hello@foo.bar']);
|
||||
|
||||
data = MarkdownString.from('*hello* [click](command:me)');
|
||||
assert.equal(data.value, '*hello* [click](command:me)');
|
||||
assert.equal(size(data.uris), 1);
|
||||
assert.ok(!!data.uris['command:me']);
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['command:me']);
|
||||
|
||||
data = MarkdownString.from('*hello* [click](file:///somepath/here). [click](file:///somepath/here)');
|
||||
assert.equal(data.value, '*hello* [click](file:///somepath/here). [click](file:///somepath/here)');
|
||||
assert.equal(size(data.uris), 1);
|
||||
assert.ok(!!data.uris['file:///somepath/here']);
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['file:///somepath/here']);
|
||||
|
||||
data = MarkdownString.from('*hello* [click](file:///somepath/here). [click](file:///somepath/here)');
|
||||
assert.equal(data.value, '*hello* [click](file:///somepath/here). [click](file:///somepath/here)');
|
||||
assert.equal(size(data.uris), 1);
|
||||
assert.ok(!!data.uris['file:///somepath/here']);
|
||||
assert.equal(size(data.uris!), 1);
|
||||
assert.ok(!!data.uris!['file:///somepath/here']);
|
||||
|
||||
data = MarkdownString.from('*hello* [click](file:///somepath/here). [click](file:///somepath/here2)');
|
||||
assert.equal(data.value, '*hello* [click](file:///somepath/here). [click](file:///somepath/here2)');
|
||||
assert.equal(size(data.uris), 2);
|
||||
assert.ok(!!data.uris['file:///somepath/here']);
|
||||
assert.ok(!!data.uris['file:///somepath/here2']);
|
||||
assert.equal(size(data.uris!), 2);
|
||||
assert.ok(!!data.uris!['file:///somepath/here']);
|
||||
assert.ok(!!data.uris!['file:///somepath/here2']);
|
||||
});
|
||||
|
||||
test('LogLevel', () => {
|
||||
|
||||
@@ -56,7 +56,7 @@ suite('ExtHostTypes', function () {
|
||||
d.dispose();
|
||||
assert.equal(count, 1);
|
||||
|
||||
types.Disposable.from(undefined, { dispose() { count += 1; } }).dispose();
|
||||
types.Disposable.from(undefined!, { dispose() { count += 1; } }).dispose();
|
||||
assert.equal(count, 2);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ suite('ExtHostTypes', function () {
|
||||
}).dispose();
|
||||
});
|
||||
|
||||
new types.Disposable(undefined).dispose();
|
||||
new types.Disposable(undefined!).dispose();
|
||||
|
||||
});
|
||||
|
||||
@@ -154,11 +154,11 @@ suite('ExtHostTypes', function () {
|
||||
assert.equal(res.line, 12);
|
||||
assert.equal(res.character, 3);
|
||||
|
||||
assert.throws(() => p1.translate(null));
|
||||
assert.throws(() => p1.translate(null, null));
|
||||
assert.throws(() => p1.translate(null!));
|
||||
assert.throws(() => p1.translate(null!, null!));
|
||||
assert.throws(() => p1.translate(-2));
|
||||
assert.throws(() => p1.translate({ lineDelta: -2 }));
|
||||
assert.throws(() => p1.translate(-2, null));
|
||||
assert.throws(() => p1.translate(-2, null!));
|
||||
assert.throws(() => p1.translate(0, -4));
|
||||
});
|
||||
|
||||
@@ -178,7 +178,7 @@ suite('ExtHostTypes', function () {
|
||||
assert.equal(p2.line, 0);
|
||||
assert.equal(p2.character, 11);
|
||||
|
||||
assert.throws(() => p1.with(null));
|
||||
assert.throws(() => p1.with(null!));
|
||||
assert.throws(() => p1.with(-9));
|
||||
assert.throws(() => p1.with(0, -9));
|
||||
assert.throws(() => p1.with({ line: -1 }));
|
||||
@@ -188,10 +188,10 @@ suite('ExtHostTypes', function () {
|
||||
test('Range', () => {
|
||||
assert.throws(() => new types.Range(-1, 0, 0, 0));
|
||||
assert.throws(() => new types.Range(0, -1, 0, 0));
|
||||
assert.throws(() => new types.Range(new types.Position(0, 0), undefined));
|
||||
assert.throws(() => new types.Range(new types.Position(0, 0), null));
|
||||
assert.throws(() => new types.Range(undefined, new types.Position(0, 0)));
|
||||
assert.throws(() => new types.Range(null, new types.Position(0, 0)));
|
||||
assert.throws(() => new types.Range(new types.Position(0, 0), undefined!));
|
||||
assert.throws(() => new types.Range(new types.Position(0, 0), null!));
|
||||
assert.throws(() => new types.Range(undefined!, new types.Position(0, 0)));
|
||||
assert.throws(() => new types.Range(null!, new types.Position(0, 0)));
|
||||
|
||||
let range = new types.Range(1, 0, 0, 0);
|
||||
assert.throws(() => { (range as any).start = null; });
|
||||
@@ -250,30 +250,30 @@ suite('ExtHostTypes', function () {
|
||||
let range = new types.Range(1, 1, 2, 11);
|
||||
let res: types.Range;
|
||||
|
||||
res = range.intersection(range);
|
||||
res = range.intersection(range)!;
|
||||
assert.equal(res.start.line, 1);
|
||||
assert.equal(res.start.character, 1);
|
||||
assert.equal(res.end.line, 2);
|
||||
assert.equal(res.end.character, 11);
|
||||
|
||||
res = range.intersection(new types.Range(2, 12, 4, 0));
|
||||
res = range.intersection(new types.Range(2, 12, 4, 0))!;
|
||||
assert.equal(res, undefined);
|
||||
|
||||
res = range.intersection(new types.Range(0, 0, 1, 0));
|
||||
res = range.intersection(new types.Range(0, 0, 1, 0))!;
|
||||
assert.equal(res, undefined);
|
||||
|
||||
res = range.intersection(new types.Range(0, 0, 1, 1));
|
||||
res = range.intersection(new types.Range(0, 0, 1, 1))!;
|
||||
assert.ok(res.isEmpty);
|
||||
assert.equal(res.start.line, 1);
|
||||
assert.equal(res.start.character, 1);
|
||||
|
||||
res = range.intersection(new types.Range(2, 11, 61, 1));
|
||||
res = range.intersection(new types.Range(2, 11, 61, 1))!;
|
||||
assert.ok(res.isEmpty);
|
||||
assert.equal(res.start.line, 2);
|
||||
assert.equal(res.start.character, 11);
|
||||
|
||||
assert.throws(() => range.intersection(null));
|
||||
assert.throws(() => range.intersection(undefined));
|
||||
assert.throws(() => range.intersection(null!));
|
||||
assert.throws(() => range.intersection(undefined!));
|
||||
});
|
||||
|
||||
test('Range, union', function () {
|
||||
@@ -325,18 +325,18 @@ suite('ExtHostTypes', function () {
|
||||
assert.equal(res.start.line, 2);
|
||||
assert.equal(res.start.character, 3);
|
||||
|
||||
assert.throws(() => range.with(null));
|
||||
assert.throws(() => range.with(undefined, null));
|
||||
assert.throws(() => range.with(null!));
|
||||
assert.throws(() => range.with(undefined, null!));
|
||||
});
|
||||
|
||||
test('TextEdit', () => {
|
||||
|
||||
let range = new types.Range(1, 1, 2, 11);
|
||||
let edit = new types.TextEdit(range, undefined);
|
||||
let edit = new types.TextEdit(range, undefined!);
|
||||
assert.equal(edit.newText, '');
|
||||
assertToJSON(edit, { range: [{ line: 1, character: 1 }, { line: 2, character: 11 }], newText: '' });
|
||||
|
||||
edit = new types.TextEdit(range, null);
|
||||
edit = new types.TextEdit(range, null!);
|
||||
assert.equal(edit.newText, '');
|
||||
|
||||
edit = new types.TextEdit(range, '');
|
||||
@@ -365,7 +365,7 @@ suite('ExtHostTypes', function () {
|
||||
[b.toJSON(), [{ range: [{ line: 1, character: 1 }, { line: 1, character: 1 }], newText: 'fff' }, { range: [{ line: 0, character: 0 }, { line: 0, character: 0 }], newText: '' }]]
|
||||
]);
|
||||
|
||||
edit.set(b, undefined);
|
||||
edit.set(b, undefined!);
|
||||
assert.ok(!edit.has(b));
|
||||
assert.equal(edit.size, 1);
|
||||
|
||||
@@ -395,17 +395,17 @@ suite('ExtHostTypes', function () {
|
||||
}
|
||||
|
||||
const [first, second, third, fourth] = all;
|
||||
assert.equal(first[0].toString(), 'foo:a');
|
||||
assert.equal(first[0]!.toString(), 'foo:a');
|
||||
assert.ok(!isFileChange(first));
|
||||
assert.ok(isTextChange(first) && first[1].length === 1);
|
||||
|
||||
assert.equal(second[0].toString(), 'foo:a');
|
||||
assert.equal(second[0]!.toString(), 'foo:a');
|
||||
assert.ok(isFileChange(second));
|
||||
|
||||
assert.equal(third[0].toString(), 'foo:a');
|
||||
assert.equal(third[0]!.toString(), 'foo:a');
|
||||
assert.ok(isTextChange(third) && third[1].length === 1);
|
||||
|
||||
assert.equal(fourth[0].toString(), 'foo:b');
|
||||
assert.equal(fourth[0]!.toString(), 'foo:b');
|
||||
assert.ok(!isFileChange(fourth));
|
||||
assert.ok(isTextChange(fourth) && fourth[1].length === 1);
|
||||
});
|
||||
@@ -423,8 +423,8 @@ suite('ExtHostTypes', function () {
|
||||
});
|
||||
|
||||
test('DocumentLink', () => {
|
||||
assert.throws(() => new types.DocumentLink(null, null));
|
||||
assert.throws(() => new types.DocumentLink(new types.Range(1, 1, 1, 1), null));
|
||||
assert.throws(() => new types.DocumentLink(null!, null!));
|
||||
assert.throws(() => new types.DocumentLink(new types.Range(1, 1, 1, 1), null!));
|
||||
});
|
||||
|
||||
test('toJSON & stringify', function () {
|
||||
@@ -532,4 +532,24 @@ suite('ExtHostTypes', function () {
|
||||
assert.ok(error instanceof Error);
|
||||
assert.ok(error instanceof types.FileSystemError);
|
||||
});
|
||||
|
||||
test('CodeActionKind contains', () => {
|
||||
assert.ok(types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.RefactorExtract));
|
||||
assert.ok(types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.RefactorExtract.append('other')));
|
||||
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.Refactor));
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.Refactor.append('other')));
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.Empty.append('other').append('refactor')));
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.contains(types.CodeActionKind.Empty.append('refactory')));
|
||||
});
|
||||
|
||||
test('CodeActionKind intersects', () => {
|
||||
assert.ok(types.CodeActionKind.RefactorExtract.intersects(types.CodeActionKind.RefactorExtract));
|
||||
assert.ok(types.CodeActionKind.RefactorExtract.intersects(types.CodeActionKind.Refactor));
|
||||
assert.ok(types.CodeActionKind.RefactorExtract.intersects(types.CodeActionKind.RefactorExtract.append('other')));
|
||||
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.intersects(types.CodeActionKind.Refactor.append('other')));
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.intersects(types.CodeActionKind.Empty.append('other').append('refactor')));
|
||||
assert.ok(!types.CodeActionKind.RefactorExtract.intersects(types.CodeActionKind.Empty.append('refactory')));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,19 +14,20 @@ import { IExtensionDescription } from 'vs/workbench/services/extensions/common/e
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { Counter } from 'vs/base/common/numbers';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
suite('ExtHostWorkspace', function () {
|
||||
|
||||
const extensionDescriptor: IExtensionDescription = {
|
||||
id: 'nullExtensionDescription',
|
||||
identifier: new ExtensionIdentifier('nullExtensionDescription'),
|
||||
name: 'ext',
|
||||
publisher: 'vscode',
|
||||
enableProposedApi: false,
|
||||
engines: undefined,
|
||||
extensionLocation: undefined,
|
||||
engines: undefined!,
|
||||
extensionLocation: undefined!,
|
||||
isBuiltin: false,
|
||||
isUnderDevelopment: false,
|
||||
version: undefined
|
||||
version: undefined!
|
||||
};
|
||||
|
||||
function assertAsRelativePath(workspace: ExtHostWorkspace, input: string, expected: string, includeWorkspace?: boolean) {
|
||||
@@ -63,7 +64,7 @@ suite('ExtHostWorkspace', function () {
|
||||
});
|
||||
|
||||
test('asRelativePath, no workspace', function () {
|
||||
const ws = new ExtHostWorkspace(new TestRPCProtocol(), null, new NullLogService(), new Counter());
|
||||
const ws = new ExtHostWorkspace(new TestRPCProtocol(), null!, new NullLogService(), new Counter());
|
||||
assertAsRelativePath(ws, (''), '');
|
||||
assertAsRelativePath(ws, ('/foo/bar'), '/foo/bar');
|
||||
});
|
||||
@@ -101,10 +102,10 @@ suite('ExtHostWorkspace', function () {
|
||||
let ws = new ExtHostWorkspace(new TestRPCProtocol(), { id: 'foo', name: 'Test', folders: [] }, new NullLogService(), new Counter());
|
||||
assert.equal(ws.getPath(), undefined);
|
||||
|
||||
ws = new ExtHostWorkspace(new TestRPCProtocol(), null, new NullLogService(), new Counter());
|
||||
ws = new ExtHostWorkspace(new TestRPCProtocol(), null!, new NullLogService(), new Counter());
|
||||
assert.equal(ws.getPath(), undefined);
|
||||
|
||||
ws = new ExtHostWorkspace(new TestRPCProtocol(), undefined, new NullLogService(), new Counter());
|
||||
ws = new ExtHostWorkspace(new TestRPCProtocol(), undefined!, new NullLogService(), new Counter());
|
||||
assert.equal(ws.getPath(), undefined);
|
||||
|
||||
ws = new ExtHostWorkspace(new TestRPCProtocol(), { id: 'foo', name: 'Test', folders: [aWorkspaceFolderData(URI.file('Folder'), 0), aWorkspaceFolderData(URI.file('Another/Folder'), 1)] }, new NullLogService(), new Counter());
|
||||
@@ -259,7 +260,7 @@ suite('ExtHostWorkspace', function () {
|
||||
test('updateWorkspaceFolders - invalid arguments', function () {
|
||||
let ws = new ExtHostWorkspace(new TestRPCProtocol(), { id: 'foo', name: 'Test', folders: [] }, new NullLogService(), new Counter());
|
||||
|
||||
assert.equal(false, ws.updateWorkspaceFolders(extensionDescriptor, null, null));
|
||||
assert.equal(false, ws.updateWorkspaceFolders(extensionDescriptor, null!, null!));
|
||||
assert.equal(false, ws.updateWorkspaceFolders(extensionDescriptor, 0, 0));
|
||||
assert.equal(false, ws.updateWorkspaceFolders(extensionDescriptor, 0, 1));
|
||||
assert.equal(false, ws.updateWorkspaceFolders(extensionDescriptor, 1, 0));
|
||||
@@ -283,9 +284,9 @@ suite('ExtHostWorkspace', function () {
|
||||
};
|
||||
|
||||
const protocol: IMainContext = {
|
||||
getProxy: () => { return undefined; },
|
||||
set: undefined,
|
||||
assertRegistered: undefined
|
||||
getProxy: () => { return undefined!; },
|
||||
set: undefined!,
|
||||
assertRegistered: undefined!
|
||||
};
|
||||
|
||||
const ws = new ExtHostWorkspace(protocol, { id: 'foo', name: 'Test', folders: [] }, new NullLogService(), new Counter());
|
||||
|
||||
@@ -12,7 +12,7 @@ suite('MainThreadCommands', function () {
|
||||
|
||||
test('dispose on unregister', function () {
|
||||
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined);
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined!);
|
||||
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
|
||||
|
||||
// register
|
||||
@@ -26,7 +26,7 @@ suite('MainThreadCommands', function () {
|
||||
|
||||
test('unregister all on dispose', function () {
|
||||
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined);
|
||||
const commands = new MainThreadCommands(SingleProxyRPCProtocol(null), undefined!);
|
||||
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
|
||||
|
||||
commands.$registerCommand('foo');
|
||||
|
||||
@@ -14,9 +14,13 @@ import { MainThreadConfiguration } from 'vs/workbench/api/electron-browser/mainT
|
||||
import { SingleProxyRPCProtocol } from './testRPCProtocol';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { WorkspaceService } from 'vs/workbench/services/configuration/node/configurationService';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
suite('MainThreadConfiguration', function () {
|
||||
|
||||
let proxy = {
|
||||
$initializeConfiguration: () => { }
|
||||
};
|
||||
let instantiationService: TestInstantiationService;
|
||||
let target: sinon.SinonSpy;
|
||||
|
||||
@@ -50,11 +54,14 @@ suite('MainThreadConfiguration', function () {
|
||||
instantiationService.stub(IConfigurationService, 'onDidUpdateConfiguration', sinon.mock());
|
||||
instantiationService.stub(IConfigurationService, 'onDidChangeConfiguration', sinon.mock());
|
||||
instantiationService.stub(IConfigurationService, 'updateValue', target);
|
||||
instantiationService.stub(IEnvironmentService, {
|
||||
isBuilt: false
|
||||
});
|
||||
});
|
||||
|
||||
test('update resource configuration without configuration target defaults to workspace in multi root workspace when no resource is provided', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.resource', 'value', null);
|
||||
|
||||
@@ -63,7 +70,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update resource configuration without configuration target defaults to workspace in folder workspace when resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.resource', 'value', URI.file('abc'));
|
||||
|
||||
@@ -72,7 +79,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update resource configuration without configuration target defaults to workspace in folder workspace when no resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.resource', 'value', null);
|
||||
|
||||
@@ -81,7 +88,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update window configuration without configuration target defaults to workspace in multi root workspace when no resource is provided', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.window', 'value', null);
|
||||
|
||||
@@ -90,7 +97,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update window configuration without configuration target defaults to workspace in multi root workspace when resource is provided', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.window', 'value', URI.file('abc'));
|
||||
|
||||
@@ -99,7 +106,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update window configuration without configuration target defaults to workspace in folder workspace when resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.window', 'value', URI.file('abc'));
|
||||
|
||||
@@ -108,7 +115,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update window configuration without configuration target defaults to workspace in folder workspace when no resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.window', 'value', null);
|
||||
|
||||
@@ -117,7 +124,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update resource configuration without configuration target defaults to folder', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(null, 'extHostConfiguration.resource', 'value', URI.file('abc'));
|
||||
|
||||
@@ -126,7 +133,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update configuration with user configuration target', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(ConfigurationTarget.USER, 'extHostConfiguration.window', 'value', URI.file('abc'));
|
||||
|
||||
@@ -135,7 +142,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update configuration with workspace configuration target', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(ConfigurationTarget.WORKSPACE, 'extHostConfiguration.window', 'value', URI.file('abc'));
|
||||
|
||||
@@ -144,7 +151,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('update configuration with folder configuration target', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$updateConfigurationOption(ConfigurationTarget.WORKSPACE_FOLDER, 'extHostConfiguration.window', 'value', URI.file('abc'));
|
||||
|
||||
@@ -153,7 +160,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove resource configuration without configuration target defaults to workspace in multi root workspace when no resource is provided', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.resource', null);
|
||||
|
||||
@@ -162,7 +169,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove resource configuration without configuration target defaults to workspace in folder workspace when resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.resource', URI.file('abc'));
|
||||
|
||||
@@ -171,7 +178,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove resource configuration without configuration target defaults to workspace in folder workspace when no resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.resource', null);
|
||||
|
||||
@@ -180,7 +187,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove window configuration without configuration target defaults to workspace in multi root workspace when no resource is provided', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.window', null);
|
||||
|
||||
@@ -189,7 +196,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove window configuration without configuration target defaults to workspace in multi root workspace when resource is provided', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.window', URI.file('abc'));
|
||||
|
||||
@@ -198,7 +205,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove window configuration without configuration target defaults to workspace in folder workspace when resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.window', URI.file('abc'));
|
||||
|
||||
@@ -207,7 +214,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove window configuration without configuration target defaults to workspace in folder workspace when no resource is provider', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.FOLDER });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.window', null);
|
||||
|
||||
@@ -216,7 +223,7 @@ suite('MainThreadConfiguration', function () {
|
||||
|
||||
test('remove configuration without configuration target defaults to folder', function () {
|
||||
instantiationService.stub(IWorkspaceContextService, <IWorkspaceContextService>{ getWorkbenchState: () => WorkbenchState.WORKSPACE });
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(null));
|
||||
const testObject: MainThreadConfiguration = instantiationService.createInstance(MainThreadConfiguration, SingleProxyRPCProtocol(proxy));
|
||||
|
||||
testObject.$removeConfigurationOption(null, 'extHostConfiguration.resource', URI.file('abc'));
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ suite('MainThreadDiagnostics', function () {
|
||||
|
||||
test('clear markers on dispose', function () {
|
||||
|
||||
let diag = new MainThreadDiagnostics(null, markerService);
|
||||
let diag = new MainThreadDiagnostics(null!, markerService);
|
||||
|
||||
diag.$changeMany('foo', [[URI.file('a'), [{
|
||||
code: '666',
|
||||
|
||||
@@ -42,7 +42,7 @@ suite('MainThreadDocumentsAndEditors', () => {
|
||||
deltas.length = 0;
|
||||
const configService = new TestConfigurationService();
|
||||
configService.setUserConfiguration('editor', { 'detectIndentation': false });
|
||||
modelService = new ModelServiceImpl(null, configService, new TestTextResourcePropertiesService(configService));
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService));
|
||||
codeEditorService = new TestCodeEditorService();
|
||||
textFileService = new class extends mock<ITextFileService>() {
|
||||
isDirty() { return false; }
|
||||
|
||||
@@ -25,8 +25,8 @@ import { BulkEditService } from 'vs/workbench/services/bulkEdit/electron-browser
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
import { IReference, ImmortalReference } from 'vs/base/common/lifecycle';
|
||||
import { LabelService } from 'vs/platform/label/common/label';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { LabelService } from 'vs/workbench/services/label/common/labelService';
|
||||
|
||||
suite('MainThreadEditors', () => {
|
||||
|
||||
@@ -41,7 +41,7 @@ suite('MainThreadEditors', () => {
|
||||
|
||||
setup(() => {
|
||||
const configService = new TestConfigurationService();
|
||||
modelService = new ModelServiceImpl(null, configService, new TestTextResourcePropertiesService(configService));
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService));
|
||||
const codeEditorService = new TestCodeEditorService();
|
||||
|
||||
movedResources.clear();
|
||||
@@ -54,15 +54,15 @@ suite('MainThreadEditors', () => {
|
||||
isDirty() { return false; }
|
||||
create(uri: URI, contents?: string, options?: any) {
|
||||
createdResources.add(uri);
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
delete(resource: URI) {
|
||||
deletedResources.add(resource);
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
move(source: URI, target: URI) {
|
||||
movedResources.set(source, target);
|
||||
return Promise.resolve(void 0);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
models = <any>{
|
||||
onModelSaved: Event.None,
|
||||
|
||||
@@ -48,25 +48,25 @@ suite('MainThreadSaveParticipant', function () {
|
||||
// No new line for empty lines
|
||||
let lineContent = '';
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), lineContent);
|
||||
|
||||
// No new line if last line already empty
|
||||
lineContent = `Hello New Line${model.textEditorModel.getEOL()}`;
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), lineContent);
|
||||
|
||||
// New empty line added (single line)
|
||||
lineContent = 'Hello New Line';
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), `${lineContent}${model.textEditorModel.getEOL()}`);
|
||||
|
||||
// New empty line added (multi line)
|
||||
lineContent = `Hello New Line${model.textEditorModel.getEOL()}Hello New Line${model.textEditorModel.getEOL()}Hello New Line`;
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), `${lineContent}${model.textEditorModel.getEOL()}`);
|
||||
});
|
||||
|
||||
@@ -83,25 +83,25 @@ suite('MainThreadSaveParticipant', function () {
|
||||
// No new line removal if last line is not new line
|
||||
let lineContent = `${textContent}`;
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), lineContent);
|
||||
|
||||
// No new line removal if last line is single new line
|
||||
lineContent = `${textContent}${eol}`;
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), lineContent);
|
||||
|
||||
// Remove new line (single line with two new lines)
|
||||
lineContent = `${textContent}${eol}${eol}`;
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), `${textContent}${eol}`);
|
||||
|
||||
// Remove new lines (multiple lines with multiple new lines)
|
||||
lineContent = `${textContent}${eol}${textContent}${eol}${eol}${eol}`;
|
||||
model.textEditorModel.setValue(lineContent);
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
assert.equal(snapshotToString(model.createSnapshot()), `${textContent}${eol}${textContent}${eol}`);
|
||||
});
|
||||
|
||||
@@ -127,7 +127,7 @@ suite('MainThreadSaveParticipant', function () {
|
||||
assert.equal(snapshotToString(model.createSnapshot()), `${textContent}`);
|
||||
|
||||
// trim final new lines should not mess the undo stack
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
model.textEditorModel.redo();
|
||||
assert.equal(snapshotToString(model.createSnapshot()), `${textContent}.`);
|
||||
});
|
||||
@@ -146,7 +146,7 @@ suite('MainThreadSaveParticipant', function () {
|
||||
|
||||
// save many times
|
||||
for (let i = 0; i < 10; i++) {
|
||||
participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
}
|
||||
|
||||
// confirm trimming
|
||||
|
||||
@@ -102,7 +102,7 @@ export class TestRPCProtocol implements IExtHostContext {
|
||||
const instance = this._locals[proxyId];
|
||||
// pretend the args went over the wire... (invoke .toJSON on objects...)
|
||||
const wireArgs = simulateWireTransfer(args);
|
||||
let p: Thenable<any>;
|
||||
let p: Promise<any>;
|
||||
try {
|
||||
let result = (<Function>instance[path]).apply(instance, wireArgs);
|
||||
p = isThenable(result) ? result : Promise.resolve(result);
|
||||
|
||||
@@ -3,33 +3,32 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/workbench/parts/search/electron-browser/search.contribution'; // load contributions
|
||||
import * as assert from 'assert';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
|
||||
import { ISearchService } from 'vs/platform/search/common/search';
|
||||
import { ITelemetryService, ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import * as minimist from 'minimist';
|
||||
import * as path from 'path';
|
||||
import { IQuickOpenRegistry, Extensions } from 'vs/workbench/browser/quickopen';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { SearchService } from 'vs/workbench/services/search/node/searchService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { TestEnvironmentService, TestContextService, TestEditorService, TestEditorGroupsService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ISearchService } from 'vs/platform/search/common/search';
|
||||
import { ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { Extensions, IQuickOpenRegistry } from 'vs/workbench/browser/quickopen';
|
||||
import 'vs/workbench/parts/search/electron-browser/search.contribution'; // load contributions
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
|
||||
import { SearchService } from 'vs/workbench/services/search/node/searchService';
|
||||
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { TestContextService, TestEditorGroupsService, TestEditorService, TestEnvironmentService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices';
|
||||
|
||||
namespace Timer {
|
||||
export interface ITimerEvent {
|
||||
@@ -57,7 +56,7 @@ suite.skip('QuickOpen performance (integration)', () => {
|
||||
|
||||
test('Measure', () => {
|
||||
if (process.env['VSCODE_PID']) {
|
||||
return void 0; // TODO@Christoph find out why test fails when run from within VS Code
|
||||
return undefined; // TODO@Christoph find out why test fails when run from within VS Code
|
||||
}
|
||||
|
||||
const n = 3;
|
||||
@@ -73,7 +72,7 @@ suite.skip('QuickOpen performance (integration)', () => {
|
||||
[ITelemetryService, telemetryService],
|
||||
[IConfigurationService, configurationService],
|
||||
[ITextResourcePropertiesService, textResourcePropertiesService],
|
||||
[IModelService, new ModelServiceImpl(null, configurationService, textResourcePropertiesService)],
|
||||
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService)],
|
||||
[IWorkspaceContextService, new TestContextService(testWorkspace(URI.file(testWorkspacePath)))],
|
||||
[IEditorService, new TestEditorService()],
|
||||
[IEditorGroupsService, new TestEditorGroupsService()],
|
||||
@@ -136,9 +135,9 @@ suite.skip('QuickOpen performance (integration)', () => {
|
||||
if (testWorkspaceArg || verboseResults) { // Don't measure by default
|
||||
const cachedEvents: Timer.ITimerEvent[] = [];
|
||||
let i = n;
|
||||
return (function iterate(): TPromise<Timer.ITimerEvent> {
|
||||
return (function iterate(): Promise<Timer.ITimerEvent> {
|
||||
if (!i--) {
|
||||
return undefined;
|
||||
return undefined!;
|
||||
}
|
||||
return measure()
|
||||
.then(([uncachedEvent, cachedEvent]) => {
|
||||
@@ -165,13 +164,13 @@ class TestTelemetryService implements ITelemetryService {
|
||||
|
||||
public events: any[] = [];
|
||||
|
||||
public publicLog(eventName: string, data?: any): TPromise<void> {
|
||||
public publicLog(eventName: string, data?: any): Promise<void> {
|
||||
this.events.push({ name: eventName, data: data });
|
||||
return TPromise.wrap<void>(null);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public getTelemetryInfo(): TPromise<ITelemetryInfo> {
|
||||
return TPromise.as({
|
||||
public getTelemetryInfo(): Promise<ITelemetryInfo> {
|
||||
return Promise.resolve({
|
||||
instanceId: 'someValue.instanceId',
|
||||
sessionId: 'someValue.sessionId',
|
||||
machineId: 'someValue.machineId'
|
||||
|
||||
@@ -29,7 +29,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { SearchModel } from 'vs/workbench/parts/search/common/searchModel';
|
||||
import { QueryBuilder, ITextQueryBuilderOptions } from 'vs/workbench/parts/search/common/queryBuilder';
|
||||
|
||||
import * as event from 'vs/base/common/event';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { NullLogService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
@@ -62,7 +62,7 @@ suite.skip('TextSearch performance (integration)', () => {
|
||||
[ITelemetryService, telemetryService],
|
||||
[IConfigurationService, configurationService],
|
||||
[ITextResourcePropertiesService, textResourcePropertiesService],
|
||||
[IModelService, new ModelServiceImpl(null, configurationService, textResourcePropertiesService)],
|
||||
[IModelService, new ModelServiceImpl(configurationService, textResourcePropertiesService)],
|
||||
[IWorkspaceContextService, new TestContextService(testWorkspace(URI.file(testWorkspacePath)))],
|
||||
[IEditorService, new TestEditorService()],
|
||||
[IEditorGroupsService, new TestEditorGroupsService()],
|
||||
@@ -82,8 +82,8 @@ suite.skip('TextSearch performance (integration)', () => {
|
||||
const query = queryBuilder.text({ pattern: 'static_library(' }, [URI.file(testWorkspacePath)], queryOptions);
|
||||
|
||||
// Wait for the 'searchResultsFinished' event, which is fired after the search() promise is resolved
|
||||
const onSearchResultsFinished = event.filterEvent(telemetryService.eventLogged, e => e.name === 'searchResultsFinished');
|
||||
event.once(onSearchResultsFinished)(onComplete);
|
||||
const onSearchResultsFinished = Event.filter(telemetryService.eventLogged, e => e.name === 'searchResultsFinished');
|
||||
Event.once(onSearchResultsFinished)(onComplete);
|
||||
|
||||
function onComplete(): void {
|
||||
try {
|
||||
@@ -117,7 +117,7 @@ suite.skip('TextSearch performance (integration)', () => {
|
||||
});
|
||||
}
|
||||
|
||||
const finishedEvents = [];
|
||||
const finishedEvents: any[] = [];
|
||||
return runSearch() // Warm-up first
|
||||
.then(() => {
|
||||
if (testWorkspaceArg) { // Don't measure by default
|
||||
@@ -148,9 +148,9 @@ class TestTelemetryService implements ITelemetryService {
|
||||
|
||||
public events: any[] = [];
|
||||
|
||||
private emitter = new event.Emitter<any>();
|
||||
private emitter = new Emitter<any>();
|
||||
|
||||
public get eventLogged(): event.Event<any> {
|
||||
public get eventLogged(): Event<any> {
|
||||
return this.emitter.event;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user