Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8639e21b
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,发现更多精彩内容 >>
提交
8639e21b
编写于
11月 07, 2017
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove some unneeded <any> casts
上级
bc347c43
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
31 addition
and
31 deletion
+31
-31
src/vs/base/common/objects.ts
src/vs/base/common/objects.ts
+3
-3
src/vs/base/test/node/glob.test.ts
src/vs/base/test/node/glob.test.ts
+1
-1
src/vs/editor/common/services/webWorker.ts
src/vs/editor/common/services/webWorker.ts
+1
-1
src/vs/editor/contrib/find/test/common/findController.test.ts
...vs/editor/contrib/find/test/common/findController.test.ts
+4
-4
src/vs/editor/contrib/format/browser/formatActions.ts
src/vs/editor/contrib/format/browser/formatActions.ts
+2
-2
src/vs/editor/contrib/multicursor/test/common/multicursor.test.ts
...ditor/contrib/multicursor/test/common/multicursor.test.ts
+2
-2
src/vs/editor/test/common/core/editorState.test.ts
src/vs/editor/test/common/core/editorState.test.ts
+2
-2
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+1
-1
src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts
...s/terminal/test/electron-browser/terminalInstance.test.ts
+3
-3
src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts
...welcome/gettingStarted/test/common/gettingStarted.test.ts
+2
-2
src/vs/workbench/services/progress/test/progressService.test.ts
.../workbench/services/progress/test/progressService.test.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts
.../test/electron-browser/api/extHostMessagerService.test.ts
+9
-9
未找到文件。
src/vs/base/common/objects.ts
浏览文件 @
8639e21b
...
...
@@ -15,7 +15,7 @@ export function clone<T>(obj: T): T {
// See https://github.com/Microsoft/TypeScript/issues/10990
return
obj
as
any
;
}
const
result
=
(
Array
.
isArray
(
obj
))
?
<
any
>
[]
:
<
any
>
{};
const
result
:
any
=
Array
.
isArray
(
obj
)
?
[]
:
{};
Object
.
keys
(
obj
).
forEach
((
key
:
keyof
T
)
=>
{
if
(
obj
[
key
]
&&
typeof
obj
[
key
]
===
'
object
'
)
{
result
[
key
]
=
clone
(
obj
[
key
]);
...
...
@@ -30,7 +30,7 @@ export function deepClone<T>(obj: T): T {
if
(
!
obj
||
typeof
obj
!==
'
object
'
)
{
return
obj
;
}
const
result
=
(
Array
.
isArray
(
obj
))
?
<
any
>
[]
:
<
any
>
{};
const
result
:
any
=
Array
.
isArray
(
obj
)
?
[]
:
{};
Object
.
getOwnPropertyNames
(
obj
).
forEach
((
key
:
keyof
T
)
=>
{
if
(
obj
[
key
]
&&
typeof
obj
[
key
]
===
'
object
'
)
{
result
[
key
]
=
deepClone
(
obj
[
key
]);
...
...
@@ -231,7 +231,7 @@ export function derive(baseClass: any, derivedClass: any): void {
}
// Cast to any due to Bug 16188:PropertyDescriptor set and get function should be optional.
Object
.
defineProperty
(
derivedClass
.
prototype
,
'
constructor
'
,
<
any
>
{
value
:
derivedClass
,
writable
:
true
,
configurable
:
true
,
enumerable
:
true
});
Object
.
defineProperty
(
derivedClass
.
prototype
,
'
constructor
'
,
{
value
:
derivedClass
,
writable
:
true
,
configurable
:
true
,
enumerable
:
true
});
}
/**
...
...
src/vs/base/test/node/glob.test.ts
浏览文件 @
8639e21b
...
...
@@ -416,7 +416,7 @@ suite('Glob', () => {
assert
.
strictEqual
(
glob
.
match
(
expression
,
'
test.js
'
,
()
=>
siblings
),
null
);
expression
=
<
any
>
{
expression
=
{
'
**/*.js
'
:
{
}
};
...
...
src/vs/editor/common/services/webWorker.ts
浏览文件 @
8639e21b
...
...
@@ -84,7 +84,7 @@ class MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWork
};
};
let
foreignProxy
=
<
T
><
any
>
{}
;
let
foreignProxy
=
{}
as
T
;
for
(
let
i
=
0
;
i
<
foreignMethods
.
length
;
i
++
)
{
foreignProxy
[
foreignMethods
[
i
]]
=
createProxyMethod
(
foreignMethods
[
i
],
proxyMethodRequest
);
}
...
...
src/vs/editor/contrib/find/test/common/findController.test.ts
浏览文件 @
8639e21b
...
...
@@ -71,11 +71,11 @@ function fromRange(rng: Range): number[] {
suite
(
'
FindController
'
,
()
=>
{
let
queryState
:
{
[
key
:
string
]:
any
;
}
=
{};
let
serviceCollection
=
new
ServiceCollection
();
serviceCollection
.
set
(
IStorageService
,
<
any
>
{
serviceCollection
.
set
(
IStorageService
,
{
get
:
(
key
:
string
)
=>
queryState
[
key
],
getBoolean
:
(
key
:
string
)
=>
!!
queryState
[
key
],
store
:
(
key
:
string
,
value
:
any
)
=>
{
queryState
[
key
]
=
value
;
}
});
}
as
IStorageService
);
test
(
'
issue #1857: F3, Find Next, acts like "Find Under Cursor"
'
,
()
=>
{
withMockCodeEditor
([
...
...
@@ -392,11 +392,11 @@ suite('FindController query options persistence', () => {
queryState
[
'
editor.matchCase
'
]
=
false
;
queryState
[
'
editor.wholeWord
'
]
=
false
;
let
serviceCollection
=
new
ServiceCollection
();
serviceCollection
.
set
(
IStorageService
,
<
any
>
{
serviceCollection
.
set
(
IStorageService
,
{
get
:
(
key
:
string
)
=>
queryState
[
key
],
getBoolean
:
(
key
:
string
)
=>
!!
queryState
[
key
],
store
:
(
key
:
string
,
value
:
any
)
=>
{
queryState
[
key
]
=
value
;
}
});
}
as
IStorageService
);
test
(
'
matchCase
'
,
()
=>
{
withMockCodeEditor
([
...
...
src/vs/editor/contrib/format/browser/formatActions.ts
浏览文件 @
8639e21b
...
...
@@ -11,7 +11,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
editorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
editorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
,
IActionOptions
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
OnTypeFormattingEditProviderRegistry
,
DocumentRangeFormattingEditProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
getOnTypeFormattingEdits
,
getDocumentFormattingEdits
,
getDocumentRangeFormattingEdits
,
NoProviderError
}
from
'
../common/format
'
;
import
{
EditOperationsCommand
}
from
'
../common/formatCommand
'
;
...
...
@@ -366,7 +366,7 @@ CommandsRegistry.registerCommand('editor.action.format', accessor => {
if
(
editor
)
{
return
new
class
extends
AbstractFormatAction
{
constructor
()
{
super
(
<
any
>
{}
);
super
(
{}
as
IActionOptions
);
}
_getFormattingEdits
(
editor
:
editorCommon
.
ICommonCodeEditor
):
TPromise
<
editorCommon
.
ISingleEditOperation
[]
>
{
const
model
=
editor
.
getModel
();
...
...
src/vs/editor/contrib/multicursor/test/common/multicursor.test.ts
浏览文件 @
8639e21b
...
...
@@ -53,11 +53,11 @@ function fromRange(rng: Range): number[] {
suite
(
'
Multicursor selection
'
,
()
=>
{
let
queryState
:
{
[
key
:
string
]:
any
;
}
=
{};
let
serviceCollection
=
new
ServiceCollection
();
serviceCollection
.
set
(
IStorageService
,
<
any
>
{
serviceCollection
.
set
(
IStorageService
,
{
get
:
(
key
:
string
)
=>
queryState
[
key
],
getBoolean
:
(
key
:
string
)
=>
!!
queryState
[
key
],
store
:
(
key
:
string
,
value
:
any
)
=>
{
queryState
[
key
]
=
value
;
}
});
}
as
IStorageService
);
test
(
'
issue #8817: Cursor position changes when you cancel multicursor
'
,
()
=>
{
withMockCodeEditor
([
...
...
src/vs/editor/test/common/core/editorState.test.ts
浏览文件 @
8639e21b
...
...
@@ -91,13 +91,13 @@ suite('Editor Core - Editor State', () => {
function
createEditor
({
model
,
position
,
selection
,
scroll
}:
IStubEditorState
=
{}):
ICommonCodeEditor
{
let
mappedModel
=
model
?
{
uri
:
model
.
uri
?
model
.
uri
:
URI
.
parse
(
'
http://dummy.org
'
),
getVersionId
:
()
=>
model
.
version
}
:
null
;
return
<
any
>
{
return
{
getModel
:
():
IModel
=>
<
any
>
mappedModel
,
getPosition
:
():
Position
=>
position
,
getSelection
:
():
Selection
=>
selection
,
getScrollLeft
:
():
number
=>
scroll
&&
scroll
.
left
,
getScrollTop
:
():
number
=>
scroll
&&
scroll
.
top
};
}
as
ICommonCodeEditor
;
}
});
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
8639e21b
...
...
@@ -257,7 +257,7 @@ export class SearchViewlet extends Viewlet {
this
.
createSearchResultsView
(
builder
);
this
.
actionRegistry
=
<
any
>
{};
this
.
actionRegistry
=
{};
let
actions
:
Action
[]
=
[
new
CollapseDeepestExpandedLevelAction
(
this
),
new
RefreshAction
(
this
),
new
ClearSearchResultsAction
(
this
)];
actions
.
forEach
((
action
)
=>
{
this
.
actionRegistry
[
action
.
id
]
=
action
;
...
...
src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts
浏览文件 @
8639e21b
...
...
@@ -45,9 +45,9 @@ suite('Workbench - TerminalInstance', () => {
executable
:
'
/bin/foosh
'
,
args
:
[
'
-bar
'
,
'
baz
'
]
};
const
parentEnv1
:
IStringDictionary
<
string
>
=
<
any
>
{
const
parentEnv1
:
IStringDictionary
<
string
>
=
{
ok
:
true
};
}
as
any
;
const
env1
=
TerminalInstance
.
createTerminalEnv
(
parentEnv1
,
shell1
,
'
/foo
'
,
'
en-au
'
);
assert
.
ok
(
env1
[
'
ok
'
],
'
Parent environment is copied
'
);
assert
.
deepStrictEqual
(
parentEnv1
,
{
ok
:
true
},
'
Parent environment is unchanged
'
);
...
...
@@ -63,7 +63,7 @@ suite('Workbench - TerminalInstance', () => {
executable
:
'
/bin/foosh
'
,
args
:
[]
};
const
parentEnv2
:
IStringDictionary
<
string
>
=
<
any
>
{
const
parentEnv2
:
IStringDictionary
<
string
>
=
{
LANG
:
'
en_US.UTF-8
'
};
const
env2
=
TerminalInstance
.
createTerminalEnv
(
parentEnv2
,
shell2
,
'
/foo
'
,
'
en-au
'
);
...
...
src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts
浏览文件 @
8639e21b
...
...
@@ -18,7 +18,7 @@ suite('Workbench - GettingStarted', () => {
suiteSetup
(()
=>
{
instantiation
=
new
TestInstantiationService
();
instantiation
.
stub
(
IWorkspaceContextService
,
<
any
>
{
instantiation
.
stub
(
IWorkspaceContextService
,
{
getConfiguration
:
()
=>
{
return
{
env
:
{
...
...
@@ -28,7 +28,7 @@ suite('Workbench - GettingStarted', () => {
};
}
});
instantiation
.
stub
(
IStorageService
,
<
any
>
{
instantiation
.
stub
(
IStorageService
,
{
get
:
()
=>
hideWelcomeSettingsValue
,
store
:
(
value
)
=>
hideWelcomeSettingsValue
=
value
});
...
...
src/vs/workbench/services/progress/test/progressService.test.ts
浏览文件 @
8639e21b
...
...
@@ -17,7 +17,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import
{
IViewlet
}
from
'
vs/workbench/common/viewlet
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
let
activeViewlet
:
Viewlet
=
<
any
>
{};
let
activeViewlet
:
Viewlet
=
{};
class
TestViewletService
implements
IViewletService
{
public
_serviceBrand
:
any
;
...
...
src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts
浏览文件 @
8639e21b
...
...
@@ -21,11 +21,11 @@ suite('ExtHostMessageService', function () {
setImmediate
(()
=>
m
.
actions
[
0
].
run
());
return
()
=>
{
};
}
}
as
IMessageService
,
<
any
>
{
choose
()
{
}
as
IMessageService
,
{
choose
(
severity
,
message
,
options
,
modal
)
{
throw
new
Error
(
'
not implemented
'
);
}
});
}
as
IChoiceService
);
return
service
.
$showMessage
(
1
,
'
h
'
,
{},
[{
handle
:
42
,
title
:
'
a thing
'
,
isCloseAffordance
:
true
}]).
then
(
handle
=>
{
assert
.
equal
(
handle
,
42
);
...
...
@@ -39,11 +39,11 @@ suite('ExtHostMessageService', function () {
show
(
sev
:
number
,
m
:
{
actions
:
Action
[]
})
{
actions
=
m
.
actions
;
}
}
as
IMessageService
,
<
any
>
{
choose
()
{
}
as
IMessageService
,
{
choose
(
severity
,
message
,
options
,
modal
)
{
throw
new
Error
(
'
not implemented
'
);
}
});
}
as
IChoiceService
);
// default close action
service
.
$showMessage
(
1
,
''
,
{},
[{
title
:
'
a thing
'
,
isCloseAffordance
:
false
,
handle
:
0
}]);
...
...
@@ -71,11 +71,11 @@ suite('ExtHostMessageService', function () {
c
+=
1
;
};
}
}
as
IMessageService
,
<
any
>
{
choose
()
{
}
as
IMessageService
,
{
choose
(
severity
,
message
,
options
,
modal
)
{
throw
new
Error
(
'
not implemented
'
);
}
});
}
as
IChoiceService
);
service
.
$showMessage
(
1
,
''
,
{},
[{
title
:
'
a thing
'
,
isCloseAffordance
:
true
,
handle
:
0
}]);
assert
.
equal
(
actions
.
length
,
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录