Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
48daad51
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,发现更多精彩内容 >>
提交
48daad51
编写于
2月 20, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pfs, extfs: add statLink
上级
e3a88e9f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
12 deletion
+38
-12
src/vs/base/node/extfs.ts
src/vs/base/node/extfs.ts
+21
-1
src/vs/base/node/pfs.ts
src/vs/base/node/pfs.ts
+10
-0
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider.ts
...les/electron-browser/views/explorerDecorationsProvider.ts
+2
-2
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+4
-8
未找到文件。
src/vs/base/node/extfs.ts
浏览文件 @
48daad51
...
...
@@ -43,6 +43,26 @@ export function readdir(path: string, callback: (error: Error, files: string[])
return
fs
.
readdir
(
path
,
callback
);
}
export
function
statLink
(
path
:
string
,
callback
:
(
error
:
Error
,
statAndIsLink
:
{
stat
:
fs
.
Stats
,
isSymbolicLink
:
boolean
})
=>
void
):
void
{
fs
.
lstat
(
path
,
(
error
,
stat
)
=>
{
if
(
error
)
{
return
callback
(
error
,
null
);
}
if
(
stat
.
isSymbolicLink
())
{
fs
.
stat
(
path
,
(
error
,
stat
)
=>
{
if
(
error
)
{
return
callback
(
error
,
null
);
}
callback
(
null
,
{
stat
,
isSymbolicLink
:
true
});
});
}
else
{
callback
(
null
,
{
stat
,
isSymbolicLink
:
false
});
}
});
}
export
function
copy
(
source
:
string
,
target
:
string
,
callback
:
(
error
:
Error
)
=>
void
,
copiedSources
?:
{
[
path
:
string
]:
boolean
}):
void
{
if
(
!
copiedSources
)
{
copiedSources
=
Object
.
create
(
null
);
...
...
@@ -628,4 +648,4 @@ export function watch(path: string, onChange: (type: string, path: string) => vo
}
return
void
0
;
}
\ No newline at end of file
}
src/vs/base/node/pfs.ts
浏览文件 @
48daad51
...
...
@@ -54,6 +54,16 @@ export function stat(path: string): TPromise<fs.Stats> {
return
nfcall
(
fs
.
stat
,
path
);
}
export
function
statLink
(
path
:
string
):
TPromise
<
{
stat
:
fs
.
Stats
,
isSymbolicLink
:
boolean
}
>
{
return
nfcall
(
fs
.
lstat
,
path
).
then
((
stat
:
fs
.
Stats
)
=>
{
if
(
stat
.
isSymbolicLink
())
{
return
nfcall
(
fs
.
stat
,
path
).
then
(
stat
=>
({
stat
,
isSymbolicLink
:
true
}));
}
return
{
stat
,
isSymbolicLink
:
false
};
});
}
export
function
lstat
(
path
:
string
):
TPromise
<
fs
.
Stats
>
{
return
nfcall
(
fs
.
lstat
,
path
);
}
...
...
src/vs/platform/files/common/files.ts
浏览文件 @
48daad51
...
...
@@ -411,7 +411,7 @@ export interface IFileStat extends IBaseStat {
isDirectory
:
boolean
;
/**
* The resource is a s
i
mbolic link.
* The resource is a s
y
mbolic link.
*/
isSymbolicLink
?:
boolean
;
...
...
src/vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider.ts
浏览文件 @
48daad51
...
...
@@ -41,8 +41,8 @@ export class ExplorerDecorationsProvider implements IDecorationsProvider {
}
if
(
fileStat
&&
fileStat
.
isSymbolicLink
)
{
return
{
tooltip
:
localize
(
'
symbolicLlink
'
,
"
Symbolic
l
ink
"
),
letter
:
'
\
u2
1f2
'
tooltip
:
localize
(
'
symbolicLlink
'
,
"
Symbolic
L
ink
"
),
letter
:
'
\
u2
937
'
};
}
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
48daad51
...
...
@@ -1233,13 +1233,9 @@ export class StatResolver {
},
function
stat
(
this
:
any
):
void
{
fs
.
lstat
(
fileResource
.
fsPath
,
(
error
,
stat
)
=>
{
isSymbolicLink
=
stat
.
isSymbolicLink
();
if
(
isSymbolicLink
)
{
fs
.
stat
(
fileResource
.
fsPath
,
this
);
}
else
{
this
(
null
,
stat
);
}
extfs
.
statLink
(
fileResource
.
fsPath
,
(
error
:
Error
,
statAndIsLink
)
=>
{
isSymbolicLink
=
statAndIsLink
.
isSymbolicLink
;
this
(
null
,
statAndIsLink
.
stat
);
});
},
...
...
@@ -1259,7 +1255,7 @@ export class StatResolver {
const
childStat
:
IFileStat
=
{
resource
:
fileResource
,
isDirectory
:
fileStat
.
isDirectory
(),
isSymbolicLink
:
isSymbolicLink
,
isSymbolicLink
,
name
:
file
,
mtime
:
fileStat
.
mtime
.
getTime
(),
etag
:
etag
(
fileStat
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录