Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0031078b
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,发现更多精彩内容 >>
提交
0031078b
编写于
10月 18, 2016
作者:
P
Pine Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up
上级
88e869a9
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
14 addition
and
55 deletion
+14
-55
src/vs/platform/actions/browser/menusExtensionPoint.ts
src/vs/platform/actions/browser/menusExtensionPoint.ts
+0
-1
src/vs/platform/explorers/browser/explorerExtensionPoint.ts
src/vs/platform/explorers/browser/explorerExtensionPoint.ts
+1
-1
src/vs/workbench/api/node/extHostTreeExplorers.ts
src/vs/workbench/api/node/extHostTreeExplorers.ts
+1
-1
src/vs/workbench/api/node/mainThreadTreeExplorers.ts
src/vs/workbench/api/node/mainThreadTreeExplorers.ts
+1
-1
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+0
-1
src/vs/workbench/browser/viewlet.ts
src/vs/workbench/browser/viewlet.ts
+1
-1
src/vs/workbench/parts/explorers/browser/treeExplorerActions.contribution.ts
...rts/explorers/browser/treeExplorerActions.contribution.ts
+3
-7
src/vs/workbench/parts/explorers/browser/treeExplorerService.ts
.../workbench/parts/explorers/browser/treeExplorerService.ts
+0
-2
src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts
.../workbench/parts/explorers/browser/treeExplorerViewlet.ts
+4
-21
src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts
...rkbench/parts/explorers/browser/views/treeExplorerView.ts
+2
-12
src/vs/workbench/parts/explorers/browser/views/treeExplorerViewer.ts
...bench/parts/explorers/browser/views/treeExplorerViewer.ts
+1
-7
未找到文件。
src/vs/platform/actions/browser/menusExtensionPoint.ts
浏览文件 @
0031078b
...
...
@@ -14,7 +14,6 @@ import { forEach } from 'vs/base/common/collections';
import
{
IExtensionPointUser
,
IExtensionMessageCollector
,
ExtensionsRegistry
}
from
'
vs/platform/extensions/common/extensionsRegistry
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
MenuId
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
namespace
schema
{
...
...
src/vs/platform/explorers/browser/explorerExtensionPoint.ts
浏览文件 @
0031078b
...
...
@@ -74,4 +74,4 @@ ExtensionsRegistry.registerExtensionPoint<schema.IExplorer>('explorer', schema.e
));
}
Registry
.
as
<
ViewletRegistry
>
(
ViewletExtensions
.
Viewlets
).
registerExternalViewlets
(
descriptors
);
})
\ No newline at end of file
});
\ No newline at end of file
src/vs/workbench/api/node/extHostTreeExplorers.ts
浏览文件 @
0031078b
...
...
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
Disposable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
MainContext
,
ExtHostTreeExplorersShape
,
MainThreadTreeExplorersShape
}
from
'
./extHost.protocol
'
;
import
{
InternalTreeExplorerNode
,
TreeExplorerNodeContent
}
from
'
vs/workbench/parts/explorers/common/treeExplorerViewModel
'
;
import
{
InternalTreeExplorerNode
}
from
'
vs/workbench/parts/explorers/common/treeExplorerViewModel
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/node/extHostCommands
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
...
...
src/vs/workbench/api/node/mainThreadTreeExplorers.ts
浏览文件 @
0031078b
...
...
@@ -31,7 +31,7 @@ export class MainThreadTreeExplorers extends MainThreadTreeExplorersShape {
return
this
.
_proxy
.
$provideRootNode
(
providerId
).
then
(
treeContent
=>
{
this
.
_treeContents
[
providerId
]
=
treeContent
;
return
treeContent
;
})
})
;
},
resolveChildren
:
(
node
:
InternalTreeExplorerNode
):
TPromise
<
InternalTreeExplorerNode
[]
>
=>
{
return
this
.
_proxy
.
$resolveChildren
(
providerId
,
node
);
...
...
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
0031078b
...
...
@@ -167,7 +167,6 @@ export class ActivitybarPart extends Part implements IActivityService {
}
private
toAction
(
composite
:
ViewletDescriptor
):
ActivityAction
{
const
activeViewlet
=
this
.
viewletService
.
getActiveViewlet
();
const
action
=
this
.
instantiationService
.
createInstance
(
ViewletActivityAction
,
composite
.
id
+
'
.activity-bar-action
'
,
composite
);
this
.
activityActionItems
[
action
.
id
]
=
new
ActivityActionItem
(
action
,
composite
.
name
,
this
.
getKeybindingLabel
(
composite
.
id
));
...
...
src/vs/workbench/browser/viewlet.ts
浏览文件 @
0031078b
...
...
@@ -7,7 +7,7 @@ import nls = require('vs/nls');
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Dimension
,
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
IAction
,
IActionRunner
,
Action
}
from
'
vs/base/common/actions
'
;
...
...
src/vs/workbench/parts/explorers/browser/treeExplorerActions.contribution.ts
浏览文件 @
0031078b
...
...
@@ -7,10 +7,9 @@
import
*
as
nls
from
'
vs/nls
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
ViewletRegistry
,
Extensions
as
ViewletExtensions
,
ViewletDescriptor
,
ToggleViewletAction
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actionRegistry
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IAction
,
IActionRunner
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IQuickOpenService
,
IPickOpenEntry
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IActivityService
}
from
'
vs/workbench/services/activity/common/activityService
'
;
...
...
@@ -20,8 +19,6 @@ export class ToggleExternalViewletAction extends Action {
public
static
ID
=
'
workbench.view.customTreeExplorerViewlet
'
;
public
static
LABEL
=
nls
.
localize
(
'
toggleCustomExplorer
'
,
'
Toggle Custom Explorer
'
);
private
viewletId
:
string
;
constructor
(
id
:
string
,
label
:
string
,
...
...
@@ -38,13 +35,12 @@ export class ToggleExternalViewletAction extends Action {
for
(
let
viewletId
in
viewletsToggleStataus
)
{
picks
.
push
({
id
:
viewletId
,
label
:
(
viewletsToggleStataus
[
viewletId
]
?
"
Disable
"
:
"
Enable
"
)
+
this
.
getShortViewletId
(
viewletId
),
description
:
""
label
:
(
viewletsToggleStataus
[
viewletId
]
?
"
Disable
"
:
"
Enable
"
)
+
this
.
getShortViewletId
(
viewletId
)
});
}
return
TPromise
.
timeout
(
50
).
then
(()
=>
{
this
.
quickOpenService
.
pick
(
picks
,
{
placeHolder
:
'
select viewlet to enab
le
'
,
autoFocus
:
2
}).
then
(
pick
=>
{
this
.
quickOpenService
.
pick
(
picks
,
{
placeHolder
:
'
Select Viewlet to togg
le
'
,
autoFocus
:
2
}).
then
(
pick
=>
{
if
(
pick
)
{
this
.
activityService
.
toggleViewlet
(
pick
.
id
);
}
...
...
src/vs/workbench/parts/explorers/browser/treeExplorerService.ts
浏览文件 @
0031078b
...
...
@@ -4,9 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
TreeExplorerNodeProvider
}
from
'
vscode
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IInstantiationService
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
InternalTreeExplorerNode
,
InternalTreeExplorerNodeProvider
}
from
'
vs/workbench/parts/explorers/common/treeExplorerViewModel
'
;
...
...
src/vs/workbench/parts/explorers/browser/treeExplorerViewlet.ts
浏览文件 @
0031078b
...
...
@@ -6,14 +6,10 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
SplitView
,
Orientation
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
Orientation
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
IViewletView
,
Viewlet
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TreeExplorerView
}
from
'
vs/workbench/parts/explorers/browser/views/treeExplorerView
'
;
import
{
TreeExplorerViewletState
}
from
'
vs/workbench/parts/explorers/browser/views/treeExplorerViewer
'
;
...
...
@@ -32,7 +28,6 @@ export class TreeExplorerViewlet extends Viewlet {
constructor
(
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
super
(
ID
,
telemetryService
);
...
...
@@ -48,8 +43,7 @@ export class TreeExplorerViewlet extends Viewlet {
this
.
viewletContainer
=
parent
.
div
().
addClass
(
'
custom-tree-explorer-viewlet
'
);
this
.
addTreeView
(
TREE_NAME
);
const
settings
=
this
.
configurationService
.
getConfiguration
<
ICustomViewletConfiguration
>
();
return
this
.
onConfigurationUpdated
(
settings
);
return
TPromise
.
as
(
null
);
}
layout
(
dimension
:
Dimension
):
void
{
...
...
@@ -59,15 +53,11 @@ export class TreeExplorerViewlet extends Viewlet {
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
return
super
.
setVisible
(
visible
).
then
(()
=>
{
this
.
view
.
setVisible
(
visible
).
done
();
})
}
private
onConfigurationUpdated
(
config
:
ICustomViewletConfiguration
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
});
}
private
addTreeView
(
treeName
:
string
):
void
{
//
0 for now, add back header later if needed
//
Hide header (root node) by default
const
headerSize
=
0
;
this
.
view
=
this
.
instantiationService
.
createInstance
(
TreeExplorerView
,
this
.
viewletState
,
treeName
,
this
.
getActionRunner
(),
headerSize
);
...
...
@@ -77,11 +67,4 @@ export class TreeExplorerViewlet extends Viewlet {
dispose
():
void
{
this
.
view
=
null
;
}
}
export
interface
ICustomViewletConfiguration
{
viewlet
:
{
}
}
\ No newline at end of file
src/vs/workbench/parts/explorers/browser/views/treeExplorerView.ts
浏览文件 @
0031078b
...
...
@@ -5,15 +5,11 @@
'
use strict
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
labels
=
require
(
'
vs/base/common/labels
'
);
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
CollapsibleViewletView
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
IActionRunner
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -23,18 +19,12 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
ITreeExplorerService
}
from
'
vs/workbench/parts/explorers/browser/treeExplorerService
'
;
import
{
ITree
,
IDataSource
,
IRenderer
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
ITree
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
Tree
}
from
'
vs/base/parts/tree/browser/treeImpl
'
;
import
{
DefaultController
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
TreeExplorerViewletState
,
TreeDataSource
,
TreeRenderer
,
TreeController
}
from
'
vs/workbench/parts/explorers/browser/views/treeExplorerViewer
'
;
import
{
FileEditorInput
}
from
'
vs/workbench/parts/files/common/editors/fileEditorInput
'
;
import
{
InternalTreeExplorerNode
}
from
'
vs/workbench/parts/explorers/common/treeExplorerViewModel
'
;
export
class
TreeExplorerView
extends
CollapsibleViewletView
{
private
workspace
:
IWorkspace
;
private
treeViewer
:
ITree
;
private
viewletState
:
TreeExplorerViewletState
;
...
...
@@ -114,7 +104,7 @@ export class TreeExplorerView extends CollapsibleViewletView {
private
updateInput
():
TPromise
<
void
>
{
return
this
.
treeExplorerViewletService
.
provideTreeContent
(
'
pineTree
'
).
then
(
tree
=>
{
this
.
tree
.
setInput
(
tree
);
})
})
;
}
public
getOptimalWidth
():
number
{
...
...
src/vs/workbench/parts/explorers/browser/views/treeExplorerViewer.ts
浏览文件 @
0031078b
...
...
@@ -6,24 +6,18 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
$
,
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
ITree
,
IDataSource
,
IRenderer
,
IElementCallback
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
Tree
}
from
'
vs/base/parts/tree/browser/treeImpl
'
;
import
{
InternalTreeExplorerNode
}
from
'
vs/workbench/parts/explorers/common/treeExplorerViewModel
'
;
import
{
ClickBehavior
,
DefaultController
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IActionProvider
,
ActionsRenderer
}
from
'
vs/base/parts/tree/browser/actionsRenderer
'
;
import
{
ContributableActionProvider
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IExtensionService
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
ITreeExplorerService
}
from
'
vs/workbench/parts/explorers/browser/treeExplorerService
'
;
const
providerId
=
'
pineTree
'
;
// For now
export
class
TreeDataSource
implements
IDataSource
{
constructor
(
@
ITreeExplorerService
private
treeExplorerViewletService
:
ITreeExplorerService
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录