Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6c5b3dfe
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,发现更多精彩内容 >>
未验证
提交
6c5b3dfe
编写于
9月 21, 2021
作者:
L
Logan Ramos
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update proposed.d.ts
上级
4cc83ad2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
16 deletion
+24
-16
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+1
-1
src/vs/workbench/api/browser/mainThreadEditorTabs.ts
src/vs/workbench/api/browser/mainThreadEditorTabs.ts
+20
-15
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-0
src/vs/workbench/api/common/extHostEditorTabs.ts
src/vs/workbench/api/common/extHostEditorTabs.ts
+2
-0
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
6c5b3dfe
...
...
@@ -2260,7 +2260,7 @@ declare module 'vscode' {
* {@link Tab.resource resource} and {@link Tab.viewId viewId} will
* always be at index 0.
*/
additionalResourcesAndViewIds
?:
{
resource
:
Uri
,
viewId
:
string
}[];
additionalResourcesAndViewIds
:
{
resource
?:
Uri
,
viewId
?
:
string
}[];
/**
* Whether or not the tab is currently active
...
...
src/vs/workbench/api/browser/mainThreadEditorTabs.ts
浏览文件 @
6c5b3dfe
...
...
@@ -8,9 +8,10 @@ import { URI } from 'vs/base/common/uri';
import
{
ExtHostContext
,
IExtHostEditorTabsShape
,
IExtHostContext
,
MainContext
,
IEditorTabDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
{
EditorResourceAccessor
,
SideBySideEditor
}
from
'
vs/workbench/common/editor
'
;
import
{
EditorInput
}
from
'
vs/workbench/common/editor/editorInput
'
;
import
{
SideBySideEditorInput
}
from
'
vs/workbench/common/editor/sideBySideEditorInput
'
;
import
{
editorGroupToColumn
}
from
'
vs/workbench/services/editor/common/editorGroupColumn
'
;
import
{
GroupChangeKind
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
GroupChangeKind
,
IEditorGroup
,
IEditorGroup
sService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorsChangeEvent
,
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
...
...
@@ -39,6 +40,22 @@ export class MainThreadEditorTabs {
this
.
_dispoables
.
dispose
();
}
private
_buildTabObject
(
editor
:
EditorInput
,
group
:
IEditorGroup
):
IEditorTabDto
{
const
tab
:
IEditorTabDto
=
{
viewColumn
:
editorGroupToColumn
(
this
.
_editorGroupsService
,
group
),
label
:
editor
.
getName
(),
resource
:
editor
instanceof
SideBySideEditorInput
?
EditorResourceAccessor
.
getCanonicalUri
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
PRIMARY
})
:
EditorResourceAccessor
.
getCanonicalUri
(
editor
),
editorId
:
editor
instanceof
SideBySideEditorInput
?
editor
.
primary
.
editorId
??
editor
.
editorId
:
editor
.
editorId
,
additionalResourcesAndViewIds
:
[],
isActive
:
(
this
.
_editorGroupsService
.
activeGroup
===
group
)
&&
group
.
isActive
(
editor
)
};
tab
.
additionalResourcesAndViewIds
.
push
({
resource
:
tab
.
resource
,
viewId
:
tab
.
editorId
});
if
(
editor
instanceof
SideBySideEditorInput
)
{
tab
.
additionalResourcesAndViewIds
.
push
({
resource
:
EditorResourceAccessor
.
getCanonicalUri
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
SECONDARY
}),
viewId
:
editor
.
primary
.
editorId
??
editor
.
editorId
});
}
return
tab
;
}
private
_createTabsModel
():
void
{
this
.
_tabModel
.
clear
();
let
tabs
:
IEditorTabDto
[]
=
[];
...
...
@@ -47,13 +64,7 @@ export class MainThreadEditorTabs {
if
(
editor
.
isDisposed
())
{
continue
;
}
const
tab
=
{
viewColumn
:
editorGroupToColumn
(
this
.
_editorGroupsService
,
group
),
label
:
editor
.
getName
(),
resource
:
editor
instanceof
SideBySideEditorInput
?
EditorResourceAccessor
.
getCanonicalUri
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
PRIMARY
})
:
EditorResourceAccessor
.
getCanonicalUri
(
editor
),
editorId
:
editor
.
editorId
,
isActive
:
(
this
.
_editorGroupsService
.
activeGroup
===
group
)
&&
group
.
isActive
(
editor
)
};
const
tab
=
this
.
_buildTabObject
(
editor
,
group
);
if
(
tab
.
isActive
)
{
this
.
_currentlyActiveTab
=
{
groupId
:
group
.
id
,
tab
};
}
...
...
@@ -72,13 +83,7 @@ export class MainThreadEditorTabs {
this
.
_tabModel
.
set
(
event
.
groupId
,
[]);
}
const
editor
=
event
.
editor
;
const
tab
=
{
viewColumn
:
editorGroupToColumn
(
this
.
_editorGroupsService
,
event
.
groupId
),
label
:
editor
.
getName
(),
resource
:
editor
instanceof
SideBySideEditorInput
?
EditorResourceAccessor
.
getCanonicalUri
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
PRIMARY
})
:
EditorResourceAccessor
.
getCanonicalUri
(
editor
),
editorId
:
editor
.
editorId
,
isActive
:
(
this
.
_editorGroupsService
.
activeGroup
.
id
===
event
.
groupId
)
&&
this
.
_editorGroupsService
.
activeGroup
.
isActive
(
editor
)
};
const
tab
=
this
.
_buildTabObject
(
editor
,
this
.
_editorGroupsService
.
getGroup
(
event
.
groupId
)
??
this
.
_editorGroupsService
.
activeGroup
);
this
.
_tabModel
.
get
(
event
.
groupId
)?.
splice
(
event
.
editorIndex
,
0
,
tab
);
// Update the currently active tab which may or may not be the opened one
if
(
tab
.
isActive
)
{
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
6c5b3dfe
...
...
@@ -645,6 +645,7 @@ export interface IEditorTabDto {
resource
?:
UriComponents
;
editorId
?:
string
;
isActive
:
boolean
;
additionalResourcesAndViewIds
:
{
resource
?:
UriComponents
,
viewId
?:
string
}[]
}
export
interface
IExtHostEditorTabsShape
{
...
...
src/vs/workbench/api/common/extHostEditorTabs.ts
浏览文件 @
6c5b3dfe
...
...
@@ -18,6 +18,7 @@ export interface IEditorTab {
resource
?:
vscode
.
Uri
;
viewId
?:
string
;
isActive
:
boolean
;
additionalResourcesAndViewIds
:
{
resource
?:
vscode
.
Uri
,
viewId
?:
string
}[]
}
export
interface
IExtHostEditorTabs
extends
IExtHostEditorTabsShape
{
...
...
@@ -61,6 +62,7 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs {
viewColumn
:
typeConverters
.
ViewColumn
.
to
(
dto
.
viewColumn
),
index
,
resource
:
URI
.
revive
(
dto
.
resource
),
additionalResourcesAndViewIds
:
dto
.
additionalResourcesAndViewIds
.
map
(({
resource
,
viewId
})
=>
({
resource
:
URI
.
revive
(
resource
),
viewId
})),
viewId
:
dto
.
editorId
,
isActive
:
dto
.
isActive
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录