Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
de9a8a67
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,发现更多精彩内容 >>
提交
de9a8a67
编写于
10月 07, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Converting some parts of panel service to return undefined instead of null
上级
ab3f2e61
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
15 addition
and
16 deletion
+15
-16
src/vs/workbench/browser/parts/compositePart.ts
src/vs/workbench/browser/parts/compositePart.ts
+3
-4
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+5
-5
src/vs/workbench/contrib/output/browser/outputServices.ts
src/vs/workbench/contrib/output/browser/outputServices.ts
+1
-1
src/vs/workbench/services/panel/common/panelService.ts
src/vs/workbench/services/panel/common/panelService.ts
+2
-2
src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts
...lectron-browser/api/mainThreadDocumentsAndEditors.test.ts
+1
-1
src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts
...bench/test/electron-browser/api/mainThreadEditors.test.ts
+1
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+2
-2
未找到文件。
src/vs/workbench/browser/parts/compositePart.ts
浏览文件 @
de9a8a67
...
...
@@ -61,7 +61,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
private
mapCompositeToCompositeContainer
=
new
Map
<
string
,
HTMLElement
>
();
private
mapActionsBindingToComposite
=
new
Map
<
string
,
()
=>
void
>
();
private
activeComposite
:
Composite
|
null
;
private
activeComposite
:
Composite
|
undefined
;
private
lastActiveCompositeId
:
string
;
private
instantiatedCompositeItems
:
Map
<
string
,
CompositeItem
>
;
private
titleLabel
:
ICompositeTitleLabel
;
...
...
@@ -90,7 +90,6 @@ export abstract class CompositePart<T extends Composite> extends Part {
)
{
super
(
id
,
options
,
themeService
,
storageService
,
layoutService
);
this
.
activeComposite
=
null
;
this
.
instantiatedCompositeItems
=
new
Map
<
string
,
CompositeItem
>
();
this
.
lastActiveCompositeId
=
storageService
.
get
(
activeCompositeSettingsKey
,
StorageScope
.
WORKSPACE
,
this
.
defaultCompositeId
);
}
...
...
@@ -332,7 +331,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
return
this
.
toolBar
.
setActions
(
prepareActions
(
primaryActions
),
prepareActions
(
secondaryActions
));
}
protected
getActiveComposite
():
IComposite
|
null
{
protected
getActiveComposite
():
IComposite
|
undefined
{
return
this
.
activeComposite
;
}
...
...
@@ -346,7 +345,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
}
const
composite
=
this
.
activeComposite
;
this
.
activeComposite
=
null
;
this
.
activeComposite
=
undefined
;
const
compositeContainer
=
this
.
mapCompositeToCompositeContainer
.
get
(
composite
.
getId
());
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
de9a8a67
...
...
@@ -30,7 +30,7 @@ import { Dimension, trackFocus } from 'vs/base/browser/dom';
import
{
localize
}
from
'
vs/nls
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
isUndefinedOrNull
,
withUndefinedAsNull
,
assertIsDefined
}
from
'
vs/base/common/types
'
;
import
{
isUndefinedOrNull
,
assertIsDefined
}
from
'
vs/base/common/types
'
;
import
{
ILifecycleService
,
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
...
...
@@ -218,9 +218,9 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
}
}
openPanel
(
id
:
string
,
focus
?:
boolean
):
Panel
|
null
{
openPanel
(
id
:
string
,
focus
?:
boolean
):
Panel
|
undefined
{
if
(
this
.
blockOpeningPanel
)
{
return
null
;
// Workaround against a potential race condition
return
undefined
;
// Workaround against a potential race condition
}
// First check if panel is hidden and show if so
...
...
@@ -233,7 +233,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
}
}
return
withUndefinedAsNull
(
this
.
openComposite
(
id
,
focus
)
);
return
this
.
openComposite
(
id
,
focus
);
}
showActivity
(
panelId
:
string
,
badge
:
IBadge
,
clazz
?:
string
):
IDisposable
{
...
...
@@ -263,7 +263,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
];
}
getActivePanel
():
IPanel
|
null
{
getActivePanel
():
IPanel
|
undefined
{
return
this
.
getActiveComposite
();
}
...
...
src/vs/workbench/contrib/output/browser/outputServices.ts
浏览文件 @
de9a8a67
...
...
@@ -155,7 +155,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
}
}
private
onDidPanelOpen
(
panel
:
IPanel
|
null
,
preserveFocus
:
boolean
):
Promise
<
void
>
{
private
onDidPanelOpen
(
panel
:
IPanel
|
undefined
,
preserveFocus
:
boolean
):
Promise
<
void
>
{
if
(
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
)
{
this
.
_outputPanel
=
<
OutputPanel
>
this
.
panelService
.
getActivePanel
();
if
(
this
.
activeChannel
)
{
...
...
src/vs/workbench/services/panel/common/panelService.ts
浏览文件 @
de9a8a67
...
...
@@ -28,12 +28,12 @@ export interface IPanelService {
/**
* Opens a panel with the given identifier and pass keyboard focus to it if specified.
*/
openPanel
(
id
:
string
,
focus
?:
boolean
):
IPanel
|
null
;
openPanel
(
id
:
string
,
focus
?:
boolean
):
IPanel
|
undefined
;
/**
* Returns the current active panel or null if none
*/
getActivePanel
():
IPanel
|
null
;
getActivePanel
():
IPanel
|
undefined
;
/**
* Returns the panel by id.
...
...
src/vs/workbench/test/electron-browser/api/mainThreadDocumentsAndEditors.test.ts
浏览文件 @
de9a8a67
...
...
@@ -79,7 +79,7 @@ suite('MainThreadDocumentsAndEditors', () => {
onDidPanelOpen
=
Event
.
None
;
onDidPanelClose
=
Event
.
None
;
getActivePanel
()
{
return
null
;
return
undefined
;
}
},
TestEnvironmentService
...
...
src/vs/workbench/test/electron-browser/api/mainThreadEditors.test.ts
浏览文件 @
de9a8a67
...
...
@@ -111,7 +111,7 @@ suite('MainThreadEditors', () => {
onDidPanelOpen
=
Event
.
None
;
onDidPanelClose
=
Event
.
None
;
getActivePanel
()
{
return
null
;
return
undefined
;
}
},
TestEnvironmentService
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
de9a8a67
...
...
@@ -626,8 +626,8 @@ export class TestPanelService implements IPanelService {
onDidPanelOpen
=
new
Emitter
<
{
panel
:
IPanel
,
focus
:
boolean
}
>
().
event
;
onDidPanelClose
=
new
Emitter
<
IPanel
>
().
event
;
public
openPanel
(
id
:
string
,
focus
?:
boolean
):
IPanel
{
return
null
!
;
public
openPanel
(
id
:
string
,
focus
?:
boolean
):
undefined
{
return
undefined
;
}
public
getPanel
(
id
:
string
):
any
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录