Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7a5890ca
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,发现更多精彩内容 >>
提交
7a5890ca
编写于
3月 10, 2017
作者:
S
sj.hwang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change space to pass Hygiene
上级
a2c3e9b3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
68 addition
and
68 deletion
+68
-68
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+68
-68
未找到文件。
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
7a5890ca
...
...
@@ -30,10 +30,10 @@ import * as browser from 'vs/base/browser/browser';
import
{
IIntegrityService
}
from
'
vs/platform/integrity/common/integrity
'
;
import
{
IEntryRunContext
}
from
'
vs/base/parts/quickopen/common/quickOpen
'
;
import
{
ITimerService
,
IStartupMetrics
}
from
'
vs/workbench/services/timer/common/timerService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IPartService
,
Parts
,
Position
as
SidebarPosition
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IPartService
,
Parts
,
Position
as
SidebarPosition
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
*
as
os
from
'
os
'
;
import
{
webFrame
}
from
'
electron
'
;
...
...
@@ -924,103 +924,103 @@ export class ToggleSharedProcessAction extends Action {
}
}
export
abstract
class
BaseNavigationAction
extends
Action
{
export
abstract
class
BaseNavigationAction
extends
Action
{
constructor
(
id
:
string
,
label
:
string
,
@
IWorkbenchEditorService
protected
editorService
:
IWorkbenchEditorService
,
@
IEditorGroupService
protected
groupService
:
IEditorGroupService
,
@
IPanelService
protected
panelService
:
IPanelService
,
@
IPartService
protected
partService
:
IPartService
,
@
IViewletService
protected
viewletService
:
IViewletService
)
{
super
(
id
,
label
);
}
public
run
():
TPromise
<
any
>
{
const
isEditorFocus
=
this
.
partService
.
hasFocus
(
Parts
.
EDITOR_PART
);
const
isPanelFocus
=
this
.
partService
.
hasFocus
(
Parts
.
PANEL_PART
);
const
isSidebarFocus
=
this
.
partService
.
hasFocus
(
Parts
.
SIDEBAR_PART
);
const
isEditorGroupVertical
=
this
.
groupService
.
getGroupOrientation
()
===
'
vertical
'
;
const
isSidebarPositionLeft
=
this
.
partService
.
getSideBarPosition
()
===
SidebarPosition
.
LEFT
;
if
(
isEditorFocus
)
{
return
this
.
navigateOnEditorFocus
(
isEditorGroupVertical
,
isSidebarPositionLeft
);
id
:
string
,
label
:
string
,
@
IWorkbenchEditorService
protected
editorService
:
IWorkbenchEditorService
,
@
IEditorGroupService
protected
groupService
:
IEditorGroupService
,
@
IPanelService
protected
panelService
:
IPanelService
,
@
IPartService
protected
partService
:
IPartService
,
@
IViewletService
protected
viewletService
:
IViewletService
)
{
super
(
id
,
label
);
}
public
run
():
TPromise
<
any
>
{
const
isEditorFocus
=
this
.
partService
.
hasFocus
(
Parts
.
EDITOR_PART
);
const
isPanelFocus
=
this
.
partService
.
hasFocus
(
Parts
.
PANEL_PART
);
const
isSidebarFocus
=
this
.
partService
.
hasFocus
(
Parts
.
SIDEBAR_PART
);
const
isEditorGroupVertical
=
this
.
groupService
.
getGroupOrientation
()
===
'
vertical
'
;
const
isSidebarPositionLeft
=
this
.
partService
.
getSideBarPosition
()
===
SidebarPosition
.
LEFT
;
if
(
isEditorFocus
)
{
return
this
.
navigateOnEditorFocus
(
isEditorGroupVertical
,
isSidebarPositionLeft
);
}
if
(
isPanelFocus
)
{
return
this
.
navigateOnPanelFocus
(
isEditorGroupVertical
,
isSidebarPositionLeft
);
if
(
isPanelFocus
)
{
return
this
.
navigateOnPanelFocus
(
isEditorGroupVertical
,
isSidebarPositionLeft
);
}
if
(
isSidebarFocus
)
{
return
this
.
navigateOnSidebarFocus
(
isEditorGroupVertical
,
isSidebarPositionLeft
);
if
(
isSidebarFocus
)
{
return
this
.
navigateOnSidebarFocus
(
isEditorGroupVertical
,
isSidebarPositionLeft
);
}
return
TPromise
.
as
(
false
);
return
TPromise
.
as
(
false
);
}
protected
navigateOnEditorFocus
(
isEditorGroupVertical
:
boolean
,
isSidebarPositionLeft
:
boolean
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
protected
navigateOnEditorFocus
(
isEditorGroupVertical
:
boolean
,
isSidebarPositionLeft
:
boolean
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
}
protected
navigateOnPanelFocus
(
isEditorGroupVertical
:
boolean
,
isSidebarPositionLeft
:
boolean
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
protected
navigateOnPanelFocus
(
isEditorGroupVertical
:
boolean
,
isSidebarPositionLeft
:
boolean
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
}
protected
navigateOnSidebarFocus
(
isEditorGroupVertical
:
boolean
,
isSidebarPositionLeft
:
boolean
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
protected
navigateOnSidebarFocus
(
isEditorGroupVertical
:
boolean
,
isSidebarPositionLeft
:
boolean
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
}
protected
navigateToPanel
():
TPromise
<
any
>
{
if
(
!
this
.
partService
.
isVisible
(
Parts
.
PANEL_PART
))
{
return
TPromise
.
as
(
false
);
protected
navigateToPanel
():
TPromise
<
any
>
{
if
(
!
this
.
partService
.
isVisible
(
Parts
.
PANEL_PART
))
{
return
TPromise
.
as
(
false
);
}
const
activePanelId
=
this
.
panelService
.
getActivePanel
().
getId
();
return
this
.
panelService
.
openPanel
(
activePanelId
,
true
);
const
activePanelId
=
this
.
panelService
.
getActivePanel
().
getId
();
return
this
.
panelService
.
openPanel
(
activePanelId
,
true
);
}
protected
navigateToSidebar
():
TPromise
<
any
>
{
if
(
!
this
.
partService
.
isVisible
(
Parts
.
SIDEBAR_PART
))
{
return
TPromise
.
as
(
false
);
protected
navigateToSidebar
():
TPromise
<
any
>
{
if
(
!
this
.
partService
.
isVisible
(
Parts
.
SIDEBAR_PART
))
{
return
TPromise
.
as
(
false
);
}
const
activeViewletId
=
this
.
viewletService
.
getActiveViewlet
().
getId
();
return
this
.
viewletService
.
openViewlet
(
activeViewletId
,
true
);
const
activeViewletId
=
this
.
viewletService
.
getActiveViewlet
().
getId
();
return
this
.
viewletService
.
openViewlet
(
activeViewletId
,
true
);
}
protected
navigateToLastActiveEditor
():
TPromise
<
any
>
{
const
model
=
this
.
groupService
.
getStacksModel
();
if
(
model
.
groups
.
length
<
1
)
{
return
null
;
protected
navigateToLastActiveEditor
():
TPromise
<
any
>
{
const
model
=
this
.
groupService
.
getStacksModel
();
if
(
model
.
groups
.
length
<
1
)
{
return
null
;
}
const
lastGroup
=
model
.
activeGroup
;
const
activeEditor
=
lastGroup
.
activeEditor
;
return
this
.
editorService
.
openEditor
(
activeEditor
,
null
,
model
.
positionOfGroup
(
lastGroup
));
const
lastGroup
=
model
.
activeGroup
;
const
activeEditor
=
lastGroup
.
activeEditor
;
return
this
.
editorService
.
openEditor
(
activeEditor
,
null
,
model
.
positionOfGroup
(
lastGroup
));
}
protected
navigateToStartOfEditor
():
TPromise
<
any
>
{
const
model
=
this
.
groupService
.
getStacksModel
();
if
(
model
.
groups
.
length
<
1
)
{
return
null
;
protected
navigateToStartOfEditor
():
TPromise
<
any
>
{
const
model
=
this
.
groupService
.
getStacksModel
();
if
(
model
.
groups
.
length
<
1
)
{
return
null
;
}
const
firstGroup
=
model
.
getGroup
(
0
);
const
firstEditor
=
firstGroup
.
getEditor
(
0
);
return
this
.
editorService
.
openEditor
(
firstEditor
,
null
,
model
.
positionOfGroup
(
firstGroup
));
const
firstGroup
=
model
.
getGroup
(
0
);
const
firstEditor
=
firstGroup
.
getEditor
(
0
);
return
this
.
editorService
.
openEditor
(
firstEditor
,
null
,
model
.
positionOfGroup
(
firstGroup
));
}
protected
navigateToEndOfEditor
():
TPromise
<
any
>
{
const
model
=
this
.
groupService
.
getStacksModel
();
if
(
model
.
groups
.
length
<
1
)
{
return
null
;
protected
navigateToEndOfEditor
():
TPromise
<
any
>
{
const
model
=
this
.
groupService
.
getStacksModel
();
if
(
model
.
groups
.
length
<
1
)
{
return
null
;
}
const
lastGroup
=
model
.
getGroup
(
model
.
groups
[
model
.
groups
.
length
-
1
].
id
);
const
lastEditor
=
lastGroup
.
getEditor
(
lastGroup
.
count
-
1
);
return
this
.
editorService
.
openEditor
(
lastEditor
,
null
,
model
.
positionOfGroup
(
lastGroup
));
const
lastGroup
=
model
.
getGroup
(
model
.
groups
[
model
.
groups
.
length
-
1
].
id
);
const
lastEditor
=
lastGroup
.
getEditor
(
lastGroup
.
count
-
1
);
return
this
.
editorService
.
openEditor
(
lastEditor
,
null
,
model
.
positionOfGroup
(
lastGroup
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录