Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8b5d2dd2
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b5d2dd2
编写于
1月 04, 2016
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
don't reuse testing thread service, fixes #1382
上级
73cafb37
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
189 addition
and
180 deletion
+189
-180
src/vs/workbench/test/common/api/extHostApiCommands.test.ts
src/vs/workbench/test/common/api/extHostApiCommands.test.ts
+180
-175
src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts
...workbench/test/common/api/extHostLanguageFeatures.test.ts
+3
-2
src/vs/workbench/test/common/api/testThreadService.ts
src/vs/workbench/test/common/api/testThreadService.ts
+6
-3
未找到文件。
src/vs/workbench/test/common/api/extHostApiCommands.test.ts
浏览文件 @
8b5d2dd2
...
...
@@ -14,7 +14,7 @@ import * as types from 'vs/workbench/api/common/extHostTypes';
import
{
Range
as
CodeEditorRange
}
from
'
vs/editor/common/core/range
'
;
import
*
as
EditorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
Model
as
EditorModel
}
from
'
vs/editor/common/model/model
'
;
import
threadService
from
'
./testThreadService
'
import
{
TestThreadService
}
from
'
./testThreadService
'
import
{
create
as
createInstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
MarkerService
}
from
'
vs/platform/markers/common/markerService
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
...
...
@@ -27,6 +27,7 @@ import {registerApiCommands} from 'vs/workbench/api/common/extHostApiCommands';
import
{
ExtHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostModelService
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
model
:
EditorCommon
.
IModel
=
new
EditorModel
(
[
'
This is the first line
'
,
...
...
@@ -36,6 +37,7 @@ const model: EditorCommon.IModel = new EditorModel(
undefined
,
URI
.
parse
(
'
far://testing/file.b
'
));
let
threadService
:
TestThreadService
;
let
extHost
:
ExtHostLanguageFeatures
;
let
mainThread
:
MainThreadLanguageFeatures
;
let
commands
:
ExtHostCommands
;
...
...
@@ -44,13 +46,20 @@ let originalErrorHandler: (e: any) => any;
suite
(
'
ExtHostLanguageFeatureCommands
'
,
function
()
{
suiteSetup
(()
=>
{
suiteSetup
((
done
)
=>
{
originalErrorHandler
=
errorHandler
.
getUnexpectedErrorHandler
();
setUnexpectedErrorHandler
(()
=>
{
});
let
instantiationService
=
createInstantiationService
();
threadService
.
setInstantiationService
(
instantiationService
);
threadService
=
new
TestThreadService
(
instantiationService
);
instantiationService
.
addSingleton
(
IKeybindingService
,
<
IKeybindingService
>
{
executeCommand
(
id
,
args
):
any
{
let
handler
=
KeybindingsRegistry
.
getCommands
()[
id
];
return
TPromise
.
as
(
instantiationService
.
invokeFunction
(
handler
,
args
));
}
});
instantiationService
.
addSingleton
(
IMarkerService
,
new
MarkerService
(
threadService
));
instantiationService
.
addSingleton
(
IThreadService
,
threadService
);
instantiationService
.
addSingleton
(
IModelService
,
<
IModelService
>
{
...
...
@@ -63,12 +72,6 @@ suite('ExtHostLanguageFeatureCommands', function() {
onModelModeChanged
:
undefined
,
onModelRemoved
:
undefined
});
instantiationService
.
addSingleton
(
IKeybindingService
,
<
IKeybindingService
>
{
executeCommand
(
id
,
args
):
any
{
let
handler
=
KeybindingsRegistry
.
getCommands
()[
id
];
return
TPromise
.
as
(
instantiationService
.
invokeFunction
(
handler
,
args
));
}
})
threadService
.
getRemotable
(
ExtHostModelService
).
_acceptModelAdd
({
isDirty
:
false
,
...
...
@@ -88,6 +91,8 @@ suite('ExtHostLanguageFeatureCommands', function() {
registerApiCommands
(
threadService
);
mainThread
=
threadService
.
getRemotable
(
MainThreadLanguageFeatures
);
extHost
=
threadService
.
getRemotable
(
ExtHostLanguageFeatures
);
threadService
.
sync
().
then
(
done
,
done
)
});
suiteTeardown
(()
=>
{
...
...
@@ -122,38 +127,38 @@ suite('ExtHostLanguageFeatureCommands', function() {
// });
});
// test('WorkspaceSymbols, back and forth', function(done) {
// disposables.push(extHost.registerWorkspaceSymbolProvider(<vscode.WorkspaceSymbolProvider>{
// provideWorkspaceSymbols(query): any {
// return [
// new types.SymbolInformation(query, types.SymbolKind.Array, new types.Range(0, 0, 1, 1), URI.parse('far://testing/first')),
// new types.SymbolInformation(query, types.SymbolKind.Array, new types.Range(0, 0, 1, 1), URI.parse('far://testing/second'))
// ]
// }
// }));
// disposables.push(extHost.registerWorkspaceSymbolProvider(<vscode.WorkspaceSymbolProvider>{
// provideWorkspaceSymbols(query): any {
// return [
// new types.SymbolInformation(query, types.SymbolKind.Array, new types.Range(0, 0, 1, 1), URI.parse('far://testing/first'))
// ]
// }
// }));
test
(
'
WorkspaceSymbols, back and forth
'
,
function
(
done
)
{
// threadService.sync().then(() => {
// commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeWorkspaceSymbolProvider', 'testing').then(value => {
// for (let info of value) {
// assert.ok(info instanceof types.SymbolInformation);
// assert.equal(info.name, 'testing');
// assert.equal(info.kind, types.SymbolKind.Array);
// }
// assert.equal(value.length, 3);
// done();
// });
// });
// });
disposables
.
push
(
extHost
.
registerWorkspaceSymbolProvider
(
<
vscode
.
WorkspaceSymbolProvider
>
{
provideWorkspaceSymbols
(
query
):
any
{
return
[
new
types
.
SymbolInformation
(
query
,
types
.
SymbolKind
.
Array
,
new
types
.
Range
(
0
,
0
,
1
,
1
),
URI
.
parse
(
'
far://testing/first
'
)),
new
types
.
SymbolInformation
(
query
,
types
.
SymbolKind
.
Array
,
new
types
.
Range
(
0
,
0
,
1
,
1
),
URI
.
parse
(
'
far://testing/second
'
))
]
}
}));
disposables
.
push
(
extHost
.
registerWorkspaceSymbolProvider
(
<
vscode
.
WorkspaceSymbolProvider
>
{
provideWorkspaceSymbols
(
query
):
any
{
return
[
new
types
.
SymbolInformation
(
query
,
types
.
SymbolKind
.
Array
,
new
types
.
Range
(
0
,
0
,
1
,
1
),
URI
.
parse
(
'
far://testing/first
'
))
]
}
}));
threadService
.
sync
().
then
(()
=>
{
commands
.
executeCommand
<
vscode
.
SymbolInformation
[]
>
(
'
vscode.executeWorkspaceSymbolProvider
'
,
'
testing
'
).
then
(
value
=>
{
for
(
let
info
of
value
)
{
assert
.
ok
(
info
instanceof
types
.
SymbolInformation
);
assert
.
equal
(
info
.
name
,
'
testing
'
);
assert
.
equal
(
info
.
kind
,
types
.
SymbolKind
.
Array
);
}
assert
.
equal
(
value
.
length
,
3
);
done
();
},
done
);
},
done
);
});
// --- definition
...
...
@@ -175,150 +180,150 @@ suite('ExtHostLanguageFeatureCommands', function() {
// });
});
// test('Definition, back and forth', function(done) {
// disposables.push(extHost.registerDefinitionProvider(defaultSelector, <vscode.DefinitionProvider>{
// provideDefinition(doc: any): any {
// return new types.Location(doc.uri, new types.Range(0, 0, 0, 0));
// }
// }));
// disposables.push(extHost.registerDefinitionProvider(defaultSelector, <vscode.DefinitionProvider>{
// provideDefinition(doc: any): any {
// return [
// new types.Location(doc.uri, new types.Range(0, 0, 0, 0)),
// new types.Location(doc.uri, new types.Range(0, 0, 0, 0)),
// new types.Location(doc.uri, new types.Range(0, 0, 0, 0)),
// ]
// }
// }));
test
(
'
Definition, back and forth
'
,
function
(
done
)
{
// threadService.sync().then(() => {
// commands.executeCommand<vscode.Location[]>('vscode.executeDefinitionProvider', model.getAssociatedResource(), new types.Position(0, 0)).then(values => {
// assert.equal(values.length, 4);
// done();
// });
// });
// });
disposables
.
push
(
extHost
.
registerDefinitionProvider
(
defaultSelector
,
<
vscode
.
DefinitionProvider
>
{
provideDefinition
(
doc
:
any
):
any
{
return
new
types
.
Location
(
doc
.
uri
,
new
types
.
Range
(
0
,
0
,
0
,
0
));
}
}));
disposables
.
push
(
extHost
.
registerDefinitionProvider
(
defaultSelector
,
<
vscode
.
DefinitionProvider
>
{
provideDefinition
(
doc
:
any
):
any
{
return
[
new
types
.
Location
(
doc
.
uri
,
new
types
.
Range
(
0
,
0
,
0
,
0
)),
new
types
.
Location
(
doc
.
uri
,
new
types
.
Range
(
0
,
0
,
0
,
0
)),
new
types
.
Location
(
doc
.
uri
,
new
types
.
Range
(
0
,
0
,
0
,
0
)),
]
}
}));
// --- outline
threadService
.
sync
().
then
(()
=>
{
commands
.
executeCommand
<
vscode
.
Location
[]
>
(
'
vscode.executeDefinitionProvider
'
,
model
.
getAssociatedResource
(),
new
types
.
Position
(
0
,
0
)).
then
(
values
=>
{
assert
.
equal
(
values
.
length
,
4
);
done
();
},
done
);
},
done
);
});
// test('Outline, back and forth', function(done) {
// disposables.push(extHost.registerDocumentSymbolProvider(defaultSelector, <vscode.DocumentSymbolProvider>{
// provideDocumentSymbols(): any {
// return [
// new types.SymbolInformation('testing1', types.SymbolKind.Enum, new types.Range(1, 0, 1, 0)),
// new types.SymbolInformation('testing2', types.SymbolKind.Enum, new types.Range(0, 1, 0, 3)),
// ]
// }
// }));
// --- outline
// threadService.sync().then(() => {
// commands.executeCommand<vscode.SymbolInformation[]>('vscode.executeDocumentSymbolProvider', model.getAssociatedResource()).then(values => {
// assert.equal(values.length, 2);
// let [first, second] = values;
// assert.equal(first.name, 'testing2');
// assert.equal(second.name, 'testing1');
// done();
// });
// });
// });
test
(
'
Outline, back and forth
'
,
function
(
done
)
{
disposables
.
push
(
extHost
.
registerDocumentSymbolProvider
(
defaultSelector
,
<
vscode
.
DocumentSymbolProvider
>
{
provideDocumentSymbols
():
any
{
return
[
new
types
.
SymbolInformation
(
'
testing1
'
,
types
.
SymbolKind
.
Enum
,
new
types
.
Range
(
1
,
0
,
1
,
0
)),
new
types
.
SymbolInformation
(
'
testing2
'
,
types
.
SymbolKind
.
Enum
,
new
types
.
Range
(
0
,
1
,
0
,
3
)),
]
}
}));
threadService
.
sync
().
then
(()
=>
{
commands
.
executeCommand
<
vscode
.
SymbolInformation
[]
>
(
'
vscode.executeDocumentSymbolProvider
'
,
model
.
getAssociatedResource
()).
then
(
values
=>
{
assert
.
equal
(
values
.
length
,
2
);
let
[
first
,
second
]
=
values
;
assert
.
equal
(
first
.
name
,
'
testing2
'
);
assert
.
equal
(
second
.
name
,
'
testing1
'
);
done
();
},
done
);
},
done
);
});
// --- suggest
//
test('Suggest, back and forth', function(done) {
//
disposables.push(extHost.registerCompletionItemProvider(defaultSelector, <vscode.CompletionItemProvider>{
//
provideCompletionItems(doc, pos): any {
//
let a = new types.CompletionItem('item1');
//
let b = new types.CompletionItem('item2');
//
b.textEdit = types.TextEdit.replace(new types.Range(0, 4, 0, 8), 'foo'); // overwite after
//
let c = new types.CompletionItem('item3');
//
c.textEdit = types.TextEdit.replace(new types.Range(0, 1, 0, 6), 'foobar'); // overwite before & after
//
let d = new types.CompletionItem('item4');
//
d.textEdit = types.TextEdit.replace(new types.Range(0, 1, 0, 4), ''); // overwite before
//
return [a, b, c, d];
//
}
//
}, []));
//
threadService.sync().then(() => {
//
commands.executeCommand<vscode.CompletionItem[]>('vscode.executeCompletionItemProvider', model.getAssociatedResource(), new types.Position(0, 4)).then(values => {
//
try {
//
assert.equal(values.length, 4);
//
let [first, second, third, forth] = values;
//
assert.equal(first.label, 'item1');
//
assert.equal(first.textEdit.newText, 'item1');
//
assert.equal(first.textEdit.range.start.line, 0);
//
assert.equal(first.textEdit.range.start.character, 0);
//
assert.equal(first.textEdit.range.end.line, 0);
//
assert.equal(first.textEdit.range.end.character, 4);
//
assert.equal(second.label, 'item2');
//
assert.equal(second.textEdit.newText, 'foo');
//
assert.equal(second.textEdit.range.start.line, 0);
//
assert.equal(second.textEdit.range.start.character, 4);
//
assert.equal(second.textEdit.range.end.line, 0);
//
assert.equal(second.textEdit.range.end.character, 8);
//
assert.equal(third.label, 'item3');
//
assert.equal(third.textEdit.newText, 'foobar');
//
assert.equal(third.textEdit.range.start.line, 0);
//
assert.equal(third.textEdit.range.start.character, 1);
//
assert.equal(third.textEdit.range.end.line, 0);
//
assert.equal(third.textEdit.range.end.character, 6);
//
assert.equal(forth.label, 'item4');
//
assert.equal(forth.textEdit.newText, '');
//
assert.equal(forth.textEdit.range.start.line, 0);
//
assert.equal(forth.textEdit.range.start.character, 1);
//
assert.equal(forth.textEdit.range.end.line, 0);
//
assert.equal(forth.textEdit.range.end.character, 4);
//
done();
//
} catch (e) {
//
done(e);
//
}
// }
);
// }
);
//
});
test
(
'
Suggest, back and forth
'
,
function
(
done
)
{
disposables
.
push
(
extHost
.
registerCompletionItemProvider
(
defaultSelector
,
<
vscode
.
CompletionItemProvider
>
{
provideCompletionItems
(
doc
,
pos
):
any
{
let
a
=
new
types
.
CompletionItem
(
'
item1
'
);
let
b
=
new
types
.
CompletionItem
(
'
item2
'
);
b
.
textEdit
=
types
.
TextEdit
.
replace
(
new
types
.
Range
(
0
,
4
,
0
,
8
),
'
foo
'
);
// overwite after
let
c
=
new
types
.
CompletionItem
(
'
item3
'
);
c
.
textEdit
=
types
.
TextEdit
.
replace
(
new
types
.
Range
(
0
,
1
,
0
,
6
),
'
foobar
'
);
// overwite before & after
let
d
=
new
types
.
CompletionItem
(
'
item4
'
);
d
.
textEdit
=
types
.
TextEdit
.
replace
(
new
types
.
Range
(
0
,
1
,
0
,
4
),
''
);
// overwite before
return
[
a
,
b
,
c
,
d
];
}
},
[]));
threadService
.
sync
().
then
(()
=>
{
commands
.
executeCommand
<
vscode
.
CompletionItem
[]
>
(
'
vscode.executeCompletionItemProvider
'
,
model
.
getAssociatedResource
(),
new
types
.
Position
(
0
,
4
)).
then
(
values
=>
{
try
{
assert
.
equal
(
values
.
length
,
4
);
let
[
first
,
second
,
third
,
forth
]
=
values
;
assert
.
equal
(
first
.
label
,
'
item1
'
);
assert
.
equal
(
first
.
textEdit
.
newText
,
'
item1
'
);
assert
.
equal
(
first
.
textEdit
.
range
.
start
.
line
,
0
);
assert
.
equal
(
first
.
textEdit
.
range
.
start
.
character
,
0
);
assert
.
equal
(
first
.
textEdit
.
range
.
end
.
line
,
0
);
assert
.
equal
(
first
.
textEdit
.
range
.
end
.
character
,
4
);
assert
.
equal
(
second
.
label
,
'
item2
'
);
assert
.
equal
(
second
.
textEdit
.
newText
,
'
foo
'
);
assert
.
equal
(
second
.
textEdit
.
range
.
start
.
line
,
0
);
assert
.
equal
(
second
.
textEdit
.
range
.
start
.
character
,
4
);
assert
.
equal
(
second
.
textEdit
.
range
.
end
.
line
,
0
);
assert
.
equal
(
second
.
textEdit
.
range
.
end
.
character
,
8
);
assert
.
equal
(
third
.
label
,
'
item3
'
);
assert
.
equal
(
third
.
textEdit
.
newText
,
'
foobar
'
);
assert
.
equal
(
third
.
textEdit
.
range
.
start
.
line
,
0
);
assert
.
equal
(
third
.
textEdit
.
range
.
start
.
character
,
1
);
assert
.
equal
(
third
.
textEdit
.
range
.
end
.
line
,
0
);
assert
.
equal
(
third
.
textEdit
.
range
.
end
.
character
,
6
);
assert
.
equal
(
forth
.
label
,
'
item4
'
);
assert
.
equal
(
forth
.
textEdit
.
newText
,
''
);
assert
.
equal
(
forth
.
textEdit
.
range
.
start
.
line
,
0
);
assert
.
equal
(
forth
.
textEdit
.
range
.
start
.
character
,
1
);
assert
.
equal
(
forth
.
textEdit
.
range
.
end
.
line
,
0
);
assert
.
equal
(
forth
.
textEdit
.
range
.
end
.
character
,
4
);
done
();
}
catch
(
e
)
{
done
(
e
);
}
},
done
);
},
done
);
});
// --- quickfix
//
test('QuickFix, back and forth', function(done) {
//
disposables.push(extHost.registerCodeActionProvider(defaultSelector, <vscode.CodeActionProvider>{
//
provideCodeActions(): any {
//
return [{ command: 'testing', title: 'Title', arguments: [1, 2, true] }];
//
}
//
}));
//
threadService.sync().then(() => {
//
commands.executeCommand<vscode.Command[]>('vscode.executeCodeActionProvider', model.getAssociatedResource(), new types.Range(0, 0, 1, 1)).then(value => {
//
assert.equal(value.length, 1);
//
let [first] = value;
//
assert.equal(first.title, 'Title');
//
assert.equal(first.command, 'testing');
//
assert.deepEqual(first.arguments, [1, 2, true]);
//
done();
// }
);
//
});
//
});
test
(
'
QuickFix, back and forth
'
,
function
(
done
)
{
disposables
.
push
(
extHost
.
registerCodeActionProvider
(
defaultSelector
,
<
vscode
.
CodeActionProvider
>
{
provideCodeActions
():
any
{
return
[{
command
:
'
testing
'
,
title
:
'
Title
'
,
arguments
:
[
1
,
2
,
true
]
}];
}
}));
threadService
.
sync
().
then
(()
=>
{
commands
.
executeCommand
<
vscode
.
Command
[]
>
(
'
vscode.executeCodeActionProvider
'
,
model
.
getAssociatedResource
(),
new
types
.
Range
(
0
,
0
,
1
,
1
)).
then
(
value
=>
{
assert
.
equal
(
value
.
length
,
1
);
let
[
first
]
=
value
;
assert
.
equal
(
first
.
title
,
'
Title
'
);
assert
.
equal
(
first
.
command
,
'
testing
'
);
assert
.
deepEqual
(
first
.
arguments
,
[
1
,
2
,
true
]);
done
();
},
done
);
});
});
// --- code lens
//
test('CodeLens, back and forth', function(done) {
//
disposables.push(extHost.registerCodeLensProvider(defaultSelector, <vscode.CodeLensProvider>{
//
provideCodeLenses(): any {
//
return [new types.CodeLens(new types.Range(0, 0, 1, 1), { title: 'Title', command: 'cmd', arguments: [1, 2, true] })];
//
}
//
}));
test
(
'
CodeLens, back and forth
'
,
function
(
done
)
{
disposables
.
push
(
extHost
.
registerCodeLensProvider
(
defaultSelector
,
<
vscode
.
CodeLensProvider
>
{
provideCodeLenses
():
any
{
return
[
new
types
.
CodeLens
(
new
types
.
Range
(
0
,
0
,
1
,
1
),
{
title
:
'
Title
'
,
command
:
'
cmd
'
,
arguments
:
[
1
,
2
,
true
]
})];
}
}));
//
threadService.sync().then(() => {
//
commands.executeCommand<vscode.CodeLens[]>('vscode.executeCodeLensProvider', model.getAssociatedResource()).then(value => {
//
assert.equal(value.length, 1);
//
let [first] = value;
//
assert.equal(first.command.title, 'Title');
//
assert.equal(first.command.command, 'cmd');
//
assert.deepEqual(first.command.arguments, [1, 2, true]);
//
done();
// }
);
//
});
//
});
threadService
.
sync
().
then
(()
=>
{
commands
.
executeCommand
<
vscode
.
CodeLens
[]
>
(
'
vscode.executeCodeLensProvider
'
,
model
.
getAssociatedResource
()).
then
(
value
=>
{
assert
.
equal
(
value
.
length
,
1
);
let
[
first
]
=
value
;
assert
.
equal
(
first
.
command
.
title
,
'
Title
'
);
assert
.
equal
(
first
.
command
.
command
,
'
cmd
'
);
assert
.
deepEqual
(
first
.
command
.
arguments
,
[
1
,
2
,
true
]);
done
();
},
done
);
});
});
});
src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts
浏览文件 @
8b5d2dd2
...
...
@@ -13,7 +13,7 @@ import * as types from 'vs/workbench/api/common/extHostTypes';
import
{
Range
as
CodeEditorRange
}
from
'
vs/editor/common/core/range
'
;
import
*
as
EditorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
Model
as
EditorModel
}
from
'
vs/editor/common/model/model
'
;
import
threadService
from
'
./testThreadService
'
import
{
TestThreadService
}
from
'
./testThreadService
'
import
{
create
as
createInstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
MarkerService
}
from
'
vs/platform/markers/common/markerService
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
...
...
@@ -47,6 +47,7 @@ const model: EditorCommon.IModel = new EditorModel(
let
extHost
:
ExtHostLanguageFeatures
;
let
mainThread
:
MainThreadLanguageFeatures
;
let
disposables
:
vscode
.
Disposable
[]
=
[];
let
threadService
:
TestThreadService
;
let
originalErrorHandler
:
(
e
:
any
)
=>
any
;
suite
(
'
ExtHostLanguageFeatures
'
,
function
()
{
...
...
@@ -54,7 +55,7 @@ suite('ExtHostLanguageFeatures', function() {
suiteSetup
(()
=>
{
let
instantiationService
=
createInstantiationService
();
threadService
.
setInstantiation
Service
(
instantiationService
);
threadService
=
new
TestThread
Service
(
instantiationService
);
instantiationService
.
addSingleton
(
IMarkerService
,
new
MarkerService
(
threadService
));
instantiationService
.
addSingleton
(
IThreadService
,
threadService
);
...
...
src/vs/workbench/test/common/api/testThreadService.ts
浏览文件 @
8b5d2dd2
...
...
@@ -7,10 +7,16 @@
import
{
NullThreadService
}
from
'
vs/platform/test/common/nullThreadService
'
;
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
export
class
TestThreadService
extends
NullThreadService
{
constructor
(
instantiationService
:
IInstantiationService
)
{
super
();
this
.
setInstantiationService
(
instantiationService
);
}
private
_callCountValue
:
number
=
0
;
private
_idle
:
TPromise
<
any
>
;
private
_completeIdle
:
Function
;
...
...
@@ -90,6 +96,3 @@ export class TestThreadService extends NullThreadService {
return
this
.
_getOrCreateLocalInstance
(
id
,
descriptor
);
}
}
const
Instance
=
new
TestThreadService
();
export
default
Instance
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录