Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1a19cd4d
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1a19cd4d
编写于
1月 17, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Forwarded Ports view visibility for some remotes
上级
fd13e449
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
59 addition
and
35 deletion
+59
-35
src/vs/workbench/browser/parts/views/viewsViewlet.ts
src/vs/workbench/browser/parts/views/viewsViewlet.ts
+23
-9
src/vs/workbench/contrib/remote/browser/explorerViewItems.ts
src/vs/workbench/contrib/remote/browser/explorerViewItems.ts
+11
-9
src/vs/workbench/contrib/remote/browser/remote.ts
src/vs/workbench/contrib/remote/browser/remote.ts
+12
-7
src/vs/workbench/services/remote/common/remoteExplorerService.ts
...workbench/services/remote/common/remoteExplorerService.ts
+13
-10
未找到文件。
src/vs/workbench/browser/parts/views/viewsViewlet.ts
浏览文件 @
1a19cd4d
...
...
@@ -30,11 +30,11 @@ export interface IViewletViewOptions extends IViewPaneOptions {
export
abstract
class
FilterViewPaneContainer
extends
ViewPaneContainer
{
private
constantViewDescriptors
:
Map
<
string
,
IViewDescriptor
>
=
new
Map
();
private
allViews
:
Map
<
string
,
Map
<
string
,
IViewDescriptor
>>
=
new
Map
();
private
filterValue
:
string
|
undefined
;
private
filterValue
:
string
[]
|
undefined
;
constructor
(
viewletId
:
string
,
onDidChangeFilterValue
:
Event
<
string
>
,
onDidChangeFilterValue
:
Event
<
string
[]
>
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
...
...
@@ -67,7 +67,7 @@ export abstract class FilterViewPaneContainer extends ViewPaneContainer {
this
.
allViews
.
set
(
filterOnValue
,
new
Map
());
}
this
.
allViews
.
get
(
filterOnValue
)
!
.
set
(
descriptor
.
id
,
descriptor
);
if
(
filterOnValue
!==
this
.
filterValue
)
{
if
(
this
.
filterValue
&&
!
this
.
filterValue
.
includes
(
filterOnValue
)
)
{
this
.
viewsModel
.
setVisible
(
descriptor
.
id
,
false
);
}
});
...
...
@@ -79,7 +79,7 @@ export abstract class FilterViewPaneContainer extends ViewPaneContainer {
protected
abstract
getFilterOn
(
viewDescriptor
:
IViewDescriptor
):
string
|
undefined
;
private
onFilterChanged
(
newFilterValue
:
string
)
{
private
onFilterChanged
(
newFilterValue
:
string
[]
)
{
if
(
this
.
allViews
.
size
===
0
)
{
this
.
updateAllViews
(
this
.
viewsModel
.
viewDescriptors
);
}
...
...
@@ -107,18 +107,32 @@ export abstract class FilterViewPaneContainer extends ViewPaneContainer {
return
result
;
}
private
getViewsForTarget
(
target
:
string
):
IViewDescriptor
[]
{
return
this
.
allViews
.
has
(
target
)
?
Array
.
from
(
this
.
allViews
.
get
(
target
)
!
.
values
())
:
[];
private
getViewsForTarget
(
target
:
string
[]):
IViewDescriptor
[]
{
const
views
:
IViewDescriptor
[]
=
[];
for
(
let
i
=
0
;
i
<
target
.
length
;
i
++
)
{
if
(
this
.
allViews
.
has
(
target
[
i
]))
{
views
.
push
(...
Array
.
from
(
this
.
allViews
.
get
(
target
[
i
])
!
.
values
()));
}
}
return
views
;
}
private
getViewsNotForTarget
(
target
:
string
):
IViewDescriptor
[]
{
private
getViewsNotForTarget
(
target
:
string
[]
):
IViewDescriptor
[]
{
const
iterable
=
this
.
allViews
.
keys
();
let
key
=
iterable
.
next
();
let
views
:
IViewDescriptor
[]
=
[];
while
(
!
key
.
done
)
{
if
(
key
.
value
!==
target
)
{
views
=
views
.
concat
(
this
.
getViewsForTarget
(
key
.
value
));
let
isForTarget
:
boolean
=
false
;
target
.
forEach
(
value
=>
{
if
(
key
.
value
===
value
)
{
isForTarget
=
true
;
}
});
if
(
!
isForTarget
)
{
views
=
views
.
concat
(
this
.
getViewsForTarget
([
key
.
value
]));
}
key
=
iterable
.
next
();
}
return
views
;
...
...
src/vs/workbench/contrib/remote/browser/explorerViewItems.ts
浏览文件 @
1a19cd4d
...
...
@@ -51,23 +51,25 @@ export class SwitchRemoteViewItem extends SelectActionViewItem {
if
(
this
.
optionsItems
.
length
>
0
)
{
let
index
=
0
;
const
remoteAuthority
=
environmentService
.
configuration
.
remoteAuthority
;
const
explorerType
:
string
|
undefined
=
remoteAuthority
?
remoteAuthority
.
split
(
'
+
'
)[
0
]
:
this
.
storageService
.
get
(
REMOTE_EXPLORER_TYPE_KEY
,
StorageScope
.
WORKSPACE
)
??
this
.
storageService
.
get
(
REMOTE_EXPLORER_TYPE_KEY
,
StorageScope
.
GLOBAL
);
if
(
explorerType
)
{
const
explorerType
:
string
[]
|
undefined
=
remoteAuthority
?
[
remoteAuthority
.
split
(
'
+
'
)[
0
]
]
:
this
.
storageService
.
get
(
REMOTE_EXPLORER_TYPE_KEY
,
StorageScope
.
WORKSPACE
)
?.
split
(
'
,
'
)
??
this
.
storageService
.
get
(
REMOTE_EXPLORER_TYPE_KEY
,
StorageScope
.
GLOBAL
)?.
split
(
'
,
'
);
if
(
explorerType
!==
undefined
)
{
index
=
this
.
getOptionIndexForExplorerType
(
optionsItems
,
explorerType
);
}
this
.
select
(
index
);
remoteExplorerService
.
targetType
=
optionsItems
[
index
].
authority
[
0
]
;
remoteExplorerService
.
targetType
=
optionsItems
[
index
].
authority
;
}
}
private
getOptionIndexForExplorerType
(
optionsItems
:
IRemoteSelectItem
[],
explorerType
:
string
):
number
{
private
getOptionIndexForExplorerType
(
optionsItems
:
IRemoteSelectItem
[],
explorerType
:
string
[]
):
number
{
let
index
=
0
;
for
(
let
optionIterator
=
0
;
(
optionIterator
<
this
.
optionsItems
.
length
)
&&
(
index
===
0
);
optionIterator
++
)
{
for
(
let
authorityIterator
=
0
;
authorityIterator
<
optionsItems
[
optionIterator
].
authority
.
length
;
authorityIterator
++
)
{
if
(
optionsItems
[
optionIterator
].
authority
[
authorityIterator
]
===
explorerType
)
{
index
=
optionIterator
;
break
;
for
(
let
i
=
0
;
i
<
explorerType
.
length
;
i
++
)
{
if
(
optionsItems
[
optionIterator
].
authority
[
authorityIterator
]
===
explorerType
[
i
])
{
index
=
optionIterator
;
break
;
}
}
}
}
...
...
@@ -110,6 +112,6 @@ export class SwitchRemoteAction extends Action {
}
public
async
run
(
item
:
IRemoteSelectItem
):
Promise
<
any
>
{
this
.
remoteExplorerService
.
targetType
=
item
.
authority
[
0
]
;
this
.
remoteExplorerService
.
targetType
=
item
.
authority
;
}
}
src/vs/workbench/contrib/remote/browser/remote.ts
浏览文件 @
1a19cd4d
...
...
@@ -278,13 +278,18 @@ abstract class HelpItemBase implements IHelpItem {
async
handleClick
()
{
const
remoteAuthority
=
this
.
environmentService
.
configuration
.
remoteAuthority
;
if
(
remoteAuthority
&&
startsWith
(
remoteAuthority
,
this
.
remoteExplorerService
.
targetType
))
{
for
(
let
value
of
this
.
values
)
{
if
(
value
.
remoteAuthority
)
{
for
(
let
authority
of
value
.
remoteAuthority
)
{
if
(
startsWith
(
remoteAuthority
,
authority
))
{
await
this
.
takeAction
(
value
.
extensionDescription
,
value
.
url
);
return
;
if
(
!
remoteAuthority
)
{
return
;
}
for
(
let
i
=
0
;
i
<
this
.
remoteExplorerService
.
targetType
.
length
;
i
++
)
{
if
(
startsWith
(
remoteAuthority
,
this
.
remoteExplorerService
.
targetType
[
i
]))
{
for
(
let
value
of
this
.
values
)
{
if
(
value
.
remoteAuthority
)
{
for
(
let
authority
of
value
.
remoteAuthority
)
{
if
(
startsWith
(
remoteAuthority
,
authority
))
{
await
this
.
takeAction
(
value
.
extensionDescription
,
value
.
url
);
return
;
}
}
}
}
...
...
src/vs/workbench/services/remote/common/remoteExplorerService.ts
浏览文件 @
1a19cd4d
...
...
@@ -223,8 +223,8 @@ export class TunnelModel extends Disposable {
export
interface
IRemoteExplorerService
{
_serviceBrand
:
undefined
;
onDidChangeTargetType
:
Event
<
string
>
;
targetType
:
string
;
onDidChangeTargetType
:
Event
<
string
[]
>
;
targetType
:
string
[]
;
readonly
tunnelModel
:
TunnelModel
;
onDidChangeEditable
:
Event
<
ITunnelItem
|
undefined
>
;
setEditable
(
tunnelItem
:
ITunnelItem
|
undefined
,
data
:
IEditableData
|
null
):
void
;
...
...
@@ -238,9 +238,9 @@ export interface IRemoteExplorerService {
class
RemoteExplorerService
implements
IRemoteExplorerService
{
public
_serviceBrand
:
undefined
;
private
_targetType
:
string
=
''
;
private
readonly
_onDidChangeTargetType
:
Emitter
<
string
>
=
new
Emitter
<
string
>
();
public
readonly
onDidChangeTargetType
:
Event
<
string
>
=
this
.
_onDidChangeTargetType
.
event
;
private
_targetType
:
string
[]
=
[]
;
private
readonly
_onDidChangeTargetType
:
Emitter
<
string
[]
>
=
new
Emitter
<
string
[]
>
();
public
readonly
onDidChangeTargetType
:
Event
<
string
[]
>
=
this
.
_onDidChangeTargetType
.
event
;
private
_tunnelModel
:
TunnelModel
;
private
_editable
:
{
tunnelItem
:
ITunnelItem
|
undefined
,
data
:
IEditableData
}
|
undefined
;
private
readonly
_onDidChangeEditable
:
Emitter
<
ITunnelItem
|
undefined
>
=
new
Emitter
();
...
...
@@ -254,15 +254,18 @@ class RemoteExplorerService implements IRemoteExplorerService {
this
.
_tunnelModel
=
new
TunnelModel
(
tunnelService
,
storageService
,
configurationService
);
}
set
targetType
(
name
:
string
)
{
if
(
this
.
_targetType
!==
name
)
{
set
targetType
(
name
:
string
[])
{
// Can just compare the first element of the array since there are no target overlaps
const
current
:
string
=
this
.
_targetType
.
length
>
0
?
this
.
_targetType
[
0
]
:
''
;
const
newName
:
string
=
name
.
length
>
0
?
name
[
0
]
:
''
;
if
(
current
!==
newName
)
{
this
.
_targetType
=
name
;
this
.
storageService
.
store
(
REMOTE_EXPLORER_TYPE_KEY
,
this
.
_targetType
,
StorageScope
.
WORKSPACE
);
this
.
storageService
.
store
(
REMOTE_EXPLORER_TYPE_KEY
,
this
.
_targetType
,
StorageScope
.
GLOBAL
);
this
.
storageService
.
store
(
REMOTE_EXPLORER_TYPE_KEY
,
this
.
_targetType
.
toString
()
,
StorageScope
.
WORKSPACE
);
this
.
storageService
.
store
(
REMOTE_EXPLORER_TYPE_KEY
,
this
.
_targetType
.
toString
()
,
StorageScope
.
GLOBAL
);
this
.
_onDidChangeTargetType
.
fire
(
this
.
_targetType
);
}
}
get
targetType
():
string
{
get
targetType
():
string
[]
{
return
this
.
_targetType
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录