Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
641adcca
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,体验更适合开发者的 AI 搜索 >>
提交
641adcca
编写于
2月 08, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix strict null from dialog change
上级
d5e86e79
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
41 deletion
+41
-41
src/vs/workbench/services/dialogs/electron-browser/dialogService.ts
...kbench/services/dialogs/electron-browser/dialogService.ts
+1
-1
src/vs/workbench/services/dialogs/electron-browser/remoteFileDialog.ts
...nch/services/dialogs/electron-browser/remoteFileDialog.ts
+22
-20
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
...ench/services/files/electron-browser/remoteFileService.ts
+1
-1
src/vs/workbench/services/label/common/labelService.ts
src/vs/workbench/services/label/common/labelService.ts
+17
-19
未找到文件。
src/vs/workbench/services/dialogs/electron-browser/dialogService.ts
浏览文件 @
641adcca
...
...
@@ -331,7 +331,7 @@ export class RemoteFileDialogService extends FileDialogService {
super
(
windowService
,
contextService
,
historyService
,
environmentService
,
instantiationService
);
}
public
showSaveDialog
(
options
:
ISaveDialogOptions
):
Promise
<
URI
>
{
public
showSaveDialog
(
options
:
ISaveDialogOptions
):
Promise
<
URI
|
undefined
>
{
const
defaultUri
=
options
.
defaultUri
;
if
(
defaultUri
&&
defaultUri
.
scheme
===
REMOTE_HOST_SCHEME
)
{
return
this
.
showSaveRemoteDialog
(
options
);
...
...
src/vs/workbench/services/dialogs/electron-browser/remoteFileDialog.ts
浏览文件 @
641adcca
...
...
@@ -35,7 +35,7 @@ export class RemoteFileDialog {
private
filePickBox
:
IQuickPick
<
FileQuickPickItem
>
;
private
allowFileSelection
:
boolean
;
private
allowFolderSelection
:
boolean
;
private
remoteAuthority
:
string
;
private
remoteAuthority
:
string
|
undefined
;
constructor
(
@
IFileService
private
readonly
remoteFileService
:
RemoteFileService
,
...
...
@@ -49,10 +49,10 @@ export class RemoteFileDialog {
this
.
remoteAuthority
=
this
.
windowService
.
getConfiguration
().
remoteAuthority
;
}
public
async
showOpenDialog
(
options
:
IOpenDialogOptions
=
{}):
Promise
<
undefine
d
>
{
public
async
showOpenDialog
(
options
:
IOpenDialogOptions
=
{}):
Promise
<
voi
d
>
{
if
(
!
this
.
remoteAuthority
)
{
this
.
notificationService
.
info
(
nls
.
localize
(
'
remoteFileDialog.notConnectedToRemote
'
,
'
Not connected to a remote.
'
));
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
();
}
const
defaultUri
=
options
.
defaultUri
?
options
.
defaultUri
:
URI
.
from
({
scheme
:
REMOTE_HOST_SCHEME
,
authority
:
this
.
remoteAuthority
,
path
:
'
/
'
});
const
title
=
nls
.
localize
(
'
remoteFileDialog.openTitle
'
,
'
Open File or Folder
'
);
...
...
@@ -63,11 +63,11 @@ export class RemoteFileDialog {
return
this
.
windowService
.
openWindow
([{
uri
:
fileFolderUri
,
typeHint
:
'
folder
'
}]);
}
else
{
return
this
.
editorService
.
openEditor
({
resource
:
fileFolderUri
}).
then
(()
=>
{
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
();
});
}
}
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
();
});
}
...
...
@@ -206,18 +206,20 @@ export class RemoteFileDialog {
}
}
private
updateItems
(
newFolder
:
URI
)
{
this
.
currentFolder
=
newFolder
;
this
.
filePickBox
.
placeholder
=
this
.
labelService
.
getUriLabel
(
newFolder
,
{
endWithSeparator
:
true
});
this
.
filePickBox
.
value
=
''
;
this
.
filePickBox
.
busy
=
true
;
this
.
createItems
(
this
.
currentFolder
).
then
(
items
=>
{
this
.
filePickBox
.
items
=
items
;
if
(
this
.
allowFolderSelection
)
{
this
.
filePickBox
.
activeItems
=
[];
}
this
.
filePickBox
.
busy
=
false
;
});
private
updateItems
(
newFolder
:
URI
|
null
)
{
if
(
newFolder
)
{
this
.
currentFolder
=
newFolder
;
this
.
filePickBox
.
placeholder
=
this
.
labelService
.
getUriLabel
(
newFolder
,
{
endWithSeparator
:
true
});
this
.
filePickBox
.
value
=
''
;
this
.
filePickBox
.
busy
=
true
;
this
.
createItems
(
this
.
currentFolder
).
then
(
items
=>
{
this
.
filePickBox
.
items
=
items
;
if
(
this
.
allowFolderSelection
)
{
this
.
filePickBox
.
activeItems
=
[];
}
this
.
filePickBox
.
busy
=
false
;
});
}
}
private
isValidBaseName
(
name
:
string
):
boolean
{
...
...
@@ -255,14 +257,14 @@ export class RemoteFileDialog {
private
basenameWithTrailingSlash
(
fullPath
:
URI
):
string
{
const
child
=
this
.
labelService
.
getUriLabel
(
fullPath
,
{
endWithSeparator
:
true
});
const
parent
=
this
.
labelService
.
getUriLabel
(
resources
.
dirname
(
fullPath
),
{
endWithSeparator
:
true
});
const
parent
=
this
.
labelService
.
getUriLabel
(
resources
.
dirname
(
fullPath
)
!
,
{
endWithSeparator
:
true
});
return
child
.
substring
(
parent
.
length
);
}
private
createBackItem
(
currFolder
:
URI
):
FileQuickPickItem
|
null
{
const
parentFolder
=
resources
.
dirname
(
currFolder
);
const
parentFolder
=
resources
.
dirname
(
currFolder
)
!
;
if
(
!
resources
.
isEqual
(
currFolder
,
parentFolder
))
{
return
{
label
:
'
..
'
,
uri
:
resources
.
dirname
(
currFolder
),
isFolder
:
true
};
return
{
label
:
'
..
'
,
uri
:
resources
.
dirname
(
currFolder
)
!
,
isFolder
:
true
};
}
return
null
;
}
...
...
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
浏览文件 @
641adcca
...
...
@@ -213,7 +213,7 @@ export class RemoteFileService extends FileService {
return
resource
.
scheme
===
Schemas
.
file
||
this
.
_provider
.
has
(
resource
.
scheme
);
}
private
_tryParseFileOperationResult
(
err
:
any
):
FileOperationResult
{
private
_tryParseFileOperationResult
(
err
:
any
):
FileOperationResult
|
undefined
{
if
(
!
(
err
instanceof
Error
))
{
return
undefined
;
}
...
...
src/vs/workbench/services/label/common/labelService.ts
浏览文件 @
641adcca
...
...
@@ -136,27 +136,25 @@ export class LabelService implements ILabelService {
return
getPathLabel
(
resource
.
path
,
this
.
environmentService
,
options
.
relative
?
this
.
contextService
:
undefined
);
}
let
label
:
string
;
if
(
options
.
relative
)
{
const
baseResource
=
this
.
contextService
&&
this
.
contextService
.
getWorkspaceFolder
(
resource
);
if
(
baseResource
)
{
let
relativeLabel
:
string
;
if
(
isEqual
(
baseResource
.
uri
,
resource
,
!
isLinux
))
{
relativeLabel
=
''
;
// no label if resources are identical
}
else
{
const
baseResourceLabel
=
this
.
formatUri
(
baseResource
.
uri
,
formatting
,
options
.
noPrefix
);
relativeLabel
=
ltrim
(
this
.
formatUri
(
resource
,
formatting
,
options
.
noPrefix
).
substring
(
baseResourceLabel
.
length
),
formatting
.
separator
);
}
const
hasMultipleRoots
=
this
.
contextService
.
getWorkspace
().
folders
.
length
>
1
;
if
(
hasMultipleRoots
&&
!
options
.
noPrefix
)
{
const
rootName
=
(
baseResource
&&
baseResource
.
name
)
?
baseResource
.
name
:
basenameOrAuthority
(
baseResource
.
uri
);
relativeLabel
=
relativeLabel
?
(
rootName
+
'
•
'
+
relativeLabel
)
:
rootName
;
// always show root basename if there are multiple
}
let
label
:
string
|
undefined
;
const
baseResource
=
this
.
contextService
&&
this
.
contextService
.
getWorkspaceFolder
(
resource
);
if
(
options
.
relative
&&
baseResource
)
{
let
relativeLabel
:
string
;
if
(
isEqual
(
baseResource
.
uri
,
resource
,
!
isLinux
))
{
relativeLabel
=
''
;
// no label if resources are identical
}
else
{
const
baseResourceLabel
=
this
.
formatUri
(
baseResource
.
uri
,
formatting
,
options
.
noPrefix
);
relativeLabel
=
ltrim
(
this
.
formatUri
(
resource
,
formatting
,
options
.
noPrefix
).
substring
(
baseResourceLabel
.
length
),
formatting
.
separator
);
}
label
=
relativeLabel
;
const
hasMultipleRoots
=
this
.
contextService
.
getWorkspace
().
folders
.
length
>
1
;
if
(
hasMultipleRoots
&&
!
options
.
noPrefix
)
{
const
rootName
=
(
baseResource
&&
baseResource
.
name
)
?
baseResource
.
name
:
basenameOrAuthority
(
baseResource
.
uri
);
relativeLabel
=
relativeLabel
?
(
rootName
+
'
•
'
+
relativeLabel
)
:
rootName
;
// always show root basename if there are multiple
}
label
=
relativeLabel
;
}
else
{
label
=
this
.
formatUri
(
resource
,
formatting
,
options
.
noPrefix
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录