提交 f5169146 编写于 作者: J Johannes Rieken

trying to fix #1382

上级 3ae2793a
......@@ -123,7 +123,7 @@ suite('ExtHostLanguageFeatureCommands', function() {
// });
});
test('WorkspaceSymbols, back and forth', function(done) {
test('WorkspaceSymbols, back and forth', function(done) {
disposables.push(extHost.registerWorkspaceSymbolProvider(<vscode.WorkspaceSymbolProvider>{
provideWorkspaceSymbols(query): any {
......@@ -176,7 +176,7 @@ suite('ExtHostLanguageFeatureCommands', function() {
// });
});
test('Definition, back and forth', function(done) {
test('Definition, back and forth', function(done) {
disposables.push(extHost.registerDefinitionProvider(defaultSelector, <vscode.DefinitionProvider>{
provideDefinition(doc: any): any {
......
......@@ -6,10 +6,8 @@
'use strict';
import {NullThreadService} from 'vs/platform/test/common/nullThreadService';
import {create} from 'vs/base/common/types';
import {SyncDescriptor0} from 'vs/platform/instantiation/common/descriptors';
import {TPromise} from 'vs/base/common/winjs.base';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
export class TestThreadService extends NullThreadService {
......@@ -21,10 +19,12 @@ export class TestThreadService extends NullThreadService {
return this._callCountValue;
}
private set _callCount(value:number) {
private set _callCount(value: number) {
this._callCountValue = value;
if (this._callCountValue === 0) {
this._completeIdle && this._completeIdle();
if (this._completeIdle) {
this._completeIdle();
}
this._idle = undefined;
}
}
......@@ -49,18 +49,19 @@ export class TestThreadService extends NullThreadService {
protected _registerAndInstantiateMainProcessActor<T>(id: string, descriptor: SyncDescriptor0<T>): T {
let _calls:{path: string; args: any[] }[] = [];
let _calls: {path: string; args: any[] }[] = [];
let _instance: any;
return this._getOrCreateProxyInstance({
callOnRemote: (proxyId: string, path: string, args: any[]): TPromise<any> => {
this._callCount++;
_calls.push({path, args});
return TPromise.timeout(0).then(() => {
return new TPromise<any>((c) => {
setTimeout(c, 0);
}).then(() => {
if (!_instance) {
_instance = this._instantiationService.createInstance(descriptor.ctor);
}
......@@ -91,4 +92,4 @@ export class TestThreadService extends NullThreadService {
}
const Instance = new TestThreadService();
export default Instance;
\ No newline at end of file
export default Instance;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册