Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3385ec73
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,发现更多精彩内容 >>
提交
3385ec73
编写于
3月 08, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - declarative context view service
上级
c4de96ce
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
28 addition
and
22 deletion
+28
-22
src/vs/editor/standalone/browser/simpleServices.ts
src/vs/editor/standalone/browser/simpleServices.ts
+6
-0
src/vs/editor/standalone/browser/standaloneServices.ts
src/vs/editor/standalone/browser/standaloneServices.ts
+2
-2
src/vs/platform/contextview/browser/contextViewService.ts
src/vs/platform/contextview/browser/contextViewService.ts
+5
-10
src/vs/platform/layout/browser/layoutService.ts
src/vs/platform/layout/browser/layoutService.ts
+5
-0
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+7
-10
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+2
-0
src/vs/workbench/workbench.main.ts
src/vs/workbench/workbench.main.ts
+1
-0
未找到文件。
src/vs/editor/standalone/browser/simpleServices.ts
浏览文件 @
3385ec73
...
...
@@ -686,4 +686,10 @@ export class SimpleLayoutService implements ILayoutService {
return
this
.
_dimension
;
}
get
container
():
HTMLElement
{
return
this
.
_container
;
}
constructor
(
private
_container
:
HTMLElement
)
{
}
}
src/vs/editor/standalone/browser/standaloneServices.ts
浏览文件 @
3385ec73
...
...
@@ -197,9 +197,9 @@ export class DynamicStandaloneServices extends Disposable {
let
keybindingService
=
ensure
(
IKeybindingService
,
()
=>
this
.
_register
(
new
StandaloneKeybindingService
(
contextKeyService
,
commandService
,
telemetryService
,
notificationService
,
domElement
)));
let
layoutService
=
ensure
(
ILayoutService
,
()
=>
new
SimpleLayoutService
());
let
layoutService
=
ensure
(
ILayoutService
,
()
=>
new
SimpleLayoutService
(
domElement
));
let
contextViewService
=
ensure
(
IContextViewService
,
()
=>
this
.
_register
(
new
ContextViewService
(
domElement
,
telemetryService
,
new
NullLogService
(),
layoutService
)));
let
contextViewService
=
ensure
(
IContextViewService
,
()
=>
this
.
_register
(
new
ContextViewService
(
layoutService
)));
ensure
(
IContextMenuService
,
()
=>
this
.
_register
(
new
ContextMenuService
(
domElement
,
telemetryService
,
notificationService
,
contextViewService
,
keybindingService
,
themeService
)));
...
...
src/vs/platform/contextview/browser/contextViewService.ts
浏览文件 @
3385ec73
...
...
@@ -5,10 +5,9 @@
import
{
IContextViewService
,
IContextViewDelegate
}
from
'
./contextView
'
;
import
{
ContextView
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ILayoutService
}
from
'
vs/platform/layout/browser/layoutService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
export
class
ContextViewService
extends
Disposable
implements
IContextViewService
{
_serviceBrand
:
any
;
...
...
@@ -16,14 +15,11 @@ export class ContextViewService extends Disposable implements IContextViewServic
private
contextView
:
ContextView
;
constructor
(
container
:
HTMLElement
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
ILogService
private
readonly
logService
:
ILogService
,
@
ILayoutService
readonly
layoutService
:
ILayoutService
)
{
super
();
this
.
contextView
=
this
.
_register
(
new
ContextView
(
container
));
this
.
contextView
=
this
.
_register
(
new
ContextView
(
layoutService
.
container
));
this
.
layout
();
this
.
_register
(
layoutService
.
onLayout
(()
=>
this
.
layout
()));
...
...
@@ -32,12 +28,10 @@ export class ContextViewService extends Disposable implements IContextViewServic
// ContextView
setContainer
(
container
:
HTMLElement
):
void
{
this
.
logService
.
trace
(
'
ContextViewService#setContainer
'
);
this
.
contextView
.
setContainer
(
container
);
}
showContextView
(
delegate
:
IContextViewDelegate
):
void
{
this
.
logService
.
trace
(
'
ContextViewService#showContextView
'
);
this
.
contextView
.
show
(
delegate
);
}
...
...
@@ -46,7 +40,8 @@ export class ContextViewService extends Disposable implements IContextViewServic
}
hideContextView
(
data
?:
any
):
void
{
this
.
logService
.
trace
(
'
ContextViewService#hideContextView
'
);
this
.
contextView
.
hide
(
data
);
}
}
\ No newline at end of file
}
registerSingleton
(
IContextViewService
,
ContextViewService
,
true
);
\ No newline at end of file
src/vs/platform/layout/browser/layoutService.ts
浏览文件 @
3385ec73
...
...
@@ -22,6 +22,11 @@ export interface ILayoutService {
*/
readonly
dimension
:
IDimension
;
/**
* Container of the application.
*/
readonly
container
:
HTMLElement
;
/**
* An event that is emitted when the container is layed out. The
* event carries the dimensions of the container as part of it.
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
3385ec73
...
...
@@ -39,7 +39,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
LifecyclePhase
,
StartupKind
,
ILifecycleService
,
WillShutdownEvent
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IWindowService
,
IWindowConfiguration
,
IPath
,
MenuBarVisibility
,
getTitleBarStyle
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
NotificationService
}
from
'
vs/workbench/services/notification/common/notificationService
'
;
...
...
@@ -50,7 +49,6 @@ import { registerNotificationCommands } from 'vs/workbench/browser/parts/notific
import
{
NotificationsToasts
}
from
'
vs/workbench/browser/parts/notifications/notificationsToasts
'
;
import
{
IEditorService
,
IResourceEditor
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
ContextViewService
}
from
'
vs/platform/contextview/browser/contextViewService
'
;
import
{
IWorkbenchThemeService
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
Sizing
,
Direction
,
Grid
,
View
}
from
'
vs/base/browser/ui/grid/grid
'
;
import
{
WorkbenchLegacyLayout
}
from
'
vs/workbench/browser/legacyLayout
'
;
...
...
@@ -151,7 +149,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
private
parts
:
Map
<
string
,
Part
>
=
new
Map
<
string
,
Part
>
();
constructor
(
private
container
:
HTMLElement
,
private
parent
:
HTMLElement
,
private
configuration
:
IWindowConfiguration
,
private
serviceCollection
:
ServiceCollection
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
...
...
@@ -364,9 +362,6 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
const
localizationsChannel
=
getDelayedChannel
(
sharedProcess
.
then
(
c
=>
c
.
getChannel
(
'
localizations
'
)));
serviceCollection
.
set
(
ILocalizationsService
,
new
SyncDescriptor
(
LocalizationsChannelClient
,
[
localizationsChannel
]));
// Context view service
serviceCollection
.
set
(
IContextViewService
,
new
SyncDescriptor
(
ContextViewService
,
[
this
.
workbench
],
true
));
// Contributed services
const
contributedServices
=
getServices
();
for
(
let
contributedService
of
contributedServices
)
{
...
...
@@ -489,7 +484,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
this
.
instantiationService
.
invokeFunction
(
accessor
=>
this
.
createNotificationsHandlers
(
accessor
));
// Add Workbench to DOM
this
.
container
.
appendChild
(
this
.
workbench
);
this
.
parent
.
appendChild
(
this
.
workbench
);
}
private
createTitlebarPart
():
void
{
...
...
@@ -690,6 +685,8 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
private
_dimension
:
IDimension
;
get
dimension
():
IDimension
{
return
this
.
_dimension
;
}
get
container
():
HTMLElement
{
return
this
.
workbench
;
}
private
workbenchGrid
:
Grid
<
View
>
|
WorkbenchLegacyLayout
;
private
titleBarPartView
:
View
;
...
...
@@ -1283,7 +1280,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
}
else
{
this
.
workbenchGrid
=
this
.
instantiationService
.
createInstance
(
WorkbenchLegacyLayout
,
this
.
container
,
this
.
parent
,
this
.
workbench
,
{
titlebar
:
titleBar
,
...
...
@@ -1299,7 +1296,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
layout
(
options
?:
ILayoutOptions
):
void
{
if
(
!
this
.
disposed
)
{
this
.
_dimension
=
getClientArea
(
this
.
container
);
this
.
_dimension
=
getClientArea
(
this
.
parent
);
if
(
this
.
workbenchGrid
instanceof
Grid
)
{
position
(
this
.
workbench
,
0
,
0
,
0
,
0
,
'
relative
'
);
...
...
@@ -1615,7 +1612,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
// Layout
if
(
!
skipLayout
)
{
if
(
this
.
workbenchGrid
instanceof
Grid
)
{
const
dimensions
=
getClientArea
(
this
.
container
);
const
dimensions
=
getClientArea
(
this
.
parent
);
this
.
workbenchGrid
.
layout
(
dimensions
.
width
,
dimensions
.
height
);
}
else
{
this
.
workbenchGrid
.
layout
();
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
3385ec73
...
...
@@ -450,6 +450,8 @@ export class TestLayoutService implements IWorkbenchLayoutService {
dimension
:
IDimension
=
{
width
:
800
,
height
:
600
};
container
:
HTMLElement
=
window
.
document
.
body
;
onZenModeChange
:
Event
<
boolean
>
=
Event
.
None
;
onLayout
=
Event
.
None
;
...
...
src/vs/workbench/workbench.main.ts
浏览文件 @
3385ec73
...
...
@@ -98,6 +98,7 @@ import 'vs/workbench/services/commands/common/commandService';
import
'
vs/workbench/services/themes/browser/workbenchThemeService
'
;
import
'
vs/workbench/services/extensions/electron-browser/extensionService
'
;
import
'
vs/workbench/services/contextmenu/electron-browser/contextmenuService
'
;
import
'
vs/platform/contextview/browser/contextViewService
'
;
registerSingleton
(
IMenuService
,
MenuService
,
true
);
registerSingleton
(
IListService
,
ListService
,
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录