Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1d97b724
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,发现更多精彩内容 >>
提交
1d97b724
编写于
3月 21, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert undefined -> null in IOutputService
上级
d58dcf2e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
11 deletion
+10
-11
src/vs/workbench/api/browser/mainThreadOutputService.ts
src/vs/workbench/api/browser/mainThreadOutputService.ts
+2
-2
src/vs/workbench/contrib/output/browser/outputServices.ts
src/vs/workbench/contrib/output/browser/outputServices.ts
+6
-7
src/vs/workbench/contrib/output/common/output.ts
src/vs/workbench/contrib/output/common/output.ts
+2
-2
未找到文件。
src/vs/workbench/api/browser/mainThreadOutputService.ts
浏览文件 @
1d97b724
...
@@ -38,7 +38,7 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut
...
@@ -38,7 +38,7 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut
const
setVisibleChannel
=
()
=>
{
const
setVisibleChannel
=
()
=>
{
const
panel
=
this
.
_panelService
.
getActivePanel
();
const
panel
=
this
.
_panelService
.
getActivePanel
();
const
visibleChannel
:
IOutputChannel
|
null
=
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
?
this
.
_outputService
.
getActiveChannel
()
:
null
;
const
visibleChannel
=
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
?
this
.
_outputService
.
getActiveChannel
()
:
undefined
;
this
.
_proxy
.
$setVisibleChannel
(
visibleChannel
?
visibleChannel
.
id
:
null
);
this
.
_proxy
.
$setVisibleChannel
(
visibleChannel
?
visibleChannel
.
id
:
null
);
};
};
this
.
_register
(
Event
.
any
<
any
>
(
this
.
_outputService
.
onActiveOutputChannel
,
this
.
_panelService
.
onDidPanelOpen
,
this
.
_panelService
.
onDidPanelClose
)(()
=>
setVisibleChannel
()));
this
.
_register
(
Event
.
any
<
any
>
(
this
.
_outputService
.
onActiveOutputChannel
,
this
.
_panelService
.
onDidPanelOpen
,
this
.
_panelService
.
onDidPanelClose
)(()
=>
setVisibleChannel
()));
...
@@ -104,7 +104,7 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut
...
@@ -104,7 +104,7 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut
return
undefined
;
return
undefined
;
}
}
private
_getChannel
(
channelId
:
string
):
IOutputChannel
|
null
{
private
_getChannel
(
channelId
:
string
):
IOutputChannel
|
undefined
{
return
this
.
_outputService
.
getChannel
(
channelId
);
return
this
.
_outputService
.
getChannel
(
channelId
);
}
}
}
}
src/vs/workbench/contrib/output/browser/outputServices.ts
浏览文件 @
1d97b724
...
@@ -27,7 +27,6 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
...
@@ -27,7 +27,6 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
IOutputChannelModel
,
IOutputChannelModelService
}
from
'
vs/workbench/services/output/common/outputChannelModel
'
;
import
{
IOutputChannelModel
,
IOutputChannelModelService
}
from
'
vs/workbench/services/output/common/outputChannelModel
'
;
import
{
withUndefinedAsNull
}
from
'
vs/base/common/types
'
;
const
OUTPUT_ACTIVE_CHANNEL_KEY
=
'
output.activechannel
'
;
const
OUTPUT_ACTIVE_CHANNEL_KEY
=
'
output.activechannel
'
;
...
@@ -67,7 +66,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
...
@@ -67,7 +66,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
private
channels
:
Map
<
string
,
OutputChannel
>
=
new
Map
<
string
,
OutputChannel
>
();
private
channels
:
Map
<
string
,
OutputChannel
>
=
new
Map
<
string
,
OutputChannel
>
();
private
activeChannelIdInStorage
:
string
;
private
activeChannelIdInStorage
:
string
;
private
activeChannel
:
OutputChannel
|
nul
l
;
private
activeChannel
?:
OutputChanne
l
;
private
readonly
_onActiveOutputChannel
=
new
Emitter
<
string
>
();
private
readonly
_onActiveOutputChannel
=
new
Emitter
<
string
>
();
readonly
onActiveOutputChannel
:
Event
<
string
>
=
this
.
_onActiveOutputChannel
.
event
;
readonly
onActiveOutputChannel
:
Event
<
string
>
=
this
.
_onActiveOutputChannel
.
event
;
...
@@ -106,7 +105,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
...
@@ -106,7 +105,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
// Set active channel to first channel if not set
// Set active channel to first channel if not set
if
(
!
this
.
activeChannel
)
{
if
(
!
this
.
activeChannel
)
{
const
channels
=
this
.
getChannelDescriptors
();
const
channels
=
this
.
getChannelDescriptors
();
this
.
activeChannel
=
channels
&&
channels
.
length
>
0
?
this
.
getChannel
(
channels
[
0
].
id
)
:
null
;
this
.
activeChannel
=
channels
&&
channels
.
length
>
0
?
this
.
getChannel
(
channels
[
0
].
id
)
:
undefined
;
}
}
this
.
_register
(
this
.
lifecycleService
.
onShutdown
(()
=>
this
.
dispose
()));
this
.
_register
(
this
.
lifecycleService
.
onShutdown
(()
=>
this
.
dispose
()));
...
@@ -141,15 +140,15 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
...
@@ -141,15 +140,15 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
return
promise
.
then
(()
=>
this
.
_onActiveOutputChannel
.
fire
(
id
));
return
promise
.
then
(()
=>
this
.
_onActiveOutputChannel
.
fire
(
id
));
}
}
getChannel
(
id
:
string
):
OutputChannel
|
null
{
getChannel
(
id
:
string
):
OutputChannel
|
undefined
{
return
withUndefinedAsNull
(
this
.
channels
.
get
(
id
)
);
return
this
.
channels
.
get
(
id
);
}
}
getChannelDescriptors
():
IOutputChannelDescriptor
[]
{
getChannelDescriptors
():
IOutputChannelDescriptor
[]
{
return
Registry
.
as
<
IOutputChannelRegistry
>
(
Extensions
.
OutputChannels
).
getChannels
();
return
Registry
.
as
<
IOutputChannelRegistry
>
(
Extensions
.
OutputChannels
).
getChannels
();
}
}
getActiveChannel
():
IOutputChannel
|
null
{
getActiveChannel
():
IOutputChannel
|
undefined
{
return
this
.
activeChannel
;
return
this
.
activeChannel
;
}
}
...
@@ -195,7 +194,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
...
@@ -195,7 +194,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
channel
.
model
.
onDispose
(()
=>
{
channel
.
model
.
onDispose
(()
=>
{
if
(
this
.
activeChannel
===
channel
)
{
if
(
this
.
activeChannel
===
channel
)
{
const
channels
=
this
.
getChannelDescriptors
();
const
channels
=
this
.
getChannelDescriptors
();
const
channel
=
channels
.
length
?
this
.
getChannel
(
channels
[
0
].
id
)
:
null
;
const
channel
=
channels
.
length
?
this
.
getChannel
(
channels
[
0
].
id
)
:
undefined
;
if
(
channel
&&
this
.
isPanelShown
())
{
if
(
channel
&&
this
.
isPanelShown
())
{
this
.
showChannel
(
channel
.
id
,
true
);
this
.
showChannel
(
channel
.
id
,
true
);
}
else
{
}
else
{
...
...
src/vs/workbench/contrib/output/common/output.ts
浏览文件 @
1d97b724
...
@@ -68,7 +68,7 @@ export interface IOutputService {
...
@@ -68,7 +68,7 @@ export interface IOutputService {
* Given the channel id returns the output channel instance.
* Given the channel id returns the output channel instance.
* Channel should be first registered via OutputChannelRegistry.
* Channel should be first registered via OutputChannelRegistry.
*/
*/
getChannel
(
id
:
string
):
IOutputChannel
|
null
;
getChannel
(
id
:
string
):
IOutputChannel
|
undefined
;
/**
/**
* Returns an array of all known output channels descriptors.
* Returns an array of all known output channels descriptors.
...
@@ -79,7 +79,7 @@ export interface IOutputService {
...
@@ -79,7 +79,7 @@ export interface IOutputService {
* Returns the currently active channel.
* Returns the currently active channel.
* Only one channel can be active at a given moment.
* Only one channel can be active at a given moment.
*/
*/
getActiveChannel
():
IOutputChannel
|
null
;
getActiveChannel
():
IOutputChannel
|
undefined
;
/**
/**
* Show the channel with the passed id.
* Show the channel with the passed id.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录