Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ec0e23bd
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,发现更多精彩内容 >>
提交
ec0e23bd
编写于
3月 15, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #42402
上级
1127d67e
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
83 addition
and
14 deletion
+83
-14
src/vs/workbench/parts/output/browser/media/open_log_file.svg
...vs/workbench/parts/output/browser/media/open_log_file.svg
+1
-0
src/vs/workbench/parts/output/browser/media/open_log_file_inverse.svg
...ench/parts/output/browser/media/open_log_file_inverse.svg
+1
-0
src/vs/workbench/parts/output/browser/media/output.css
src/vs/workbench/parts/output/browser/media/output.css
+9
-0
src/vs/workbench/parts/output/browser/outputActions.ts
src/vs/workbench/parts/output/browser/outputActions.ts
+35
-1
src/vs/workbench/parts/output/browser/outputPanel.ts
src/vs/workbench/parts/output/browser/outputPanel.ts
+3
-2
src/vs/workbench/parts/output/common/output.ts
src/vs/workbench/parts/output/common/output.ts
+2
-0
src/vs/workbench/parts/output/electron-browser/output.contribution.ts
...ench/parts/output/electron-browser/output.contribution.ts
+14
-2
src/vs/workbench/parts/output/electron-browser/outputServices.ts
...workbench/parts/output/electron-browser/outputServices.ts
+18
-9
未找到文件。
src/vs/workbench/parts/output/browser/media/open_log_file.svg
0 → 100644
浏览文件 @
ec0e23bd
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><polygon
fill=
"#656565"
points=
"10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"
/><polygon
fill=
"#00539C"
points=
"5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"
/></svg>
\ No newline at end of file
src/vs/workbench/parts/output/browser/media/open_log_file_inverse.svg
0 → 100644
浏览文件 @
ec0e23bd
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><polygon
fill=
"#C5C5C5"
points=
"10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"
/><polygon
fill=
"#75BEFF"
points=
"5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"
/></svg>
\ No newline at end of file
src/vs/workbench/parts/output/browser/media/output.css
浏览文件 @
ec0e23bd
...
...
@@ -29,3 +29,12 @@
.hc-black
.monaco-workbench
.output-action.output-scroll-unlock
{
background
:
url('output_unlock_inverse.svg')
center
center
no-repeat
;
}
.monaco-workbench
.output-action.open-log-file
{
background
:
url('open_log_file.svg')
center
center
no-repeat
;
}
.vs-dark
.monaco-workbench
.output-action.open-log-file
,
.hc-black
.monaco-workbench
.output-action.open-log-file
{
background
:
url('open_log_file_inverse.svg')
center
center
no-repeat
;
}
src/vs/workbench/parts/output/browser/outputActions.ts
浏览文件 @
ec0e23bd
...
...
@@ -7,7 +7,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
IOutputService
,
OUTPUT_PANEL_ID
,
IOutputChannelRegistry
,
Extensions
as
OutputExt
,
IOutputChannelIdentifier
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IOutputService
,
OUTPUT_PANEL_ID
,
IOutputChannelRegistry
,
Extensions
as
OutputExt
,
IOutputChannelIdentifier
,
COMMAND_OPEN_LOG_VIEWER
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
SelectActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
...
...
@@ -18,6 +18,8 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
groupBy
}
from
'
vs/base/common/arrays
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
URI
from
'
vs/base/common/uri
'
;
export
class
ToggleOutputAction
extends
TogglePanelAction
{
...
...
@@ -157,3 +159,35 @@ export class SwitchOutputActionItem extends SelectActionItem {
this
.
setOptions
(
options
,
Math
.
max
(
0
,
selected
),
separatorIndex
!==
-
1
?
separatorIndex
:
void
0
);
}
}
export
class
OpenLogOutputFile
extends
Action
{
public
static
readonly
ID
=
'
workbench.output.action.openLogOutputFile
'
;
public
static
readonly
LABEL
=
nls
.
localize
(
'
openInLogViewer
'
,
"
Open Log File
"
);
private
disposables
:
IDisposable
[]
=
[];
constructor
(
@
ICommandService
private
commandService
:
ICommandService
,
@
IOutputService
private
outputService
:
IOutputService
)
{
super
(
OpenLogOutputFile
.
ID
,
OpenLogOutputFile
.
LABEL
,
'
output-action open-log-file
'
);
this
.
outputService
.
onActiveOutputChannel
(
this
.
update
,
this
,
this
.
disposables
);
this
.
update
();
}
private
update
():
void
{
const
logFile
=
this
.
getActiveLogChannelFile
();
this
.
enabled
=
!!
logFile
;
}
public
run
():
TPromise
<
any
>
{
return
this
.
commandService
.
executeCommand
(
COMMAND_OPEN_LOG_VIEWER
,
this
.
getActiveLogChannelFile
());
}
private
getActiveLogChannelFile
():
URI
{
const
channel
=
this
.
outputService
.
getActiveChannel
();
const
identifier
=
channel
?
this
.
outputService
.
getChannels
().
filter
(
c
=>
c
.
id
===
channel
.
id
)[
0
]
:
null
;
return
identifier
?
identifier
.
file
:
null
;
}
}
src/vs/workbench/parts/output/browser/outputPanel.ts
浏览文件 @
ec0e23bd
...
...
@@ -19,7 +19,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import
{
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
AbstractTextResourceEditor
}
from
'
vs/workbench/browser/parts/editor/textResourceEditor
'
;
import
{
OUTPUT_PANEL_ID
,
IOutputService
,
CONTEXT_IN_OUTPUT
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
SwitchOutputAction
,
SwitchOutputActionItem
,
ClearOutputAction
,
ToggleOutputScrollLockAction
}
from
'
vs/workbench/parts/output/browser/outputActions
'
;
import
{
SwitchOutputAction
,
SwitchOutputActionItem
,
ClearOutputAction
,
ToggleOutputScrollLockAction
,
OpenLogOutputFile
}
from
'
vs/workbench/parts/output/browser/outputActions
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
...
...
@@ -55,7 +55,8 @@ export class OutputPanel extends AbstractTextResourceEditor {
this
.
actions
=
[
this
.
instantiationService
.
createInstance
(
SwitchOutputAction
),
this
.
instantiationService
.
createInstance
(
ClearOutputAction
,
ClearOutputAction
.
ID
,
ClearOutputAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ToggleOutputScrollLockAction
,
ToggleOutputScrollLockAction
.
ID
,
ToggleOutputScrollLockAction
.
LABEL
)
this
.
instantiationService
.
createInstance
(
ToggleOutputScrollLockAction
,
ToggleOutputScrollLockAction
.
ID
,
ToggleOutputScrollLockAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
OpenLogOutputFile
)
];
this
.
actions
.
forEach
(
a
=>
{
...
...
src/vs/workbench/parts/output/common/output.ts
浏览文件 @
ec0e23bd
...
...
@@ -61,6 +61,8 @@ export const MAX_OUTPUT_LENGTH = 10000 /* Max. number of output lines to show in
export
const
CONTEXT_IN_OUTPUT
=
new
RawContextKey
<
boolean
>
(
'
inOutput
'
,
false
);
export
const
CONTEXT_ACTIVE_LOG_OUTPUT
=
new
RawContextKey
<
boolean
>
(
'
activeLogOutput
'
,
false
);
export
const
IOutputService
=
createDecorator
<
IOutputService
>
(
OUTPUT_SERVICE_ID
);
/**
...
...
src/vs/workbench/parts/output/electron-browser/output.contribution.ts
浏览文件 @
ec0e23bd
...
...
@@ -12,8 +12,8 @@ import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actions
'
;
import
{
OutputService
,
LogContentProvider
}
from
'
vs/workbench/parts/output/electron-browser/outputServices
'
;
import
{
ToggleOutputAction
,
ClearOutputAction
}
from
'
vs/workbench/parts/output/browser/outputActions
'
;
import
{
OUTPUT_MODE_ID
,
OUTPUT_MIME
,
OUTPUT_PANEL_ID
,
IOutputService
,
CONTEXT_IN_OUTPUT
,
LOG_SCHEME
,
COMMAND_OPEN_LOG_VIEWER
,
LOG_MODE_ID
,
LOG_MIME
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
ToggleOutputAction
,
ClearOutputAction
,
OpenLogOutputFile
}
from
'
vs/workbench/parts/output/browser/outputActions
'
;
import
{
OUTPUT_MODE_ID
,
OUTPUT_MIME
,
OUTPUT_PANEL_ID
,
IOutputService
,
CONTEXT_IN_OUTPUT
,
LOG_SCHEME
,
COMMAND_OPEN_LOG_VIEWER
,
LOG_MODE_ID
,
LOG_MIME
,
CONTEXT_ACTIVE_LOG_OUTPUT
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
PanelRegistry
,
Extensions
,
PanelDescriptor
}
from
'
vs/workbench/browser/panel
'
;
import
{
CommandsRegistry
,
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -168,6 +168,18 @@ registerAction({
}
});
registerAction
({
id
:
'
workbench.action.openActiveLogOutputFile
'
,
title
:
nls
.
localize
(
'
openActiveLogOutputFile
'
,
"
View: Open Active Log Output File
"
),
menu
:
{
menuId
:
MenuId
.
CommandPalette
,
when
:
CONTEXT_ACTIVE_LOG_OUTPUT
},
handler
(
accessor
)
{
accessor
.
get
(
IInstantiationService
).
createInstance
(
OpenLogOutputFile
).
run
();
}
});
CommandsRegistry
.
registerCommand
(
COMMAND_OPEN_LOG_VIEWER
,
function
(
accessor
:
ServicesAccessor
,
file
:
URI
)
{
if
(
file
)
{
const
editorService
=
accessor
.
get
(
IWorkbenchEditorService
);
...
...
src/vs/workbench/parts/output/electron-browser/outputServices.ts
浏览文件 @
ec0e23bd
...
...
@@ -16,7 +16,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
IOutputChannelIdentifier
,
IOutputChannel
,
IOutputService
,
Extensions
,
OUTPUT_PANEL_ID
,
IOutputChannelRegistry
,
OUTPUT_SCHEME
,
OUTPUT_MIME
,
MAX_OUTPUT_LENGTH
,
LOG_SCHEME
,
LOG_MIME
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IOutputChannelIdentifier
,
IOutputChannel
,
IOutputService
,
Extensions
,
OUTPUT_PANEL_ID
,
IOutputChannelRegistry
,
OUTPUT_SCHEME
,
OUTPUT_MIME
,
MAX_OUTPUT_LENGTH
,
LOG_SCHEME
,
LOG_MIME
,
CONTEXT_ACTIVE_LOG_OUTPUT
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
OutputPanel
}
from
'
vs/workbench/parts/output/browser/outputPanel
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
...
...
@@ -40,6 +40,7 @@ import { binarySearch } from 'vs/base/common/arrays';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
const
OUTPUT_ACTIVE_CHANNEL_KEY
=
'
output.activechannel
'
;
...
...
@@ -439,6 +440,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
ILogService
private
logService
:
ILogService
,
@
ILifecycleService
private
lifecycleService
:
ILifecycleService
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
)
{
super
();
this
.
activeChannelIdInStorage
=
this
.
storageService
.
get
(
OUTPUT_ACTIVE_CHANNEL_KEY
,
StorageScope
.
WORKSPACE
,
null
);
...
...
@@ -510,21 +512,24 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
this
.
channels
.
set
(
channelId
,
channel
);
if
(
this
.
activeChannelIdInStorage
===
channelId
)
{
this
.
activeChannel
=
channel
;
this
.
onDidPanelOpen
(
this
.
panelService
.
getActivePanel
());
this
.
onDidPanelOpen
(
this
.
panelService
.
getActivePanel
())
.
then
(()
=>
this
.
_onActiveOutputChannel
.
fire
(
channelId
));
}
}
private
onDidPanelOpen
(
panel
:
IPanel
):
void
{
private
onDidPanelOpen
(
panel
:
IPanel
):
TPromise
<
void
>
{
if
(
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
)
{
this
.
_outputPanel
=
<
OutputPanel
>
this
.
panelService
.
getActivePanel
();
if
(
this
.
activeChannel
)
{
this
.
doShowChannel
(
this
.
activeChannel
,
true
);
return
this
.
doShowChannel
(
this
.
activeChannel
,
true
);
}
}
return
TPromise
.
as
(
null
);
}
private
onDidPanelClose
(
panel
:
IPanel
):
void
{
if
(
this
.
_outputPanel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
)
{
CONTEXT_ACTIVE_LOG_OUTPUT
.
bindTo
(
this
.
contextKeyService
).
set
(
false
);
this
.
_outputPanel
.
clearInput
();
}
}
...
...
@@ -577,13 +582,17 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
}
}
private
doShowChannel
(
channel
:
IOutputChannel
,
preserveFocus
:
boolean
):
void
{
private
doShowChannel
(
channel
:
IOutputChannel
,
preserveFocus
:
boolean
):
TPromise
<
void
>
{
if
(
this
.
_outputPanel
)
{
this
.
_outputPanel
.
setInput
(
this
.
createInput
(
channel
),
EditorOptions
.
create
({
preserveFocus
:
preserveFocus
}));
CONTEXT_ACTIVE_LOG_OUTPUT
.
bindTo
(
this
.
contextKeyService
).
set
(
channel
instanceof
FileOutputChannel
);
return
this
.
_outputPanel
.
setInput
(
this
.
createInput
(
channel
),
EditorOptions
.
create
({
preserveFocus
:
preserveFocus
}))
.
then
(()
=>
{
if
(
!
preserveFocus
)
{
this
.
_outputPanel
.
focus
();
}
});
}
return
TPromise
.
as
(
null
);
}
private
isChannelShown
(
channel
:
IOutputChannel
):
boolean
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录