Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6801e4c6
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6801e4c6
编写于
3月 02, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - less explicit any
上级
89b4f048
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
23 addition
and
23 deletion
+23
-23
src/vs/base/browser/touch.ts
src/vs/base/browser/touch.ts
+1
-1
src/vs/base/browser/ui/dropdown/dropdown.ts
src/vs/base/browser/ui/dropdown/dropdown.ts
+3
-3
src/vs/base/browser/ui/menu/menu.ts
src/vs/base/browser/ui/menu/menu.ts
+3
-3
src/vs/base/common/cancellation.ts
src/vs/base/common/cancellation.ts
+1
-1
src/vs/base/common/errorsWithActions.ts
src/vs/base/common/errorsWithActions.ts
+1
-1
src/vs/base/common/functional.ts
src/vs/base/common/functional.ts
+4
-4
src/vs/base/common/lazy.ts
src/vs/base/common/lazy.ts
+1
-1
src/vs/base/common/lifecycle.ts
src/vs/base/common/lifecycle.ts
+3
-4
src/vs/base/common/normalization.ts
src/vs/base/common/normalization.ts
+1
-1
src/vs/base/common/strings.ts
src/vs/base/common/strings.ts
+4
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+1
-1
未找到文件。
src/vs/base/browser/touch.ts
浏览文件 @
6801e4c6
...
...
@@ -247,7 +247,7 @@ export class Gesture extends Disposable {
}
private
newGestureEvent
(
type
:
string
,
initialTarget
?:
EventTarget
):
GestureEvent
{
let
event
=
<
GestureEvent
>
(
<
any
>
document
.
createEvent
(
'
CustomEvent
'
))
;
let
event
=
document
.
createEvent
(
'
CustomEvent
'
)
as
unknown
as
GestureEvent
;
event
.
initEvent
(
type
,
false
,
true
);
event
.
initialTarget
=
initialTarget
;
event
.
tapCount
=
0
;
...
...
src/vs/base/browser/ui/dropdown/dropdown.ts
浏览文件 @
6801e4c6
...
...
@@ -271,7 +271,7 @@ export class DropdownMenu extends BaseDropdown {
}
export
class
DropdownMenuActionViewItem
extends
BaseActionViewItem
{
private
menuActionsOrProvider
:
any
;
private
menuActionsOrProvider
:
ReadonlyArray
<
IAction
>
|
IActionProvider
;
private
dropdownMenu
:
DropdownMenu
|
undefined
;
private
contextMenuProvider
:
IContextMenuProvider
;
private
actionViewItemProvider
?:
IActionViewItemProvider
;
...
...
@@ -317,7 +317,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
if
(
Array
.
isArray
(
this
.
menuActionsOrProvider
))
{
options
.
actions
=
this
.
menuActionsOrProvider
;
}
else
{
options
.
actionProvider
=
this
.
menuActionsOrProvider
;
options
.
actionProvider
=
this
.
menuActionsOrProvider
as
IActionProvider
;
}
this
.
dropdownMenu
=
this
.
_register
(
new
DropdownMenu
(
container
,
options
));
...
...
@@ -341,7 +341,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
}
}
setActionContext
(
newContext
:
any
):
void
{
setActionContext
(
newContext
:
unknown
):
void
{
super
.
setActionContext
(
newContext
);
if
(
this
.
dropdownMenu
)
{
...
...
src/vs/base/browser/ui/menu/menu.ts
浏览文件 @
6801e4c6
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./menu
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
IActionRunner
,
IAction
,
Action
,
IActionViewItem
}
from
'
vs/base/common/actions
'
;
import
{
IActionRunner
,
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
ActionBar
,
IActionViewItemProvider
,
ActionsOrientation
,
Separator
,
ActionViewItem
,
IActionViewItemOptions
,
BaseActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ResolvedKeybinding
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
addClass
,
EventType
,
EventHelper
,
EventLike
,
removeTabIndexAndUpdateFocus
,
isAncestor
,
hasClass
,
addDisposableListener
,
removeClass
,
append
,
$
,
addClasses
,
removeClasses
,
clearNode
}
from
'
vs/base/browser/dom
'
;
...
...
@@ -205,7 +205,7 @@ export class Menu extends ActionBar {
container
.
appendChild
(
this
.
scrollableElement
.
getDomNode
());
this
.
scrollableElement
.
scanDomNode
();
this
.
viewItems
.
filter
(
item
=>
!
(
item
instanceof
MenuSeparatorActionViewItem
)).
forEach
((
item
:
IActionViewItem
,
index
:
number
,
array
:
any
[]
)
=>
{
this
.
viewItems
.
filter
(
item
=>
!
(
item
instanceof
MenuSeparatorActionViewItem
)).
forEach
((
item
,
index
,
array
)
=>
{
(
item
as
BaseMenuActionViewItem
).
updatePositionInSet
(
index
+
1
,
array
.
length
);
});
}
...
...
@@ -363,7 +363,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
private
cssClass
:
string
;
protected
menuStyle
:
IMenuStyles
|
undefined
;
constructor
(
ctx
:
any
,
action
:
IAction
,
options
:
IMenuItemOptions
=
{})
{
constructor
(
ctx
:
unknown
,
action
:
IAction
,
options
:
IMenuItemOptions
=
{})
{
options
.
isMenu
=
true
;
super
(
action
,
action
,
options
);
...
...
src/vs/base/common/cancellation.ts
浏览文件 @
6801e4c6
...
...
@@ -31,7 +31,7 @@ const shortcutEvent: Event<any> = Object.freeze(function (callback, context?): I
export
namespace
CancellationToken
{
export
function
isCancellationToken
(
thing
:
any
):
thing
is
CancellationToken
{
export
function
isCancellationToken
(
thing
:
unknown
):
thing
is
CancellationToken
{
if
(
thing
===
CancellationToken
.
None
||
thing
===
CancellationToken
.
Cancelled
)
{
return
true
;
}
...
...
src/vs/base/common/errorsWithActions.ts
浏览文件 @
6801e4c6
...
...
@@ -13,7 +13,7 @@ export interface IErrorWithActions {
actions
?:
ReadonlyArray
<
IAction
>
;
}
export
function
isErrorWithActions
(
obj
:
any
):
obj
is
IErrorWithActions
{
export
function
isErrorWithActions
(
obj
:
unknown
):
obj
is
IErrorWithActions
{
return
obj
instanceof
Error
&&
Array
.
isArray
((
obj
as
IErrorWithActions
).
actions
);
}
...
...
src/vs/base/common/functional.ts
浏览文件 @
6801e4c6
...
...
@@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export
function
once
<
T
extends
Function
>
(
this
:
any
,
fn
:
T
):
T
{
export
function
once
<
T
extends
Function
>
(
this
:
unknown
,
fn
:
T
):
T
{
const
_this
=
this
;
let
didCall
=
false
;
let
result
:
any
;
let
result
:
unknown
;
return
function
()
{
if
(
didCall
)
{
...
...
@@ -17,5 +17,5 @@ export function once<T extends Function>(this: any, fn: T): T {
result
=
fn
.
apply
(
_this
,
arguments
);
return
result
;
}
as
any
as
T
;
}
\ No newline at end of file
}
as
unknown
as
T
;
}
src/vs/base/common/lazy.ts
浏览文件 @
6801e4c6
...
...
@@ -21,7 +21,7 @@ export class Lazy<T> {
private
_didRun
:
boolean
=
false
;
private
_value
?:
T
;
private
_error
:
any
;
private
_error
:
Error
|
undefined
;
constructor
(
private
readonly
executor
:
()
=>
T
,
...
...
src/vs/base/common/lifecycle.ts
浏览文件 @
6801e4c6
...
...
@@ -49,8 +49,7 @@ export interface IDisposable {
}
export
function
isDisposable
<
E
extends
object
>
(
thing
:
E
):
thing
is
E
&
IDisposable
{
return
typeof
(
<
IDisposable
><
any
>
thing
).
dispose
===
'
function
'
&&
(
<
IDisposable
><
any
>
thing
).
dispose
.
length
===
0
;
return
typeof
(
<
IDisposable
>
thing
).
dispose
===
'
function
'
&&
(
<
IDisposable
>
thing
).
dispose
.
length
===
0
;
}
export
function
dispose
<
T
extends
IDisposable
>
(
disposable
:
T
):
T
;
...
...
@@ -124,7 +123,7 @@ export class DisposableStore implements IDisposable {
if
(
!
t
)
{
return
t
;
}
if
((
t
as
any
as
DisposableStore
)
===
this
)
{
if
((
t
as
unknown
as
DisposableStore
)
===
this
)
{
throw
new
Error
(
'
Cannot register a disposable on itself!
'
);
}
...
...
@@ -158,7 +157,7 @@ export abstract class Disposable implements IDisposable {
}
protected
_register
<
T
extends
IDisposable
>
(
t
:
T
):
T
{
if
((
t
as
any
as
Disposable
)
===
this
)
{
if
((
t
as
unknown
as
Disposable
)
===
this
)
{
throw
new
Error
(
'
Cannot register a disposable on itself!
'
);
}
return
this
.
_store
.
add
(
t
);
...
...
src/vs/base/common/normalization.ts
浏览文件 @
6801e4c6
...
...
@@ -11,7 +11,7 @@ import { LRUCache } from 'vs/base/common/map';
*
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize}
*/
export
const
canNormalize
=
typeof
(
(
<
any
>
''
).
normalize
)
===
'
function
'
;
export
const
canNormalize
=
typeof
(
String
.
prototype
as
any
/* standalone editor compilation */
).
normalize
===
'
function
'
;
const
nfcCache
=
new
LRUCache
<
string
,
string
>
(
10000
);
// bounded to 10000 elements
export
function
normalizeNFC
(
str
:
string
):
string
{
...
...
src/vs/base/common/strings.ts
浏览文件 @
6801e4c6
...
...
@@ -5,6 +5,7 @@
import
{
CharCode
}
from
'
vs/base/common/charCode
'
;
import
{
Constants
}
from
'
vs/base/common/uint
'
;
import
{
canNormalize
,
normalizeNFD
}
from
'
vs/base/common/normalization
'
;
export
function
isFalsyOrWhitespace
(
str
:
string
|
undefined
):
boolean
{
if
(
!
str
||
typeof
str
!==
'
string
'
)
{
...
...
@@ -853,15 +854,15 @@ export function removeAnsiEscapeCodes(str: string): string {
}
export
const
removeAccents
:
(
str
:
string
)
=>
string
=
(
function
()
{
if
(
typeof
(
String
.
prototype
as
any
/* standalone editor compilation */
).
normalize
!==
'
function
'
)
{
//
☹️
no ES6 features...
if
(
!
canNormalize
)
{
// no ES6 features...
return
function
(
str
:
string
)
{
return
str
;
};
}
else
{
// transform into NFD form and remove accents
// see: https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463#37511463
const
regex
=
/
[\u
0300-
\u
036f
]
/g
;
return
function
(
str
:
string
)
{
return
(
str
as
any
/* standalone editor compilation */
).
normalize
(
'
NFD
'
).
replace
(
regex
,
''
);
return
normalizeNFD
(
str
).
replace
(
regex
,
''
);
};
}
})();
...
...
src/vs/monaco.d.ts
浏览文件 @
6801e4c6
...
...
@@ -6036,7 +6036,7 @@ declare namespace monaco.languages {
}
/**
* A provider of
color
s for editor models.
* A provider of
folding range
s for editor models.
*/
export
interface
FoldingRangeProvider
{
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录