Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5a318c23
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,发现更多精彩内容 >>
提交
5a318c23
编写于
11月 15, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf - remove duplicated mkdirp method
上级
9486025f
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
112 addition
and
159 deletion
+112
-159
src/vs/base/node/extfs.ts
src/vs/base/node/extfs.ts
+46
-52
src/vs/base/node/pfs.ts
src/vs/base/node/pfs.ts
+2
-27
src/vs/base/test/node/config.test.ts
src/vs/base/test/node/config.test.ts
+4
-3
src/vs/base/test/node/extfs/extfs.test.ts
src/vs/base/test/node/extfs/extfs.test.ts
+19
-15
src/vs/base/test/node/pfs.test.ts
src/vs/base/test/node/pfs.test.ts
+20
-10
src/vs/platform/configuration/test/node/configurationService.test.ts
...form/configuration/test/node/configurationService.test.ts
+4
-3
src/vs/platform/update/electron-main/auto-updater.win32.ts
src/vs/platform/update/electron-main/auto-updater.win32.ts
+1
-2
src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts
...nfiguration/test/node/configurationEditingService.test.ts
+9
-15
src/vs/workbench/services/configuration/test/node/configurationService.test.ts
...ices/configuration/test/node/configurationService.test.ts
+3
-21
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
...h/services/keybinding/test/node/keybindingEditing.test.ts
+4
-11
未找到文件。
src/vs/base/node/extfs.ts
浏览文件 @
5a318c23
...
@@ -12,6 +12,8 @@ import * as flow from 'vs/base/node/flow';
...
@@ -12,6 +12,8 @@ import * as flow from 'vs/base/node/flow';
import
*
as
fs
from
'
fs
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
paths
from
'
path
'
;
import
*
as
paths
from
'
path
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
nfcall
}
from
'
vs/base/common/async
'
;
const
loop
=
flow
.
loop
;
const
loop
=
flow
.
loop
;
...
@@ -41,80 +43,72 @@ export function readdir(path: string, callback: (error: Error, files: string[])
...
@@ -41,80 +43,72 @@ export function readdir(path: string, callback: (error: Error, files: string[])
return
fs
.
readdir
(
path
,
callback
);
return
fs
.
readdir
(
path
,
callback
);
}
}
export
function
mkdirp
(
path
:
string
,
mode
:
number
,
callback
:
(
error
:
Error
)
=>
void
):
void
{
fs
.
exists
(
path
,
exists
=>
{
if
(
exists
)
{
return
isDirectory
(
path
,
(
err
:
Error
,
itIs
?:
boolean
)
=>
{
if
(
err
)
{
return
callback
(
err
);
}
if
(
!
itIs
)
{
return
callback
(
new
Error
(
'
"
'
+
path
+
'
" is not a directory.
'
));
}
callback
(
null
);
});
}
mkdirp
(
paths
.
dirname
(
path
),
mode
,
(
err
:
Error
)
=>
{
if
(
err
)
{
callback
(
err
);
return
;
}
if
(
mode
)
{
fs
.
mkdir
(
path
,
mode
,
error
=>
{
if
(
error
)
{
return
callback
(
error
);
}
fs
.
chmod
(
path
,
mode
,
callback
);
// we need to explicitly chmod because of https://github.com/nodejs/node/issues/1104
});
}
else
{
fs
.
mkdir
(
path
,
null
,
callback
);
}
});
});
}
function
isDirectory
(
path
:
string
,
callback
:
(
error
:
Error
,
isDirectory
?:
boolean
)
=>
void
):
void
{
fs
.
stat
(
path
,
(
error
,
stat
)
=>
{
if
(
error
)
{
return
callback
(
error
);
}
callback
(
null
,
stat
.
isDirectory
());
});
}
export
function
copy
(
source
:
string
,
target
:
string
,
callback
:
(
error
:
Error
)
=>
void
,
copiedSources
?:
{
[
path
:
string
]:
boolean
}):
void
{
export
function
copy
(
source
:
string
,
target
:
string
,
callback
:
(
error
:
Error
)
=>
void
,
copiedSources
?:
{
[
path
:
string
]:
boolean
}):
void
{
if
(
!
copiedSources
)
{
if
(
!
copiedSources
)
{
copiedSources
=
Object
.
create
(
null
);
copiedSources
=
Object
.
create
(
null
);
}
}
fs
.
stat
(
source
,
(
error
,
stat
)
=>
{
fs
.
stat
(
source
,
(
error
,
stat
)
=>
{
if
(
error
)
{
return
callback
(
error
);
}
if
(
error
)
{
if
(
!
stat
.
isDirectory
())
{
return
pipeFs
(
source
,
target
,
stat
.
mode
&
511
,
callback
);
}
return
callback
(
error
);
}
if
(
!
stat
.
isDirectory
())
{
return
pipeFs
(
source
,
target
,
stat
.
mode
&
511
,
callback
);
}
if
(
copiedSources
[
source
])
{
if
(
copiedSources
[
source
])
{
return
callback
(
null
);
// escape when there are cycles (can happen with symlinks)
return
callback
(
null
);
// escape when there are cycles (can happen with symlinks)
}
else
{
copiedSources
[
source
]
=
true
;
// remember as copied
}
}
mkdirp
(
target
,
stat
.
mode
&
511
,
err
=>
{
copiedSources
[
source
]
=
true
;
// remember as copied
const
proceed
=
function
()
{
readdir
(
source
,
(
err
,
files
)
=>
{
readdir
(
source
,
(
err
,
files
)
=>
{
loop
(
files
,
(
file
:
string
,
clb
:
(
error
:
Error
,
result
:
string
[])
=>
void
)
=>
{
loop
(
files
,
(
file
:
string
,
clb
:
(
error
:
Error
,
result
:
string
[])
=>
void
)
=>
{
copy
(
paths
.
join
(
source
,
file
),
paths
.
join
(
target
,
file
),
(
error
:
Error
)
=>
clb
(
error
,
void
0
),
copiedSources
);
copy
(
paths
.
join
(
source
,
file
),
paths
.
join
(
target
,
file
),
(
error
:
Error
)
=>
clb
(
error
,
void
0
),
copiedSources
);
},
callback
);
},
callback
);
});
});
};
mkdirp
(
target
,
stat
.
mode
&
511
).
done
(
proceed
,
proceed
);
});
}
export
function
mkdirp
(
path
:
string
,
mode
?:
number
):
TPromise
<
boolean
>
{
const
mkdir
=
()
=>
nfcall
(
fs
.
mkdir
,
path
,
mode
)
.
then
(
null
,
(
err
:
NodeJS
.
ErrnoException
)
=>
{
if
(
err
.
code
===
'
EEXIST
'
)
{
return
nfcall
(
fs
.
stat
,
path
)
.
then
((
stat
:
fs
.
Stats
)
=>
stat
.
isDirectory
?
null
:
TPromise
.
wrapError
(
new
Error
(
`'
${
path
}
' exists and is not a directory.`
)));
}
return
TPromise
.
wrapError
<
boolean
>
(
err
);
});
});
// is root?
if
(
path
===
paths
.
dirname
(
path
))
{
return
TPromise
.
as
(
true
);
}
return
mkdir
().
then
(
null
,
(
err
:
NodeJS
.
ErrnoException
)
=>
{
if
(
err
.
code
===
'
ENOENT
'
)
{
return
mkdirp
(
paths
.
dirname
(
path
),
mode
).
then
(
mkdir
);
}
return
TPromise
.
wrapError
<
boolean
>
(
err
);
});
});
}
}
function
pipeFs
(
source
:
string
,
target
:
string
,
mode
:
number
,
callback
:
(
error
:
Error
)
=>
void
):
void
{
function
pipeFs
(
source
:
string
,
target
:
string
,
mode
:
number
,
callback
:
(
error
:
Error
)
=>
void
):
void
{
let
callbackHandled
=
false
;
let
callbackHandled
=
false
;
le
t
readStream
=
fs
.
createReadStream
(
source
);
cons
t
readStream
=
fs
.
createReadStream
(
source
);
le
t
writeStream
=
fs
.
createWriteStream
(
target
,
{
mode
:
mode
});
cons
t
writeStream
=
fs
.
createWriteStream
(
target
,
{
mode
:
mode
});
le
t
onError
=
(
error
:
Error
)
=>
{
cons
t
onError
=
(
error
:
Error
)
=>
{
if
(
!
callbackHandled
)
{
if
(
!
callbackHandled
)
{
callbackHandled
=
true
;
callbackHandled
=
true
;
callback
(
error
);
callback
(
error
);
...
@@ -163,7 +157,7 @@ export function del(path: string, tmpFolder: string, callback: (error: Error) =>
...
@@ -163,7 +157,7 @@ export function del(path: string, tmpFolder: string, callback: (error: Error) =>
return
rmRecursive
(
path
,
callback
);
return
rmRecursive
(
path
,
callback
);
}
}
le
t
pathInTemp
=
paths
.
join
(
tmpFolder
,
uuid
.
generateUuid
());
cons
t
pathInTemp
=
paths
.
join
(
tmpFolder
,
uuid
.
generateUuid
());
fs
.
rename
(
path
,
pathInTemp
,
(
error
:
Error
)
=>
{
fs
.
rename
(
path
,
pathInTemp
,
(
error
:
Error
)
=>
{
if
(
error
)
{
if
(
error
)
{
return
rmRecursive
(
path
,
callback
);
// if rename fails, delete without tmp dir
return
rmRecursive
(
path
,
callback
);
// if rename fails, delete without tmp dir
...
@@ -200,7 +194,7 @@ function rmRecursive(path: string, callback: (error: Error) => void): void {
...
@@ -200,7 +194,7 @@ function rmRecursive(path: string, callback: (error: Error) => void): void {
if
(
err
||
!
stat
)
{
if
(
err
||
!
stat
)
{
callback
(
err
);
callback
(
err
);
}
else
if
(
!
stat
.
isDirectory
()
||
stat
.
isSymbolicLink
()
/* !!! never recurse into links when deleting !!! */
)
{
}
else
if
(
!
stat
.
isDirectory
()
||
stat
.
isSymbolicLink
()
/* !!! never recurse into links when deleting !!! */
)
{
le
t
mode
=
stat
.
mode
;
cons
t
mode
=
stat
.
mode
;
if
(
!
(
mode
&
128
))
{
// 128 === 0200
if
(
!
(
mode
&
128
))
{
// 128 === 0200
fs
.
chmod
(
path
,
mode
|
128
,
(
err
:
Error
)
=>
{
// 128 === 0200
fs
.
chmod
(
path
,
mode
|
128
,
(
err
:
Error
)
=>
{
// 128 === 0200
if
(
err
)
{
if
(
err
)
{
...
...
src/vs/base/node/pfs.ts
浏览文件 @
5a318c23
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
extfs
from
'
vs/base/node/extfs
'
;
import
*
as
extfs
from
'
vs/base/node/extfs
'
;
import
{
dirname
,
join
}
from
'
path
'
;
import
{
join
}
from
'
path
'
;
import
{
nfcall
,
Queue
}
from
'
vs/base/common/async
'
;
import
{
nfcall
,
Queue
}
from
'
vs/base/common/async
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
os
from
'
os
'
;
import
*
as
os
from
'
os
'
;
...
@@ -26,32 +26,7 @@ export function chmod(path: string, mode: number): TPromise<boolean> {
...
@@ -26,32 +26,7 @@ export function chmod(path: string, mode: number): TPromise<boolean> {
return
nfcall
(
fs
.
chmod
,
path
,
mode
);
return
nfcall
(
fs
.
chmod
,
path
,
mode
);
}
}
export
function
mkdirp
(
path
:
string
,
mode
?:
number
):
TPromise
<
boolean
>
{
export
import
mkdirp
=
extfs
.
mkdirp
;
const
mkdir
=
()
=>
nfcall
(
fs
.
mkdir
,
path
,
mode
)
.
then
(
null
,
(
err
:
NodeJS
.
ErrnoException
)
=>
{
if
(
err
.
code
===
'
EEXIST
'
)
{
return
nfcall
(
fs
.
stat
,
path
)
.
then
((
stat
:
fs
.
Stats
)
=>
stat
.
isDirectory
?
null
:
TPromise
.
wrapError
(
new
Error
(
`'
${
path
}
' exists and is not a directory.`
)));
}
return
TPromise
.
wrapError
<
boolean
>
(
err
);
});
// is root?
if
(
path
===
dirname
(
path
))
{
return
TPromise
.
as
(
true
);
}
return
mkdir
().
then
(
null
,
(
err
:
NodeJS
.
ErrnoException
)
=>
{
if
(
err
.
code
===
'
ENOENT
'
)
{
return
mkdirp
(
dirname
(
path
),
mode
).
then
(
mkdir
);
}
return
TPromise
.
wrapError
<
boolean
>
(
err
);
});
}
export
function
rimraf
(
path
:
string
):
TPromise
<
void
>
{
export
function
rimraf
(
path
:
string
):
TPromise
<
void
>
{
return
lstat
(
path
).
then
(
stat
=>
{
return
lstat
(
path
).
then
(
stat
=>
{
...
...
src/vs/base/test/node/config.test.ts
浏览文件 @
5a318c23
...
@@ -14,6 +14,7 @@ import extfs = require('vs/base/node/extfs');
...
@@ -14,6 +14,7 @@ import extfs = require('vs/base/node/extfs');
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
{
ConfigWatcher
}
from
'
vs/base/node/config
'
;
import
{
ConfigWatcher
}
from
'
vs/base/node/config
'
;
import
{
onError
}
from
'
vs/base/test/common/utils
'
;
import
{
onError
}
from
'
vs/base/test/common/utils
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
suite
(
'
Config
'
,
()
=>
{
suite
(
'
Config
'
,
()
=>
{
...
@@ -23,9 +24,9 @@ suite('Config', () => {
...
@@ -23,9 +24,9 @@ suite('Config', () => {
const
newDir
=
path
.
join
(
parentDir
,
'
config
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
config
'
,
id
);
const
testFile
=
path
.
join
(
newDir
,
'
config.json
'
);
const
testFile
=
path
.
join
(
newDir
,
'
config.json
'
);
extfs
.
mkdirp
(
newDir
,
493
,
error
=>
{
const
onMkdirp
=
error
=>
callback
(
error
,
testFile
,
(
callback
)
=>
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
callback
));
callback
(
error
,
testFile
,
(
callback
)
=>
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
callback
));
}
);
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
)
);
}
}
test
(
'
defaults
'
,
function
()
{
test
(
'
defaults
'
,
function
()
{
...
...
src/vs/base/test/node/extfs/extfs.test.ts
浏览文件 @
5a318c23
...
@@ -18,6 +18,10 @@ import { onError } from 'vs/base/test/common/utils';
...
@@ -18,6 +18,10 @@ import { onError } from 'vs/base/test/common/utils';
const
ignore
=
()
=>
{
};
const
ignore
=
()
=>
{
};
const
mkdirp
=
(
path
:
string
,
mode
:
number
,
callback
:
(
error
)
=>
void
)
=>
{
extfs
.
mkdirp
(
path
,
mode
).
done
(()
=>
callback
(
null
),
error
=>
callback
(
error
));
};
suite
(
'
Extfs
'
,
()
=>
{
suite
(
'
Extfs
'
,
()
=>
{
test
(
'
mkdirp
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
mkdirp
'
,
function
(
done
:
()
=>
void
)
{
...
@@ -25,7 +29,7 @@ suite('Extfs', () => {
...
@@ -25,7 +29,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -51,7 +55,7 @@ suite('Extfs', () => {
...
@@ -51,7 +55,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -71,7 +75,7 @@ suite('Extfs', () => {
...
@@ -71,7 +75,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -97,7 +101,7 @@ suite('Extfs', () => {
...
@@ -97,7 +101,7 @@ suite('Extfs', () => {
const
targetDir
=
path
.
join
(
parentDir
,
id
);
const
targetDir
=
path
.
join
(
parentDir
,
id
);
const
targetDir2
=
path
.
join
(
parentDir
,
id2
);
const
targetDir2
=
path
.
join
(
parentDir
,
id2
);
extfs
.
copy
(
sourceDir
,
targetDir
,
(
error
)
=>
{
extfs
.
copy
(
sourceDir
,
targetDir
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -109,7 +113,7 @@ suite('Extfs', () => {
...
@@ -109,7 +113,7 @@ suite('Extfs', () => {
assert
.
ok
(
fs
.
statSync
(
path
.
join
(
targetDir
,
'
examples
'
)).
isDirectory
());
assert
.
ok
(
fs
.
statSync
(
path
.
join
(
targetDir
,
'
examples
'
)).
isDirectory
());
assert
.
ok
(
fs
.
existsSync
(
path
.
join
(
targetDir
,
'
examples
'
,
'
small.jxs
'
)));
assert
.
ok
(
fs
.
existsSync
(
path
.
join
(
targetDir
,
'
examples
'
,
'
small.jxs
'
)));
extfs
.
mv
(
targetDir
,
targetDir2
,
(
error
)
=>
{
extfs
.
mv
(
targetDir
,
targetDir2
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -122,7 +126,7 @@ suite('Extfs', () => {
...
@@ -122,7 +126,7 @@ suite('Extfs', () => {
assert
.
ok
(
fs
.
statSync
(
path
.
join
(
targetDir2
,
'
examples
'
)).
isDirectory
());
assert
.
ok
(
fs
.
statSync
(
path
.
join
(
targetDir2
,
'
examples
'
)).
isDirectory
());
assert
.
ok
(
fs
.
existsSync
(
path
.
join
(
targetDir2
,
'
examples
'
,
'
small.jxs
'
)));
assert
.
ok
(
fs
.
existsSync
(
path
.
join
(
targetDir2
,
'
examples
'
,
'
small.jxs
'
)));
extfs
.
mv
(
path
.
join
(
targetDir2
,
'
index.html
'
),
path
.
join
(
targetDir2
,
'
index_moved.html
'
),
(
error
)
=>
{
extfs
.
mv
(
path
.
join
(
targetDir2
,
'
index.html
'
),
path
.
join
(
targetDir2
,
'
index_moved.html
'
),
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -130,11 +134,11 @@ suite('Extfs', () => {
...
@@ -130,11 +134,11 @@ suite('Extfs', () => {
assert
.
ok
(
!
fs
.
existsSync
(
path
.
join
(
targetDir2
,
'
index.html
'
)));
assert
.
ok
(
!
fs
.
existsSync
(
path
.
join
(
targetDir2
,
'
index.html
'
)));
assert
.
ok
(
fs
.
existsSync
(
path
.
join
(
targetDir2
,
'
index_moved.html
'
)));
assert
.
ok
(
fs
.
existsSync
(
path
.
join
(
targetDir2
,
'
index_moved.html
'
)));
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
(
error
)
=>
{
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
},
(
error
)
=>
{
},
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -152,7 +156,7 @@ suite('Extfs', () => {
...
@@ -152,7 +156,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
,
'
öäü
'
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
,
'
öäü
'
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -176,14 +180,14 @@ suite('Extfs', () => {
...
@@ -176,14 +180,14 @@ suite('Extfs', () => {
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
testFile
=
path
.
join
(
newDir
,
'
flushed.txt
'
);
const
testFile
=
path
.
join
(
newDir
,
'
flushed.txt
'
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
assert
.
ok
(
fs
.
existsSync
(
newDir
));
assert
.
ok
(
fs
.
existsSync
(
newDir
));
extfs
.
writeFileAndFlush
(
testFile
,
'
Hello World
'
,
null
,
(
error
)
=>
{
extfs
.
writeFileAndFlush
(
testFile
,
'
Hello World
'
,
null
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -192,7 +196,7 @@ suite('Extfs', () => {
...
@@ -192,7 +196,7 @@ suite('Extfs', () => {
const
largeString
=
(
new
Array
(
100
*
1024
)).
join
(
'
Large String
\n
'
);
const
largeString
=
(
new
Array
(
100
*
1024
)).
join
(
'
Large String
\n
'
);
extfs
.
writeFileAndFlush
(
testFile
,
largeString
,
null
,
(
error
)
=>
{
extfs
.
writeFileAndFlush
(
testFile
,
largeString
,
null
,
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -210,7 +214,7 @@ suite('Extfs', () => {
...
@@ -210,7 +214,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
// assume case insensitive file system
// assume case insensitive file system
if
(
process
.
platform
===
'
win32
'
||
process
.
platform
===
'
darwin
'
)
{
if
(
process
.
platform
===
'
win32
'
||
process
.
platform
===
'
darwin
'
)
{
...
@@ -239,7 +243,7 @@ suite('Extfs', () => {
...
@@ -239,7 +243,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
extfs
.
realpath
(
newDir
,
(
error
,
realpath
)
=>
{
extfs
.
realpath
(
newDir
,
(
error
,
realpath
)
=>
{
assert
.
ok
(
realpath
);
assert
.
ok
(
realpath
);
...
@@ -255,7 +259,7 @@ suite('Extfs', () => {
...
@@ -255,7 +259,7 @@ suite('Extfs', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
mkdirp
(
newDir
,
493
,
error
=>
{
let
realpath
:
string
;
let
realpath
:
string
;
try
{
try
{
realpath
=
extfs
.
realpathSync
(
newDir
);
realpath
=
extfs
.
realpathSync
(
newDir
);
...
...
src/vs/base/test/node/pfs.test.ts
浏览文件 @
5a318c23
...
@@ -25,7 +25,7 @@ suite('PFS', () => {
...
@@ -25,7 +25,7 @@ suite('PFS', () => {
const
newDir
=
path
.
join
(
parentDir
,
'
pfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
pfs
'
,
id
);
const
testFile
=
path
.
join
(
newDir
,
'
writefile.txt
'
);
const
testFile
=
path
.
join
(
newDir
,
'
writefile.txt
'
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
const
onMkdirp
=
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -37,7 +37,9 @@ suite('PFS', () => {
...
@@ -37,7 +37,9 @@ suite('PFS', () => {
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
},
error
=>
onError
(
error
,
done
));
},
error
=>
onError
(
error
,
done
));
});
};
pfs
.
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
));
});
});
test
(
'
writeFile - parallel write on different files works
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
writeFile - parallel write on different files works
'
,
function
(
done
:
()
=>
void
)
{
...
@@ -50,7 +52,7 @@ suite('PFS', () => {
...
@@ -50,7 +52,7 @@ suite('PFS', () => {
const
testFile4
=
path
.
join
(
newDir
,
'
writefile4.txt
'
);
const
testFile4
=
path
.
join
(
newDir
,
'
writefile4.txt
'
);
const
testFile5
=
path
.
join
(
newDir
,
'
writefile5.txt
'
);
const
testFile5
=
path
.
join
(
newDir
,
'
writefile5.txt
'
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
const
onMkdirp
=
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -72,7 +74,9 @@ suite('PFS', () => {
...
@@ -72,7 +74,9 @@ suite('PFS', () => {
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
},
error
=>
onError
(
error
,
done
));
},
error
=>
onError
(
error
,
done
));
});
};
pfs
.
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
));
});
});
test
(
'
writeFile - parallel write on same files works and is sequentalized
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
writeFile - parallel write on same files works and is sequentalized
'
,
function
(
done
:
()
=>
void
)
{
...
@@ -81,7 +85,7 @@ suite('PFS', () => {
...
@@ -81,7 +85,7 @@ suite('PFS', () => {
const
newDir
=
path
.
join
(
parentDir
,
'
pfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
pfs
'
,
id
);
const
testFile
=
path
.
join
(
newDir
,
'
writefile.txt
'
);
const
testFile
=
path
.
join
(
newDir
,
'
writefile.txt
'
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
const
onMkdirp
=
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -99,7 +103,9 @@ suite('PFS', () => {
...
@@ -99,7 +103,9 @@ suite('PFS', () => {
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
},
error
=>
onError
(
error
,
done
));
},
error
=>
onError
(
error
,
done
));
});
};
pfs
.
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
));
});
});
test
(
'
rimraf - simple
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
rimraf - simple
'
,
function
(
done
:
()
=>
void
)
{
...
@@ -107,7 +113,7 @@ suite('PFS', () => {
...
@@ -107,7 +113,7 @@ suite('PFS', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
const
onMkdirp
=
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -119,7 +125,9 @@ suite('PFS', () => {
...
@@ -119,7 +125,9 @@ suite('PFS', () => {
assert
.
ok
(
!
fs
.
existsSync
(
newDir
));
assert
.
ok
(
!
fs
.
existsSync
(
newDir
));
done
();
done
();
},
error
=>
onError
(
error
,
done
));
},
error
=>
onError
(
error
,
done
));
});
// 493 = 0755
};
pfs
.
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
));
});
});
test
(
'
rimraf - recursive folder structure
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
rimraf - recursive folder structure
'
,
function
(
done
:
()
=>
void
)
{
...
@@ -127,7 +135,7 @@ suite('PFS', () => {
...
@@ -127,7 +135,7 @@ suite('PFS', () => {
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
extfs
'
,
id
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
const
onMkdirp
=
error
=>
{
if
(
error
)
{
if
(
error
)
{
return
onError
(
error
,
done
);
return
onError
(
error
,
done
);
}
}
...
@@ -142,6 +150,8 @@ suite('PFS', () => {
...
@@ -142,6 +150,8 @@ suite('PFS', () => {
assert
.
ok
(
!
fs
.
existsSync
(
newDir
));
assert
.
ok
(
!
fs
.
existsSync
(
newDir
));
done
();
done
();
},
error
=>
onError
(
error
,
done
));
},
error
=>
onError
(
error
,
done
));
});
// 493 = 0755
};
pfs
.
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
));
});
});
});
});
\ No newline at end of file
src/vs/platform/configuration/test/node/configurationService.test.ts
浏览文件 @
5a318c23
...
@@ -18,6 +18,7 @@ import { EnvironmentService } from 'vs/platform/environment/node/environmentServ
...
@@ -18,6 +18,7 @@ import { EnvironmentService } from 'vs/platform/environment/node/environmentServ
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
...
@@ -36,9 +37,9 @@ suite('ConfigurationService - Node', () => {
...
@@ -36,9 +37,9 @@ suite('ConfigurationService - Node', () => {
const
newDir
=
path
.
join
(
parentDir
,
'
config
'
,
id
);
const
newDir
=
path
.
join
(
parentDir
,
'
config
'
,
id
);
const
testFile
=
path
.
join
(
newDir
,
'
config.json
'
);
const
testFile
=
path
.
join
(
newDir
,
'
config.json
'
);
extfs
.
mkdirp
(
newDir
,
493
,
(
error
)
=>
{
const
onMkdirp
=
error
=>
callback
(
testFile
,
(
callback
)
=>
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
callback
));
callback
(
testFile
,
(
callback
)
=>
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
callback
));
}
);
mkdirp
(
newDir
,
493
).
done
(()
=>
onMkdirp
(
null
),
error
=>
onMkdirp
(
error
)
);
}
}
test
(
'
simple
'
,
(
done
:
()
=>
void
)
=>
{
test
(
'
simple
'
,
(
done
:
()
=>
void
)
=>
{
...
...
src/vs/platform/update/electron-main/auto-updater.win32.ts
浏览文件 @
5a318c23
...
@@ -11,7 +11,6 @@ import { checksum } from 'vs/base/node/crypto';
...
@@ -11,7 +11,6 @@ import { checksum } from 'vs/base/node/crypto';
import
{
EventEmitter
}
from
'
events
'
;
import
{
EventEmitter
}
from
'
events
'
;
import
{
tmpdir
}
from
'
os
'
;
import
{
tmpdir
}
from
'
os
'
;
import
{
spawn
}
from
'
child_process
'
;
import
{
spawn
}
from
'
child_process
'
;
import
{
mkdirp
}
from
'
vs/base/node/extfs
'
;
import
{
isString
}
from
'
vs/base/common/types
'
;
import
{
isString
}
from
'
vs/base/common/types
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
download
,
asJson
}
from
'
vs/base/node/request
'
;
import
{
download
,
asJson
}
from
'
vs/base/node/request
'
;
...
@@ -42,7 +41,7 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater {
...
@@ -42,7 +41,7 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater {
get
cachePath
():
TPromise
<
string
>
{
get
cachePath
():
TPromise
<
string
>
{
const
result
=
path
.
join
(
tmpdir
(),
`vscode-update-
${
process
.
arch
}
`
);
const
result
=
path
.
join
(
tmpdir
(),
`vscode-update-
${
process
.
arch
}
`
);
return
new
TPromise
<
string
>
((
c
,
e
)
=>
mkdirp
(
result
,
null
,
err
=>
err
?
e
(
err
)
:
c
(
result
))
);
return
pfs
.
mkdirp
(
result
,
null
).
then
(()
=>
result
);
}
}
setFeedURL
(
url
:
string
):
void
{
setFeedURL
(
url
:
string
):
void
{
...
...
src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts
浏览文件 @
5a318c23
...
@@ -34,6 +34,7 @@ import { TextModelResolverService } from 'vs/workbench/services/textmodelResolve
...
@@ -34,6 +34,7 @@ import { TextModelResolverService } from 'vs/workbench/services/textmodelResolve
import
{
IChoiceService
}
from
'
vs/platform/message/common/message
'
;
import
{
IChoiceService
}
from
'
vs/platform/message/common/message
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
...
@@ -80,21 +81,14 @@ suite('ConfigurationEditingService', () => {
...
@@ -80,21 +81,14 @@ suite('ConfigurationEditingService', () => {
.
then
(()
=>
setUpServices
());
.
then
(()
=>
setUpServices
());
});
});
function
setUpWorkspace
():
TPromise
<
void
>
{
function
setUpWorkspace
():
TPromise
<
boolean
>
{
return
new
TPromise
<
void
>
((
c
,
e
)
=>
{
const
id
=
uuid
.
generateUuid
();
const
id
=
uuid
.
generateUuid
();
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
workspaceDir
=
path
.
join
(
parentDir
,
'
workspaceconfig
'
,
id
);
workspaceDir
=
path
.
join
(
parentDir
,
'
workspaceconfig
'
,
id
);
globalSettingsFile
=
path
.
join
(
workspaceDir
,
'
config.json
'
);
globalSettingsFile
=
path
.
join
(
workspaceDir
,
'
config.json
'
);
workspaceSettingsDir
=
path
.
join
(
workspaceDir
,
'
.vscode
'
);
workspaceSettingsDir
=
path
.
join
(
workspaceDir
,
'
.vscode
'
);
extfs
.
mkdirp
(
workspaceSettingsDir
,
493
,
(
error
)
=>
{
return
mkdirp
(
workspaceSettingsDir
,
493
);
if
(
error
)
{
e
(
error
);
}
else
{
c
(
null
);
}
});
});
}
}
function
setUpServices
(
noWorkspace
:
boolean
=
false
):
TPromise
<
void
>
{
function
setUpServices
(
noWorkspace
:
boolean
=
false
):
TPromise
<
void
>
{
...
...
src/vs/workbench/services/configuration/test/node/configurationService.test.ts
浏览文件 @
5a318c23
...
@@ -34,6 +34,7 @@ import { IJSONEditingService } from 'vs/workbench/services/configuration/common/
...
@@ -34,6 +34,7 @@ import { IJSONEditingService } from 'vs/workbench/services/configuration/common/
import
{
JSONEditingService
}
from
'
vs/workbench/services/configuration/node/jsonEditingService
'
;
import
{
JSONEditingService
}
from
'
vs/workbench/services/configuration/node/jsonEditingService
'
;
import
{
IWorkspaceConfigurationService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IWorkspaceConfigurationService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
...
@@ -53,15 +54,7 @@ function setUpFolderWorkspace(folderName: string): TPromise<{ parentDir: string,
...
@@ -53,15 +54,7 @@ function setUpFolderWorkspace(folderName: string): TPromise<{ parentDir: string,
function
setUpFolder
(
folderName
:
string
,
parentDir
:
string
):
TPromise
<
string
>
{
function
setUpFolder
(
folderName
:
string
,
parentDir
:
string
):
TPromise
<
string
>
{
const
folderDir
=
path
.
join
(
parentDir
,
folderName
);
const
folderDir
=
path
.
join
(
parentDir
,
folderName
);
const
workspaceSettingsDir
=
path
.
join
(
folderDir
,
'
.vscode
'
);
const
workspaceSettingsDir
=
path
.
join
(
folderDir
,
'
.vscode
'
);
return
new
TPromise
((
c
,
e
)
=>
{
return
mkdirp
(
workspaceSettingsDir
,
493
).
then
(()
=>
folderDir
);
extfs
.
mkdirp
(
workspaceSettingsDir
,
493
,
(
error
)
=>
{
if
(
error
)
{
e
(
error
);
return
null
;
}
c
(
folderDir
);
});
});
}
}
function
setUpWorkspace
(
folders
:
string
[]):
TPromise
<
{
parentDir
:
string
,
configPath
:
string
}
>
{
function
setUpWorkspace
(
folders
:
string
[]):
TPromise
<
{
parentDir
:
string
,
configPath
:
string
}
>
{
...
@@ -69,7 +62,7 @@ function setUpWorkspace(folders: string[]): TPromise<{ parentDir: string, config
...
@@ -69,7 +62,7 @@ function setUpWorkspace(folders: string[]): TPromise<{ parentDir: string, config
const
id
=
uuid
.
generateUuid
();
const
id
=
uuid
.
generateUuid
();
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
const
parentDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
id
);
return
createDir
(
parentDir
)
return
mkdirp
(
parentDir
,
493
)
.
then
(()
=>
{
.
then
(()
=>
{
const
configPath
=
path
.
join
(
parentDir
,
'
vsctests.code-workspace
'
);
const
configPath
=
path
.
join
(
parentDir
,
'
vsctests.code-workspace
'
);
const
workspace
=
{
folders
:
folders
.
map
(
path
=>
({
path
}))
};
const
workspace
=
{
folders
:
folders
.
map
(
path
=>
({
path
}))
};
...
@@ -81,17 +74,6 @@ function setUpWorkspace(folders: string[]): TPromise<{ parentDir: string, config
...
@@ -81,17 +74,6 @@ function setUpWorkspace(folders: string[]): TPromise<{ parentDir: string, config
}
}
function
createDir
(
dir
:
string
):
TPromise
<
void
>
{
return
new
TPromise
((
c
,
e
)
=>
{
extfs
.
mkdirp
(
dir
,
493
,
(
error
)
=>
{
if
(
error
)
{
e
(
error
);
return
null
;
}
c
(
null
);
});
});
}
suite
(
'
WorkspaceContextService - Folder
'
,
()
=>
{
suite
(
'
WorkspaceContextService - Folder
'
,
()
=>
{
...
...
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
浏览文件 @
5a318c23
...
@@ -43,6 +43,7 @@ import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybindin
...
@@ -43,6 +43,7 @@ import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybindin
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
interface
Modifiers
{
interface
Modifiers
{
metaKey
?:
boolean
;
metaKey
?:
boolean
;
...
@@ -87,17 +88,9 @@ suite('Keybindings Editing', () => {
...
@@ -87,17 +88,9 @@ suite('Keybindings Editing', () => {
});
});
});
});
function
setUpWorkspace
():
TPromise
<
void
>
{
function
setUpWorkspace
():
TPromise
<
boolean
>
{
return
new
TPromise
<
void
>
((
c
,
e
)
=>
{
testDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
uuid
.
generateUuid
());
testDir
=
path
.
join
(
os
.
tmpdir
(),
'
vsctests
'
,
uuid
.
generateUuid
());
return
mkdirp
(
testDir
,
493
);
extfs
.
mkdirp
(
testDir
,
493
,
(
error
)
=>
{
if
(
error
)
{
e
(
error
);
}
else
{
c
(
null
);
}
});
});
}
}
teardown
(()
=>
{
teardown
(()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录