Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
8317c45b
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8317c45b
编写于
4月 13, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
output: introduce channel.id
上级
f0d88b60
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
29 addition
and
22 deletion
+29
-22
src/vs/workbench/parts/extensions/common/extensions.ts
src/vs/workbench/parts/extensions/common/extensions.ts
+2
-1
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
...ts/extensions/electron-browser/extensions.contribution.ts
+2
-2
src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts
.../workbench/parts/git/browser/gitWorkbenchContributions.ts
+1
-1
src/vs/workbench/parts/output/browser/outputActions.ts
src/vs/workbench/parts/output/browser/outputActions.ts
+1
-1
src/vs/workbench/parts/output/common/output.ts
src/vs/workbench/parts/output/common/output.ts
+14
-9
src/vs/workbench/parts/output/common/outputServices.ts
src/vs/workbench/parts/output/common/outputServices.ts
+6
-6
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+3
-2
未找到文件。
src/vs/workbench/parts/extensions/common/extensions.ts
浏览文件 @
8317c45b
...
...
@@ -84,4 +84,5 @@ export interface IExtensionTipsService {
getRecommendations
():
TPromise
<
IExtension
[]
>
;
}
export
const
ExtensionsLabel
=
nls
.
localize
(
'
extensions
'
,
"
Extensions
"
);
\ No newline at end of file
export
const
ExtensionsLabel
=
nls
.
localize
(
'
extensions
'
,
"
Extensions
"
);
export
const
ExtensionsChannelId
=
'
extensions
'
;
\ No newline at end of file
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
浏览文件 @
8317c45b
...
...
@@ -8,7 +8,7 @@ import { Registry } from 'vs/platform/platform';
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IStatusbarRegistry
,
Extensions
as
StatusbarExtensions
,
StatusbarItemDescriptor
,
StatusbarAlignment
}
from
'
vs/workbench/browser/parts/statusbar/statusbar
'
;
import
{
ExtensionsStatusbarItem
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsWidgets
'
;
import
{
IGalleryService
,
ExtensionsLabel
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
IGalleryService
,
ExtensionsLabel
,
ExtensionsChannelId
}
from
'
vs/workbench/parts/extensions/common/extensions
'
;
import
{
GalleryService
}
from
'
vs/workbench/parts/extensions/common/vsoGalleryService
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
ExtensionsWorkbenchExtension
}
from
'
vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension
'
;
...
...
@@ -23,4 +23,4 @@ Registry.as<IStatusbarRegistry>(StatusbarExtensions.Statusbar)
.
registerStatusbarItem
(
new
StatusbarItemDescriptor
(
ExtensionsStatusbarItem
,
StatusbarAlignment
.
LEFT
,
10000
));
Registry
.
as
<
IOutputChannelRegistry
>
(
OutputExtensions
.
OutputChannels
)
.
registerChannel
(
ExtensionsLabel
);
\ No newline at end of file
.
registerChannel
(
ExtensionsChannelId
,
ExtensionsLabel
);
\ No newline at end of file
src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts
浏览文件 @
8317c45b
...
...
@@ -452,7 +452,7 @@ export function registerContributions(): void {
// Register Output Channel
var
outputChannelRegistry
=
<
output
.
IOutputChannelRegistry
>
platform
.
Registry
.
as
(
output
.
Extensions
.
OutputChannels
);
outputChannelRegistry
.
registerChannel
(
'
Git
'
);
outputChannelRegistry
.
registerChannel
(
'
git
'
,
nls
.
localize
(
'
git
'
,
"
Git
"
)
);
// Register Git Output
(
<
ext
.
IWorkbenchContributionsRegistry
>
platform
.
Registry
.
as
(
ext
.
Extensions
.
Workbench
)).
registerWorkbenchContribution
(
...
...
src/vs/workbench/parts/output/browser/outputActions.ts
浏览文件 @
8317c45b
...
...
@@ -123,7 +123,7 @@ export class SwitchOutputActionItem extends SelectActionItem {
}
private
static
getChannels
(
outputService
:
IOutputService
):
string
[]
{
const
contributedChannels
=
(
<
IOutputChannelRegistry
>
Registry
.
as
(
Extensions
.
OutputChannels
)).
getChannels
();
const
contributedChannels
=
(
<
IOutputChannelRegistry
>
Registry
.
as
(
Extensions
.
OutputChannels
)).
getChannels
()
.
map
(
channelData
=>
channelData
.
id
)
;
const
usedChannels
=
outputService
.
getChannels
();
return
arrays
.
distinct
(
contributedChannels
.
concat
(
usedChannels
)).
sort
();
// sort by name
...
...
src/vs/workbench/parts/output/common/output.ts
浏览文件 @
8317c45b
...
...
@@ -108,35 +108,40 @@ export interface IOutputService {
onActiveOutputChannel
:
Event
<
string
>
;
}
export
interface
IOutputChannel
{
}
export
interface
IOutputChannelRegistry
{
/**
* Make an output channel known to the output world.
*/
registerChannel
(
name
:
string
):
void
;
registerChannel
(
id
:
string
,
name
:
string
):
void
;
/**
* Returns the list of channels known to the output world.
*/
getChannels
():
string
[];
getChannels
():
{
id
:
string
,
displayName
:
string
}
[];
}
class
OutputChannelRegistry
implements
IOutputChannelRegistry
{
private
channels
:
string
[];
private
channels
:
{
id
:
string
,
displayName
:
string
}
[];
constructor
()
{
this
.
channels
=
[];
}
public
registerChannel
(
n
ame
:
string
):
void
{
if
(
this
.
channels
.
indexOf
(
name
)
===
-
1
)
{
this
.
channels
.
push
(
name
);
public
registerChannel
(
id
:
string
,
displayN
ame
:
string
):
void
{
if
(
this
.
channels
.
every
(
channel
=>
channel
.
id
!==
id
)
)
{
this
.
channels
.
push
(
{
id
,
displayName
}
);
}
}
public
getChannels
():
string
[]
{
return
this
.
channels
.
slice
(
0
)
;
public
getChannels
():
{
id
:
string
,
displayName
:
string
}
[]
{
return
this
.
channels
;
}
}
Registry
.
add
(
Extensions
.
OutputChannels
,
new
OutputChannelRegistry
());
\ No newline at end of file
Registry
.
add
(
Extensions
.
OutputChannels
,
new
OutputChannelRegistry
());
src/vs/workbench/parts/output/common/outputServices.ts
浏览文件 @
8317c45b
...
...
@@ -25,7 +25,7 @@ export class OutputService implements IOutputService {
private
receivedOutput
:
{
[
channel
:
string
]:
string
;
};
private
activeChannel
:
string
;
private
activeChannel
Id
:
string
;
private
_onOutput
:
Emitter
<
IOutputEvent
>
;
private
_onOutputChannel
:
Emitter
<
string
>
;
...
...
@@ -45,7 +45,7 @@ export class OutputService implements IOutputService {
this
.
receivedOutput
=
Object
.
create
(
null
);
const
channels
=
(
<
IOutputChannelRegistry
>
Registry
.
as
(
Extensions
.
OutputChannels
)).
getChannels
();
this
.
activeChannel
=
this
.
storageService
.
get
(
OUTPUT_ACTIVE_CHANNEL_KEY
,
StorageScope
.
WORKSPACE
,
channels
&&
channels
.
length
>
0
?
channels
[
0
]
:
null
);
this
.
activeChannel
Id
=
this
.
storageService
.
get
(
OUTPUT_ACTIVE_CHANNEL_KEY
,
StorageScope
.
WORKSPACE
,
channels
&&
channels
.
length
>
0
?
channels
[
0
].
id
:
null
);
}
public
get
onOutput
():
Event
<
IOutputEvent
>
{
...
...
@@ -89,7 +89,7 @@ export class OutputService implements IOutputService {
}
public
getActiveChannel
():
string
{
return
this
.
activeChannel
;
return
this
.
activeChannel
Id
;
}
public
clearOutput
(
channel
:
string
):
void
{
...
...
@@ -100,12 +100,12 @@ export class OutputService implements IOutputService {
public
showOutput
(
channel
:
string
,
preserveFocus
?:
boolean
):
TPromise
<
IEditor
>
{
const
panel
=
this
.
panelService
.
getActivePanel
();
if
(
this
.
activeChannel
===
channel
&&
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
)
{
if
(
this
.
activeChannel
Id
===
channel
&&
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
)
{
return
TPromise
.
as
(
<
OutputPanel
>
panel
);
}
this
.
activeChannel
=
channel
;
this
.
storageService
.
store
(
OUTPUT_ACTIVE_CHANNEL_KEY
,
this
.
activeChannel
,
StorageScope
.
WORKSPACE
);
this
.
activeChannel
Id
=
channel
;
this
.
storageService
.
store
(
OUTPUT_ACTIVE_CHANNEL_KEY
,
this
.
activeChannel
Id
,
StorageScope
.
WORKSPACE
);
this
.
_onActiveOutputChannel
.
fire
(
channel
);
// emit event that a new channel is active
return
this
.
panelService
.
openPanel
(
OUTPUT_PANEL_ID
,
!
preserveFocus
).
then
((
outputPanel
:
OutputPanel
)
=>
{
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
8317c45b
...
...
@@ -452,7 +452,8 @@ interface TaskServiceEventData {
class
TaskService
extends
EventEmitter
implements
ITaskService
{
public
serviceId
=
ITaskService
;
public
static
SERVICE_ID
:
string
=
'
taskService
'
;
public
static
OutputChannel
:
string
=
'
Tasks
'
;
public
static
OutputChannel
:
string
=
'
tasks
'
;
public
static
OutputChannelLabel
:
string
=
nls
.
localize
(
'
tasks
'
,
"
Tasks
"
);
private
modeService
:
IModeService
;
private
configurationService
:
IConfigurationService
;
...
...
@@ -831,7 +832,7 @@ if (Env.enableTasks) {
// Output channel
let
outputChannelRegistry
=
<
IOutputChannelRegistry
>
Registry
.
as
(
OutputExt
.
OutputChannels
);
outputChannelRegistry
.
registerChannel
(
TaskService
.
OutputChannel
);
outputChannelRegistry
.
registerChannel
(
TaskService
.
OutputChannel
,
TaskService
.
OutputChannelLabel
);
(
<
IWorkbenchContributionsRegistry
>
Registry
.
as
(
WorkbenchExtensions
.
Workbench
)).
registerWorkbenchContribution
(
TaskServiceParticipant
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录