Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c9fa87ed
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,发现更多精彩内容 >>
提交
c9fa87ed
编写于
9月 05, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make open log file action independent of schema
上级
b3ae3bd0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
21 deletion
+22
-21
src/vs/workbench/parts/output/browser/logViewer.ts
src/vs/workbench/parts/output/browser/logViewer.ts
+4
-4
src/vs/workbench/parts/output/browser/outputActions.ts
src/vs/workbench/parts/output/browser/outputActions.ts
+5
-6
src/vs/workbench/parts/output/electron-browser/output.contribution.ts
...ench/parts/output/electron-browser/output.contribution.ts
+4
-5
src/vs/workbench/parts/output/electron-browser/outputServices.ts
...workbench/parts/output/electron-browser/outputServices.ts
+9
-6
未找到文件。
src/vs/workbench/parts/output/browser/logViewer.ts
浏览文件 @
c9fa87ed
...
...
@@ -17,7 +17,7 @@ import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorIn
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
import
{
LOG_SCHEME
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
LOG_SCHEME
,
IOutputChannelDescriptor
}
from
'
vs/workbench/parts/output/common/output
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
...
...
@@ -26,11 +26,11 @@ export class LogViewerInput extends ResourceEditorInput {
public
static
readonly
ID
=
'
workbench.editorinputs.output
'
;
constructor
(
private
file
:
URI
,
constructor
(
private
outputChannelDescriptor
:
IOutputChannelDescriptor
,
@
ITextModelService
textModelResolverService
:
ITextModelService
,
@
IHashService
hashService
:
IHashService
)
{
super
(
paths
.
basename
(
file
.
fsPath
),
paths
.
dirname
(
file
.
fsPath
),
file
.
with
({
scheme
:
LOG_SCHEME
}),
textModelResolverService
,
hashService
);
super
(
paths
.
basename
(
outputChannelDescriptor
.
file
.
path
),
paths
.
dirname
(
outputChannelDescriptor
.
file
.
path
),
URI
.
from
({
scheme
:
LOG_SCHEME
,
path
:
outputChannelDescriptor
.
id
}),
textModelResolverService
,
hashService
);
}
public
getTypeId
():
string
{
...
...
@@ -38,7 +38,7 @@ export class LogViewerInput extends ResourceEditorInput {
}
public
getResource
():
URI
{
return
this
.
file
;
return
this
.
outputChannelDescriptor
.
file
;
}
}
...
...
src/vs/workbench/parts/output/browser/outputActions.ts
浏览文件 @
c9fa87ed
...
...
@@ -20,7 +20,6 @@ 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
{
...
...
@@ -180,16 +179,16 @@ export class OpenLogOutputFile extends Action {
}
private
update
():
void
{
this
.
enabled
=
!!
this
.
getLogFile
();
const
outputChannelDescriptor
=
this
.
getOutputChannelDescriptor
();
this
.
enabled
=
outputChannelDescriptor
&&
outputChannelDescriptor
.
file
&&
outputChannelDescriptor
.
log
;
}
public
run
():
TPromise
<
any
>
{
return
this
.
commandService
.
executeCommand
(
COMMAND_OPEN_LOG_VIEWER
,
this
.
getLogFile
()
);
return
this
.
enabled
?
this
.
commandService
.
executeCommand
(
COMMAND_OPEN_LOG_VIEWER
,
this
.
getOutputChannelDescriptor
())
:
TPromise
.
as
(
null
);
}
private
get
LogFile
():
URI
{
private
get
OutputChannelDescriptor
():
IOutputChannelDescriptor
{
const
channel
=
this
.
outputService
.
getActiveChannel
();
const
descriptor
=
channel
?
this
.
outputService
.
getChannelDescriptors
().
filter
(
c
=>
c
.
id
===
channel
.
id
)[
0
]
:
null
;
return
descriptor
&&
descriptor
.
log
?
descriptor
.
file
:
null
;
return
channel
?
this
.
outputService
.
getChannelDescriptors
().
filter
(
c
=>
c
.
id
===
channel
.
id
)[
0
]
:
null
;
}
}
src/vs/workbench/parts/output/electron-browser/output.contribution.ts
浏览文件 @
c9fa87ed
...
...
@@ -13,7 +13,7 @@ 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
,
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
{
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
,
IOutputChannelDescriptor
}
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
'
;
...
...
@@ -25,7 +25,6 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWo
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
// Register Service
...
...
@@ -180,10 +179,10 @@ registerAction({
}
});
CommandsRegistry
.
registerCommand
(
COMMAND_OPEN_LOG_VIEWER
,
function
(
accessor
:
ServicesAccessor
,
file
:
URI
)
{
if
(
file
)
{
CommandsRegistry
.
registerCommand
(
COMMAND_OPEN_LOG_VIEWER
,
function
(
accessor
:
ServicesAccessor
,
outputChannelDescriptor
:
IOutputChannelDescriptor
)
{
if
(
outputChannelDescriptor
&&
outputChannelDescriptor
.
file
)
{
const
editorService
=
accessor
.
get
(
IEditorService
);
return
editorService
.
openEditor
(
accessor
.
get
(
IInstantiationService
).
createInstance
(
LogViewerInput
,
file
));
return
editorService
.
openEditor
(
accessor
.
get
(
IInstantiationService
).
createInstance
(
LogViewerInput
,
outputChannelDescriptor
));
}
return
null
;
});
...
...
src/vs/workbench/parts/output/electron-browser/outputServices.ts
浏览文件 @
c9fa87ed
...
...
@@ -34,7 +34,6 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
toLocalISOString
}
from
'
vs/base/common/date
'
;
import
{
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
...
...
@@ -591,6 +590,7 @@ export class LogContentProvider {
private
channels
:
Map
<
string
,
OutputChannel
>
=
new
Map
<
string
,
OutputChannel
>
();
constructor
(
@
IOutputService
private
outputService
:
IOutputService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
}
...
...
@@ -606,13 +606,16 @@ export class LogContentProvider {
}
private
getChannel
(
resource
:
URI
):
OutputChannel
{
const
i
d
=
resource
.
path
;
let
channel
=
this
.
channels
.
get
(
i
d
);
const
channelI
d
=
resource
.
path
;
let
channel
=
this
.
channels
.
get
(
channelI
d
);
if
(
!
channel
)
{
const
channelDisposables
:
IDisposable
[]
=
[];
channel
=
this
.
instantiationService
.
createInstance
(
FileOutputChannel
,
{
id
,
label
:
''
,
file
:
resource
.
with
({
scheme
:
Schemas
.
file
}),
log
:
true
},
resource
);
channel
.
onDispose
(()
=>
dispose
(
channelDisposables
),
channelDisposables
);
this
.
channels
.
set
(
id
,
channel
);
const
outputChannelDescriptor
=
this
.
outputService
.
getChannelDescriptors
().
filter
(({
id
})
=>
id
===
channelId
)[
0
];
if
(
outputChannelDescriptor
&&
outputChannelDescriptor
.
file
)
{
channel
=
this
.
instantiationService
.
createInstance
(
FileOutputChannel
,
outputChannelDescriptor
,
resource
);
channel
.
onDispose
(()
=>
dispose
(
channelDisposables
),
channelDisposables
);
this
.
channels
.
set
(
channelId
,
channel
);
}
}
return
channel
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录