Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3ae2793a
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,发现更多精彩内容 >>
提交
3ae2793a
编写于
12月 22, 2015
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tslint
上级
fdb1ceed
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
42 deletion
+26
-42
src/vs/workbench/test/common/api/extHostApiCommands.test.ts
src/vs/workbench/test/common/api/extHostApiCommands.test.ts
+17
-29
src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts
...workbench/test/common/api/extHostLanguageFeatures.test.ts
+9
-13
未找到文件。
src/vs/workbench/test/common/api/extHostApiCommands.test.ts
浏览文件 @
3ae2793a
...
@@ -26,18 +26,6 @@ import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/
...
@@ -26,18 +26,6 @@ import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/
import
{
ExtHostApiCommands
}
from
'
vs/workbench/api/common/extHostApiCommands
'
;
import
{
ExtHostApiCommands
}
from
'
vs/workbench/api/common/extHostApiCommands
'
;
import
{
ExtHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostModelService
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
import
{
ExtHostModelService
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
LanguageSelector
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
OutlineRegistry
,
getOutlineEntries
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
CodeLensRegistry
,
getCodeLensData
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
import
{
DeclarationRegistry
,
getDeclarationsAtPosition
}
from
'
vs/editor/contrib/goToDeclaration/common/goToDeclaration
'
;
import
{
ExtraInfoRegistry
,
getExtraInfoAtPosition
}
from
'
vs/editor/contrib/hover/common/hover
'
;
import
{
OccurrencesRegistry
,
getOccurrencesAtPosition
}
from
'
vs/editor/contrib/wordHighlighter/common/wordHighlighter
'
;
import
{
ReferenceRegistry
,
findReferences
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
getQuickFixes
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
getNavigateToItems
}
from
'
vs/workbench/parts/search/common/search
'
;
import
{
rename
}
from
'
vs/editor/contrib/rename/common/rename
'
;
import
{
getParameterHints
}
from
'
vs/editor/contrib/parameterHints/common/parameterHints
'
;
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
model
:
EditorCommon
.
IModel
=
new
EditorModel
(
const
model
:
EditorCommon
.
IModel
=
new
EditorModel
(
...
@@ -66,18 +54,18 @@ suite('ExtHostLanguageFeatureCommands', function() {
...
@@ -66,18 +54,18 @@ suite('ExtHostLanguageFeatureCommands', function() {
threadService
.
setInstantiationService
(
instantiationService
);
threadService
.
setInstantiationService
(
instantiationService
);
instantiationService
.
addSingleton
(
IMarkerService
,
new
MarkerService
(
threadService
));
instantiationService
.
addSingleton
(
IMarkerService
,
new
MarkerService
(
threadService
));
instantiationService
.
addSingleton
(
IThreadService
,
threadService
);
instantiationService
.
addSingleton
(
IThreadService
,
threadService
);
instantiationService
.
addSingleton
(
IModelService
,
<
IModelService
>
{
instantiationService
.
addSingleton
(
IModelService
,
<
IModelService
>
{
serviceId
:
IModelService
,
serviceId
:
IModelService
,
getModel
():
any
{
return
model
;
},
getModel
():
any
{
return
model
;
},
createModel
():
any
{
throw
new
Error
();
},
createModel
():
any
{
throw
new
Error
();
},
destroyModel
():
any
{
throw
new
Error
();
},
destroyModel
():
any
{
throw
new
Error
();
},
getModels
():
any
{
throw
new
Error
();
},
getModels
():
any
{
throw
new
Error
();
},
onModelAdded
:
undefined
,
onModelAdded
:
undefined
,
onModelModeChanged
:
undefined
,
onModelModeChanged
:
undefined
,
onModelRemoved
:
undefined
onModelRemoved
:
undefined
});
});
instantiationService
.
addSingleton
(
IKeybindingService
,
<
IKeybindingService
>
{
instantiationService
.
addSingleton
(
IKeybindingService
,
<
IKeybindingService
>
{
executeCommand
(
id
,
args
):
any
{
executeCommand
(
id
,
args
):
any
{
let
handler
=
KeybindingsRegistry
.
getCommands
()[
id
];
let
handler
=
KeybindingsRegistry
.
getCommands
()[
id
];
return
TPromise
.
as
(
instantiationService
.
invokeFunction
(
handler
,
args
));
return
TPromise
.
as
(
instantiationService
.
invokeFunction
(
handler
,
args
));
}
}
...
@@ -127,11 +115,11 @@ suite('ExtHostLanguageFeatureCommands', function() {
...
@@ -127,11 +115,11 @@ suite('ExtHostLanguageFeatureCommands', function() {
];
];
// threadService.sync().then(() => {
// threadService.sync().then(() => {
TPromise
.
join
(
<
any
[]
>
promises
).
then
(
undefined
,
(
err
:
any
[])
=>
{
TPromise
.
join
(
<
any
[]
>
promises
).
then
(
undefined
,
(
err
:
any
[])
=>
{
assert
.
equal
(
err
.
length
,
4
);
assert
.
equal
(
err
.
length
,
4
);
done
();
done
();
return
[];
return
[];
});
});
// });
// });
});
});
...
@@ -180,11 +168,11 @@ suite('ExtHostLanguageFeatureCommands', function() {
...
@@ -180,11 +168,11 @@ suite('ExtHostLanguageFeatureCommands', function() {
];
];
// threadService.sync().then(() => {
// threadService.sync().then(() => {
TPromise
.
join
(
<
any
[]
>
promises
).
then
(
undefined
,
(
err
:
any
[])
=>
{
TPromise
.
join
(
<
any
[]
>
promises
).
then
(
undefined
,
(
err
:
any
[])
=>
{
assert
.
equal
(
err
.
length
,
4
);
assert
.
equal
(
err
.
length
,
4
);
done
();
done
();
return
[];
return
[];
});
});
// });
// });
});
});
...
@@ -334,4 +322,4 @@ suite('ExtHostLanguageFeatureCommands', function() {
...
@@ -334,4 +322,4 @@ suite('ExtHostLanguageFeatureCommands', function() {
});
});
});
});
});
});
});
});
\ No newline at end of file
src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts
浏览文件 @
3ae2793a
...
@@ -9,8 +9,6 @@ import * as assert from 'assert';
...
@@ -9,8 +9,6 @@ import * as assert from 'assert';
import
{
setUnexpectedErrorHandler
,
errorHandler
}
from
'
vs/base/common/errors
'
;
import
{
setUnexpectedErrorHandler
,
errorHandler
}
from
'
vs/base/common/errors
'
;
import
{
create
}
from
'
vs/base/common/types
'
;
import
{
create
}
from
'
vs/base/common/types
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtHostDocument
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
import
*
as
types
from
'
vs/workbench/api/common/extHostTypes
'
;
import
*
as
types
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
Range
as
CodeEditorRange
}
from
'
vs/editor/common/core/range
'
;
import
{
Range
as
CodeEditorRange
}
from
'
vs/editor/common/core/range
'
;
import
*
as
EditorCommon
from
'
vs/editor/common/editorCommon
'
;
import
*
as
EditorCommon
from
'
vs/editor/common/editorCommon
'
;
...
@@ -23,14 +21,12 @@ import {IThreadService} from 'vs/platform/thread/common/thread';
...
@@ -23,14 +21,12 @@ import {IThreadService} from 'vs/platform/thread/common/thread';
import
{
ExtHostLanguageFeatures
,
MainThreadLanguageFeatures
}
from
'
vs/workbench/api/common/extHostLanguageFeatures
'
;
import
{
ExtHostLanguageFeatures
,
MainThreadLanguageFeatures
}
from
'
vs/workbench/api/common/extHostLanguageFeatures
'
;
import
{
ExtHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostCommands
,
MainThreadCommands
}
from
'
vs/workbench/api/common/extHostCommands
'
;
import
{
ExtHostModelService
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
import
{
ExtHostModelService
}
from
'
vs/workbench/api/common/extHostDocuments
'
;
import
{
SyncDescriptor0
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
LanguageSelector
}
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
OutlineRegistry
,
getOutlineEntries
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
OutlineRegistry
,
getOutlineEntries
}
from
'
vs/editor/contrib/quickOpen/common/quickOpen
'
;
import
{
CodeLensRegistry
,
getCodeLensData
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
import
{
getCodeLensData
}
from
'
vs/editor/contrib/codelens/common/codelens
'
;
import
{
DeclarationRegistry
,
getDeclarationsAtPosition
}
from
'
vs/editor/contrib/goToDeclaration/common/goToDeclaration
'
;
import
{
getDeclarationsAtPosition
}
from
'
vs/editor/contrib/goToDeclaration/common/goToDeclaration
'
;
import
{
ExtraInfoRegistry
,
getExtraInfoAtPosition
}
from
'
vs/editor/contrib/hover/common/hover
'
;
import
{
getExtraInfoAtPosition
}
from
'
vs/editor/contrib/hover/common/hover
'
;
import
{
OccurrencesRegistry
,
getOccurrencesAtPosition
}
from
'
vs/editor/contrib/wordHighlighter/common/wordHighlighter
'
;
import
{
getOccurrencesAtPosition
}
from
'
vs/editor/contrib/wordHighlighter/common/wordHighlighter
'
;
import
{
ReferenceRegistry
,
findReferences
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
findReferences
}
from
'
vs/editor/contrib/referenceSearch/common/referenceSearch
'
;
import
{
getQuickFixes
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
getQuickFixes
}
from
'
vs/editor/contrib/quickFix/common/quickFix
'
;
import
{
getNavigateToItems
}
from
'
vs/workbench/parts/search/common/search
'
;
import
{
getNavigateToItems
}
from
'
vs/workbench/parts/search/common/search
'
;
import
{
rename
}
from
'
vs/editor/contrib/rename/common/rename
'
;
import
{
rename
}
from
'
vs/editor/contrib/rename/common/rename
'
;
...
@@ -168,7 +164,7 @@ suite('ExtHostLanguageFeatures', function() {
...
@@ -168,7 +164,7 @@ suite('ExtHostLanguageFeatures', function() {
test
(
'
CodeLens, evil provider
'
,
function
(
done
)
{
test
(
'
CodeLens, evil provider
'
,
function
(
done
)
{
disposables
.
push
(
extHost
.
registerCodeLensProvider
(
defaultSelector
,
<
vscode
.
CodeLensProvider
>
{
disposables
.
push
(
extHost
.
registerCodeLensProvider
(
defaultSelector
,
<
vscode
.
CodeLensProvider
>
{
provideCodeLenses
():
any
{
provideCodeLenses
():
any
{
throw
new
Error
(
'
evil
'
)
throw
new
Error
(
'
evil
'
)
}
}
}));
}));
...
@@ -189,12 +185,12 @@ suite('ExtHostLanguageFeatures', function() {
...
@@ -189,12 +185,12 @@ suite('ExtHostLanguageFeatures', function() {
test
(
'
CodeLens, do not resolve a resolved lens
'
,
function
(
done
)
{
test
(
'
CodeLens, do not resolve a resolved lens
'
,
function
(
done
)
{
disposables
.
push
(
extHost
.
registerCodeLensProvider
(
defaultSelector
,
<
vscode
.
CodeLensProvider
>
{
disposables
.
push
(
extHost
.
registerCodeLensProvider
(
defaultSelector
,
<
vscode
.
CodeLensProvider
>
{
provideCodeLenses
():
any
{
provideCodeLenses
():
any
{
return
[
new
types
.
CodeLens
(
return
[
new
types
.
CodeLens
(
new
types
.
Range
(
0
,
0
,
0
,
0
),
new
types
.
Range
(
0
,
0
,
0
,
0
),
{
command
:
'
id
'
,
title
:
'
Title
'
})];
{
command
:
'
id
'
,
title
:
'
Title
'
})];
},
},
resolveCodeLens
():
any
{
resolveCodeLens
():
any
{
assert
.
ok
(
false
,
'
do not resolve
'
);
assert
.
ok
(
false
,
'
do not resolve
'
);
}
}
}));
}));
...
@@ -1010,4 +1006,4 @@ suite('ExtHostLanguageFeatures', function() {
...
@@ -1010,4 +1006,4 @@ suite('ExtHostLanguageFeatures', function() {
});
});
});
});
});
});
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录