Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a579bb36
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,发现更多精彩内容 >>
提交
a579bb36
编写于
5月 03, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use same code path in accept for trying to update
上级
9bd21e3f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
43 deletion
+24
-43
src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts
...vs/workbench/services/dialogs/browser/remoteFileDialog.ts
+24
-43
未找到文件。
src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts
浏览文件 @
a579bb36
...
...
@@ -350,54 +350,34 @@ export class RemoteFileDialog {
}
private
async
onDidAccept
():
Promise
<
URI
|
undefined
>
{
this
.
filePickBox
.
busy
=
true
;
let
resolveValue
:
URI
|
undefined
;
let
navigateValue
:
URI
|
undefined
;
let
inputUri
:
URI
|
undefined
;
let
inputUriDirname
:
URI
|
undefined
;
let
stat
:
IFileStat
|
undefined
;
let
statDirname
:
IFileStat
|
undefined
;
try
{
inputUri
=
resources
.
removeTrailingPathSeparator
(
this
.
filePickBoxValue
());
inputUriDirname
=
resources
.
dirname
(
inputUri
);
statDirname
=
await
this
.
fileService
.
resolve
(
inputUriDirname
);
stat
=
await
this
.
fileService
.
resolve
(
inputUri
);
}
catch
(
e
)
{
// do nothing
let
updateString
:
string
;
let
updateUri
:
URI
;
if
(
this
.
filePickBox
.
activeItems
.
length
===
1
)
{
updateUri
=
this
.
filePickBox
.
selectedItems
[
0
].
uri
;
updateString
=
this
.
pathFromUri
(
updateUri
);
}
else
{
updateString
=
this
.
filePickBox
.
value
;
updateUri
=
this
.
filePickBoxValue
();
}
// If the items have updated, don't try to resolve
if
((
await
this
.
tryUpdateItems
(
updateString
,
updateUri
))
!==
UpdateResult
.
NotUpdated
)
{
return
;
}
this
.
filePickBox
.
busy
=
true
;
let
resolveValue
:
URI
|
undefined
;
// Find resolve value
if
(
this
.
filePickBox
.
activeItems
.
length
===
0
)
{
if
(
!
this
.
requiresTrailing
&&
resources
.
isEqual
(
this
.
currentFolder
,
inputUri
,
true
))
{
resolveValue
=
inputUri
;
}
else
if
(
statDirname
&&
statDirname
.
isDirectory
)
{
resolveValue
=
inputUri
;
}
else
if
(
stat
&&
stat
.
isDirectory
)
{
navigateValue
=
inputUri
;
}
resolveValue
=
this
.
filePickBoxValue
();
}
else
if
(
this
.
filePickBox
.
activeItems
.
length
===
1
)
{
const
item
=
this
.
filePickBox
.
selectedItems
[
0
];
if
(
item
)
{
if
(
!
item
.
isFolder
)
{
resolveValue
=
item
.
uri
;
}
else
{
navigateValue
=
item
.
uri
;
}
}
resolveValue
=
this
.
filePickBox
.
selectedItems
[
0
].
uri
;
}
if
(
navigateValue
)
{
// Try to navigate into the folder.
await
this
.
updateItems
(
navigateValue
,
true
,
this
.
trailing
);
}
else
{
if
(
resolveValue
)
{
resolveValue
=
this
.
addPostfix
(
resolveValue
);
}
if
(
await
this
.
validate
(
resolveValue
))
{
this
.
filePickBox
.
busy
=
false
;
return
resolveValue
;
}
if
(
resolveValue
)
{
resolveValue
=
this
.
addPostfix
(
resolveValue
);
}
if
(
await
this
.
validate
(
resolveValue
))
{
this
.
filePickBox
.
busy
=
false
;
return
resolveValue
;
}
this
.
filePickBox
.
busy
=
false
;
return
undefined
;
...
...
@@ -771,7 +751,7 @@ export class RemoteFileDialog {
private
createBackItem
(
currFolder
:
URI
):
FileQuickPickItem
|
null
{
const
parentFolder
=
resources
.
dirname
(
currFolder
)
!
;
if
(
!
resources
.
isEqual
(
currFolder
,
parentFolder
,
true
))
{
return
{
label
:
'
..
'
,
uri
:
resources
.
dirname
(
curr
Folder
),
isFolder
:
true
};
return
{
label
:
'
..
'
,
uri
:
this
.
ensureTrailingSeparator
(
parent
Folder
),
isFolder
:
true
};
}
return
null
;
}
...
...
@@ -829,6 +809,7 @@ export class RemoteFileDialog {
const
stat
=
await
this
.
fileService
.
resolve
(
fullPath
);
if
(
stat
.
isDirectory
)
{
filename
=
this
.
basenameWithTrailingSlash
(
fullPath
);
fullPath
=
this
.
ensureTrailingSeparator
(
fullPath
);
return
{
label
:
filename
,
uri
:
fullPath
,
isFolder
:
true
,
iconClasses
:
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
fullPath
||
undefined
,
FileKind
.
FOLDER
)
};
}
else
if
(
!
stat
.
isDirectory
&&
this
.
allowFileSelection
&&
this
.
filterFile
(
fullPath
))
{
return
{
label
:
filename
,
uri
:
fullPath
,
isFolder
:
false
,
iconClasses
:
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
fullPath
||
undefined
)
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录