Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
afbba481
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,发现更多精彩内容 >>
提交
afbba481
编写于
10月 06, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dependency view: Open extension to the side
上级
af98e43c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
41 addition
and
11 deletion
+41
-11
src/vs/workbench/parts/extensions/electron-browser/dependenciesViewer.ts
...h/parts/extensions/electron-browser/dependenciesViewer.ts
+38
-8
src/vs/workbench/parts/extensions/electron-browser/extensions.ts
...workbench/parts/extensions/electron-browser/extensions.ts
+1
-1
src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchService.ts
...extensions/electron-browser/extensionsWorkbenchService.ts
+2
-2
未找到文件。
src/vs/workbench/parts/extensions/electron-browser/dependenciesViewer.ts
浏览文件 @
afbba481
...
...
@@ -17,8 +17,10 @@ import { domEvent } from 'vs/base/browser/event';
import
{
Keybinding
}
from
'
vs/base/common/keybinding
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
Key
Mod
,
Key
Code
}
from
'
vs/base/common/keyCodes
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
Position
}
from
'
vs/platform/editor/common/editor
'
;
interface
IExtensionTemplateData
{
icon
:
HTMLImageElement
;
...
...
@@ -111,6 +113,8 @@ export class Controller extends DefaultController {
@
IExtensionsWorkbenchService
private
extensionWorkbenchService
:
IExtensionsWorkbenchService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
super
();
this
.
downKeyBindingDispatcher
.
set
(
OpenExtensionToSideAction
.
KEY_BINDING
.
value
,
(
tree
:
ITree
,
event
:
any
)
=>
{
this
.
openExtension
(
tree
.
getFocus
(),
true
);
});
}
protected
onLeftClick
(
tree
:
ITree
,
element
:
IExtensionDependencies
,
event
:
IMouseEvent
):
boolean
{
...
...
@@ -135,7 +139,8 @@ export class Controller extends DefaultController {
getAnchor
:
()
=>
anchor
,
getActions
:
()
=>
{
return
TPromise
.
as
([
this
.
instantiationService
.
createInstance
(
OpenExtensionAction
)]);
return
TPromise
.
as
([
this
.
instantiationService
.
createInstance
(
OpenExtensionAction
),
this
.
instantiationService
.
createInstance
(
OpenExtensionToSideAction
)]);
},
getActionItem
:
()
=>
null
,
...
...
@@ -162,20 +167,22 @@ export class Controller extends DefaultController {
protected
onEnter
(
tree
:
ITree
,
event
:
IKeyboardEvent
):
boolean
{
if
(
super
.
onEnter
(
tree
,
event
))
{
return
this
.
openExtension
(
tree
.
getFocus
());
return
this
.
openExtension
(
tree
.
getFocus
()
,
event
.
ctrlKey
||
event
.
metaKey
);
}
return
false
;
}
private
openExtension
(
element
:
IExtensionDependencies
,
sideByside
:
boolean
=
false
):
boolean
{
this
.
extensionWorkbenchService
.
open
(
element
.
extension
);
this
.
extensionWorkbenchService
.
open
(
element
.
extension
,
sideByside
);
return
true
;
}
private
keybindingForAction
(
id
:
string
):
Keybinding
{
switch
(
id
)
{
case
OpenExtensionAction
.
ID
:
return
new
Keybinding
(
KeyCode
.
Enter
);
return
OpenExtensionAction
.
KEY_BINDING
;
case
OpenExtensionToSideAction
.
ID
:
return
OpenExtensionToSideAction
.
KEY_BINDING
;
}
return
null
;
...
...
@@ -184,14 +191,37 @@ export class Controller extends DefaultController {
class
OpenExtensionAction
extends
Action
{
public
static
ID
=
'
extensions.open.extension
'
;
public
static
ID
=
'
extensions.action.open
'
;
public
static
KEY_BINDING
=
new
Keybinding
(
KeyCode
.
Enter
);
constructor
(@
IExtensionsWorkbenchService
private
extensionsWorkdbenchService
:
IExtensionsWorkbenchService
)
{
super
(
'
extensions.open.extension
'
,
localize
(
'
extensions.open
'
,
"
Open
"
));
super
(
OpenExtensionAction
.
ID
,
localize
(
'
extensions.open
'
,
"
Open
"
));
}
run
(
context
:
{
extension
:
IExtension
,
sideByside
?:
boolean
}):
TPromise
<
any
>
{
run
(
context
:
{
extension
:
IExtension
}):
TPromise
<
any
>
{
this
.
extensionsWorkdbenchService
.
open
(
context
.
extension
);
return
TPromise
.
as
(
null
);
}
}
class
OpenExtensionToSideAction
extends
Action
{
public
static
ID
=
'
extensions.action.openSide
'
;
public
static
KEY_BINDING
=
new
Keybinding
(
KeyMod
.
WinCtrl
|
KeyCode
.
Enter
);
constructor
(@
IExtensionsWorkbenchService
private
extensionsWorkdbenchService
:
IExtensionsWorkbenchService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
)
{
super
(
OpenExtensionToSideAction
.
ID
,
localize
(
'
extensions.openSide
'
,
"
Open to the Side
"
));
this
.
updateEnablement
();
}
private
updateEnablement
():
void
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
RIGHT
);
}
run
(
context
:
{
extension
:
IExtension
}):
TPromise
<
any
>
{
this
.
extensionsWorkdbenchService
.
open
(
context
.
extension
,
true
);
return
TPromise
.
as
(
null
);
}
}
\ No newline at end of file
src/vs/workbench/parts/extensions/electron-browser/extensions.ts
浏览文件 @
afbba481
...
...
@@ -70,7 +70,7 @@ export interface IExtensionsWorkbenchService {
install
(
extension
:
IExtension
,
promptToInstallDependencies
?:
boolean
):
TPromise
<
void
>
;
uninstall
(
extension
:
IExtension
):
TPromise
<
void
>
;
loadDependencies
(
extension
:
IExtension
):
TPromise
<
IExtensionDependencies
>
;
open
(
extension
:
IExtension
):
void
;
open
(
extension
:
IExtension
,
sideByside
?:
boolean
):
void
;
}
export
const
ConfigurationKey
=
'
extensions
'
;
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchService.ts
浏览文件 @
afbba481
...
...
@@ -368,8 +368,8 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
});
}
open
(
extension
:
IExtension
):
void
{
this
.
editorService
.
openEditor
(
this
.
instantiationService
.
createInstance
(
ExtensionsInput
,
extension
))
open
(
extension
:
IExtension
,
sideByside
:
boolean
=
false
):
void
{
this
.
editorService
.
openEditor
(
this
.
instantiationService
.
createInstance
(
ExtensionsInput
,
extension
)
,
null
,
sideByside
)
.
done
(
null
,
err
=>
this
.
onError
(
err
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录