Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b743e245
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,发现更多精彩内容 >>
提交
b743e245
编写于
11月 06, 2017
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable strict compilation settings in git extension
Enables strict checks in the git extensions
上级
00ca96b7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
16 deletion
+17
-16
extensions/git/package.json
extensions/git/package.json
+1
-0
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+3
-3
extensions/git/src/decorators.ts
extensions/git/src/decorators.ts
+4
-4
extensions/git/src/main.ts
extensions/git/src/main.ts
+1
-1
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+2
-2
extensions/git/src/util.ts
extensions/git/src/util.ts
+5
-5
extensions/git/tsconfig.json
extensions/git/tsconfig.json
+1
-1
未找到文件。
extensions/git/package.json
浏览文件 @
b743e245
...
...
@@ -902,6 +902,7 @@
"devDependencies"
:
{
"@types/mocha"
:
"2.2.43"
,
"@types/node"
:
"7.0.43"
,
"@types/byline"
:
"4.2.31"
,
"mocha"
:
"^3.2.0"
}
}
\ No newline at end of file
extensions/git/src/commands.ts
浏览文件 @
b743e245
...
...
@@ -1384,7 +1384,7 @@ export class CommandCenter {
}
private
createCommand
(
id
:
string
,
key
:
string
,
method
:
Function
,
options
:
CommandOptions
):
(...
args
:
any
[])
=>
any
{
const
result
=
(...
args
)
=>
{
const
result
=
(...
args
:
any
[]
)
=>
{
let
result
:
Promise
<
any
>
;
if
(
!
options
.
repository
)
{
...
...
@@ -1433,7 +1433,7 @@ export class CommandCenter {
.
replace
(
/^error: /mi
,
''
)
.
replace
(
/^> husky.*$/mi
,
''
)
.
split
(
/
[\r\n]
/
)
.
filter
(
line
=>
!!
line
)
.
filter
(
(
line
:
any
)
=>
!!
line
)
[
0
];
message
=
hint
...
...
@@ -1459,7 +1459,7 @@ export class CommandCenter {
};
// patch this object, so people can call methods directly
this
[
key
]
=
result
;
(
this
as
any
)
[
key
]
=
result
;
return
result
;
}
...
...
extensions/git/src/decorators.ts
浏览文件 @
b743e245
...
...
@@ -31,7 +31,7 @@ function decorate(decorator: (fn: Function, key: string) => Function): Function
function
_memoize
(
fn
:
Function
,
key
:
string
):
Function
{
const
memoizeKey
=
`$memoize$
${
key
}
`
;
return
function
(...
args
:
any
[])
{
return
function
(
this
:
any
,
...
args
:
any
[])
{
if
(
!
this
.
hasOwnProperty
(
memoizeKey
))
{
Object
.
defineProperty
(
this
,
memoizeKey
,
{
configurable
:
false
,
...
...
@@ -51,7 +51,7 @@ function _throttle<T>(fn: Function, key: string): Function {
const
currentKey
=
`$throttle$current$
${
key
}
`
;
const
nextKey
=
`$throttle$next$
${
key
}
`
;
const
trigger
=
function
(...
args
:
any
[])
{
const
trigger
=
function
(
this
:
any
,
...
args
:
any
[])
{
if
(
this
[
nextKey
])
{
return
this
[
nextKey
];
}
...
...
@@ -81,7 +81,7 @@ export const throttle = decorate(_throttle);
function
_sequentialize
<
T
>
(
fn
:
Function
,
key
:
string
):
Function
{
const
currentKey
=
`__$sequence$
${
key
}
`
;
return
function
(...
args
:
any
[])
{
return
function
(
this
:
any
,
...
args
:
any
[])
{
const
currentPromise
=
this
[
currentKey
]
as
Promise
<
any
>
||
Promise
.
resolve
(
null
);
const
run
=
async
()
=>
await
fn
.
apply
(
this
,
args
);
this
[
currentKey
]
=
currentPromise
.
then
(
run
,
run
);
...
...
@@ -95,7 +95,7 @@ export function debounce(delay: number): Function {
return
decorate
((
fn
,
key
)
=>
{
const
timerKey
=
`$debounce$
${
key
}
`
;
return
function
(...
args
:
any
[])
{
return
function
(
this
:
any
,
...
args
:
any
[])
{
clearTimeout
(
this
[
timerKey
]);
this
[
timerKey
]
=
setTimeout
(()
=>
fn
.
apply
(
this
,
args
),
delay
);
};
...
...
extensions/git/src/main.ts
浏览文件 @
b743e245
...
...
@@ -48,7 +48,7 @@ async function init(context: ExtensionContext, disposables: Disposable[]): Promi
outputChannel
.
appendLine
(
localize
(
'
using git
'
,
"
Using git {0} from {1}
"
,
info
.
version
,
info
.
path
));
const
onOutput
=
str
=>
outputChannel
.
append
(
str
);
const
onOutput
=
(
str
:
string
)
=>
outputChannel
.
append
(
str
);
git
.
onOutput
.
addListener
(
'
log
'
,
onOutput
);
disposables
.
push
(
toDisposable
(()
=>
git
.
onOutput
.
removeListener
(
'
log
'
,
onOutput
)));
...
...
extensions/git/src/repository.ts
浏览文件 @
b743e245
...
...
@@ -82,7 +82,7 @@ export class Resource implements SourceControlResourceState {
get
original
():
Uri
{
return
this
.
_resourceUri
;
}
get
renameResourceUri
():
Uri
|
undefined
{
return
this
.
_renameResourceUri
;
}
private
static
Icons
=
{
private
static
Icons
:
any
=
{
light
:
{
Modified
:
getIconUri
(
'
status-modified
'
,
'
light
'
),
Added
:
getIconUri
(
'
status-added
'
,
'
light
'
),
...
...
@@ -724,7 +724,7 @@ export class Repository implements Disposable {
const
child
=
this
.
repository
.
stream
([
'
check-ignore
'
,
...
filePaths
]);
const
onExit
=
exitCode
=>
{
const
onExit
=
(
exitCode
:
number
)
=>
{
if
(
exitCode
===
1
)
{
// nothing ignored
resolve
(
new
Set
<
string
>
());
...
...
extensions/git/src/util.ts
浏览文件 @
b743e245
...
...
@@ -84,7 +84,7 @@ export function once(fn: (...args: any[]) => any): (...args: any[]) => any {
};
}
export
function
assign
<
T
>
(
destination
:
T
,
...
sources
:
any
[]):
T
{
export
function
assign
<
T
>
(
destination
:
T
,
...
sources
:
(
keyof
T
)
[]):
T
{
for
(
const
source
of
sources
)
{
Object
.
keys
(
source
).
forEach
(
key
=>
destination
[
key
]
=
source
[
key
]);
}
...
...
@@ -115,12 +115,12 @@ export function groupBy<T>(arr: T[], fn: (el: T) => string): { [key: string]: T[
},
Object
.
create
(
null
));
}
export
function
denodeify
<
R
>
(
fn
:
Function
):
(...
args
)
=>
Promise
<
R
>
{
return
(...
args
)
=>
new
Promise
<
R
>
((
c
,
e
)
=>
fn
(...
args
,
(
err
,
r
)
=>
err
?
e
(
err
)
:
c
(
r
)));
export
function
denodeify
<
R
>
(
fn
:
Function
):
(...
args
:
any
[]
)
=>
Promise
<
R
>
{
return
(...
args
)
=>
new
Promise
<
R
>
((
c
,
e
)
=>
fn
(...
args
,
(
err
:
any
,
r
:
any
)
=>
err
?
e
(
err
)
:
c
(
r
)));
}
export
function
nfcall
<
R
>
(
fn
:
Function
,
...
args
):
Promise
<
R
>
{
return
new
Promise
<
R
>
((
c
,
e
)
=>
fn
(...
args
,
(
err
,
r
)
=>
err
?
e
(
err
)
:
c
(
r
)));
export
function
nfcall
<
R
>
(
fn
:
Function
,
...
args
:
any
[]
):
Promise
<
R
>
{
return
new
Promise
<
R
>
((
c
,
e
)
=>
fn
(...
args
,
(
err
:
any
,
r
:
any
)
=>
err
?
e
(
err
)
:
c
(
r
)));
}
export
async
function
mkdirp
(
path
:
string
,
mode
?:
number
):
Promise
<
boolean
>
{
...
...
extensions/git/tsconfig.json
浏览文件 @
b743e245
...
...
@@ -6,7 +6,7 @@
],
"module"
:
"commonjs"
,
"outDir"
:
"./out"
,
"strict
NullChecks
"
:
true
,
"strict"
:
true
,
"experimentalDecorators"
:
true
},
"include"
:
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录