Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9f188595
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,发现更多精彩内容 >>
提交
9f188595
编写于
2月 05, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#90020 Use IViewsService in markers view
上级
154c56de
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
118 addition
and
98 deletion
+118
-98
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
+4
-0
src/vs/workbench/browser/parts/views/views.ts
src/vs/workbench/browser/parts/views/views.ts
+46
-15
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+1
-1
src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts
src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts
+4
-4
src/vs/workbench/contrib/markers/browser/constants.ts
src/vs/workbench/contrib/markers/browser/constants.ts
+8
-7
src/vs/workbench/contrib/markers/browser/markers.contribution.ts
...workbench/contrib/markers/browser/markers.contribution.ts
+37
-39
src/vs/workbench/contrib/markers/browser/markers.ts
src/vs/workbench/contrib/markers/browser/markers.ts
+1
-1
src/vs/workbench/contrib/markers/browser/markersView.ts
src/vs/workbench/contrib/markers/browser/markersView.ts
+2
-12
src/vs/workbench/contrib/markers/browser/markersViewActions.ts
...s/workbench/contrib/markers/browser/markersViewActions.ts
+4
-4
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
...vs/workbench/contrib/tasks/browser/abstractTaskService.ts
+6
-12
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
+5
-3
未找到文件。
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
浏览文件 @
9f188595
...
...
@@ -310,6 +310,10 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
return
this
.
paneItems
.
map
(
i
=>
i
.
pane
);
}
get
views
():
IView
[]
{
return
this
.
panes
;
}
get
length
():
number
{
return
this
.
paneItems
.
length
;
}
...
...
src/vs/workbench/browser/parts/views/views.ts
浏览文件 @
9f188595
...
...
@@ -9,7 +9,7 @@ import { IViewDescriptorService, ViewContainer, IViewDescriptor, IViewContainers
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ContextKeyExpr
,
IContextKey
,
IContextKeyService
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
firstIndex
,
move
}
from
'
vs/base/common/arrays
'
;
import
{
isUndefinedOrNull
,
isUndefined
,
isString
}
from
'
vs/base/common/types
'
;
...
...
@@ -464,15 +464,19 @@ export class ViewsService extends Disposable implements IViewsService {
private
readonly
_onDidChangeViewVisibility
:
Emitter
<
{
id
:
string
,
visible
:
boolean
}
>
=
this
.
_register
(
new
Emitter
<
{
id
:
string
,
visible
:
boolean
}
>
());
readonly
onDidChangeViewVisibility
:
Event
<
{
id
:
string
,
visible
:
boolean
}
>
=
this
.
_onDidChangeViewVisibility
.
event
;
private
readonly
visibleViewContextKeys
:
Map
<
string
,
IContextKey
<
boolean
>>
;
constructor
(
@
IViewDescriptorService
private
readonly
viewDescriptorService
:
IViewDescriptorService
,
@
IPanelService
private
readonly
panelService
:
IPanelService
,
@
IViewletService
private
readonly
viewletService
:
IViewletService
@
IViewletService
private
readonly
viewletService
:
IViewletService
,
@
IContextKeyService
private
readonly
contextKeyService
:
IContextKeyService
,
)
{
super
();
this
.
viewContainersRegistry
=
Registry
.
as
<
IViewContainersRegistry
>
(
ViewExtensions
.
ViewContainersRegistry
);
this
.
viewDisposable
=
new
Map
<
IViewDescriptor
,
IDisposable
>
();
this
.
visibleViewContextKeys
=
new
Map
<
string
,
IContextKey
<
boolean
>>
();
this
.
_register
(
toDisposable
(()
=>
{
this
.
viewDisposable
.
forEach
(
disposable
=>
disposable
.
dispose
());
...
...
@@ -483,16 +487,50 @@ export class ViewsService extends Disposable implements IViewsService {
this
.
_register
(
this
.
viewContainersRegistry
.
onDidRegister
(({
viewContainer
,
viewContainerLocation
})
=>
this
.
onDidRegisterViewContainer
(
viewContainer
,
viewContainerLocation
)));
}
registerViewPaneContainer
(
viewPaneContainer
:
ViewPaneContainer
):
ViewPaneContainer
{
this
.
_register
(
viewPaneContainer
.
onDidAddViews
(
views
=>
this
.
onViewsAdded
(
views
)));
this
.
_register
(
viewPaneContainer
.
onDidChangeViewVisibility
(
view
=>
this
.
onViewsVisibilityChanged
(
view
,
view
.
isBodyVisible
())));
this
.
_register
(
viewPaneContainer
.
onDidRemoveViews
(
views
=>
this
.
onViewsRemoved
(
views
)));
return
viewPaneContainer
;
}
private
onViewsAdded
(
added
:
IView
[]):
void
{
for
(
const
view
of
added
)
{
this
.
onViewsVisibilityChanged
(
view
,
view
.
isBodyVisible
());
}
}
private
onViewsVisibilityChanged
(
view
:
IView
,
visible
:
boolean
):
void
{
this
.
getOrCreateActiveViewContextKey
(
view
).
set
(
visible
);
this
.
_onDidChangeViewVisibility
.
fire
({
id
:
view
.
id
,
visible
:
visible
});
}
private
onViewsRemoved
(
removed
:
IView
[]):
void
{
for
(
const
view
of
removed
)
{
this
.
onViewsVisibilityChanged
(
view
,
false
);
}
}
private
getOrCreateActiveViewContextKey
(
view
:
IView
):
IContextKey
<
boolean
>
{
const
visibleContextKeyId
=
`
${
view
.
id
}
.visible`
;
let
contextKey
=
this
.
visibleViewContextKeys
.
get
(
visibleContextKeyId
);
if
(
!
contextKey
)
{
contextKey
=
new
RawContextKey
(
visibleContextKeyId
,
false
).
bindTo
(
this
.
contextKeyService
);
this
.
visibleViewContextKeys
.
set
(
visibleContextKeyId
,
contextKey
);
}
return
contextKey
;
}
private
onDidRegisterViewContainer
(
viewContainer
:
ViewContainer
,
location
:
ViewContainerLocation
):
void
{
const
viewDescriptorCollection
=
this
.
viewDescriptorService
.
getViewDescriptors
(
viewContainer
);
this
.
onViewsAdded
(
viewDescriptorCollection
.
allViewDescriptors
,
viewContainer
);
this
.
onView
Descriptor
sAdded
(
viewDescriptorCollection
.
allViewDescriptors
,
viewContainer
);
this
.
_register
(
viewDescriptorCollection
.
onDidChangeViews
(({
added
,
removed
})
=>
{
this
.
onViewsAdded
(
added
,
viewContainer
);
this
.
onViewsRemoved
(
removed
);
this
.
onView
Descriptor
sAdded
(
added
,
viewContainer
);
this
.
onView
Descriptor
sRemoved
(
removed
);
}));
}
private
onViewsAdded
(
views
:
IViewDescriptor
[],
container
:
ViewContainer
):
void
{
private
onView
Descriptor
sAdded
(
views
:
IViewDescriptor
[],
container
:
ViewContainer
):
void
{
const
location
=
this
.
viewContainersRegistry
.
getViewContainerLocation
(
container
);
if
(
location
===
undefined
)
{
return
;
...
...
@@ -561,7 +599,7 @@ export class ViewsService extends Disposable implements IViewsService {
}
}
private
onViewsRemoved
(
views
:
IViewDescriptor
[]):
void
{
private
onView
Descriptor
sRemoved
(
views
:
IViewDescriptor
[]):
void
{
for
(
const
view
of
views
)
{
const
disposable
=
this
.
viewDisposable
.
get
(
view
);
if
(
disposable
)
{
...
...
@@ -629,7 +667,7 @@ export class ViewsService extends Disposable implements IViewsService {
if
(
activeViewPaneContainer
)
{
const
view
=
activeViewPaneContainer
.
getView
(
id
);
if
(
view
)
{
if
(
activeViewPaneContainer
.
length
===
1
)
{
if
(
activeViewPaneContainer
.
views
.
length
===
1
)
{
const
location
=
this
.
viewContainersRegistry
.
getViewContainerLocation
(
viewContainer
);
if
(
location
===
ViewContainerLocation
.
Sidebar
)
{
this
.
viewletService
.
hideActiveViewlet
();
...
...
@@ -661,13 +699,6 @@ export class ViewsService extends Disposable implements IViewsService {
return
null
;
}
registerViewPaneContainer
(
viewPaneContainer
:
ViewPaneContainer
):
ViewPaneContainer
{
this
.
_register
(
viewPaneContainer
.
onDidAddViews
(
views
=>
views
.
forEach
(
view
=>
this
.
_onDidChangeViewVisibility
.
fire
({
id
:
view
.
id
,
visible
:
view
.
isBodyVisible
()
}))));
this
.
_register
(
viewPaneContainer
.
onDidChangeViewVisibility
(
view
=>
this
.
_onDidChangeViewVisibility
.
fire
({
id
:
view
.
id
,
visible
:
view
.
isBodyVisible
()
})));
this
.
_register
(
viewPaneContainer
.
onDidRemoveViews
(
views
=>
views
.
forEach
(
view
=>
this
.
_onDidChangeViewVisibility
.
fire
({
id
:
view
.
id
,
visible
:
false
}))));
return
viewPaneContainer
;
}
}
export
function
createFileIconThemableTreeContainerScope
(
container
:
HTMLElement
,
themeService
:
IWorkbenchThemeService
):
IDisposable
{
...
...
src/vs/workbench/common/views.ts
浏览文件 @
9f188595
...
...
@@ -529,7 +529,7 @@ export interface IViewPaneContainer {
onDidRemoveViews
:
Event
<
IView
[]
>
;
onDidChangeViewVisibility
:
Event
<
IView
>
;
readonly
length
:
number
;
readonly
views
:
IView
[]
;
setVisible
(
visible
:
boolean
):
void
;
isVisible
():
boolean
;
...
...
src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts
浏览文件 @
9f188595
...
...
@@ -8,7 +8,6 @@ import severity from 'vs/base/common/severity';
import
{
Event
}
from
'
vs/base/common/event
'
;
import
Constants
from
'
vs/workbench/contrib/markers/browser/constants
'
;
import
{
ITaskService
,
ITaskSummary
}
from
'
vs/workbench/contrib/tasks/common/taskService
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkspaceFolder
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
TaskEvent
,
TaskEventKind
,
TaskIdentifier
}
from
'
vs/workbench/contrib/tasks/common/tasks
'
;
...
...
@@ -18,6 +17,7 @@ import { withUndefinedAsNull } from 'vs/base/common/types';
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IDebugConfiguration
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
createErrorWithActions
}
from
'
vs/base/common/errorsWithActions
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
function
once
(
match
:
(
e
:
TaskEvent
)
=>
boolean
,
event
:
Event
<
TaskEvent
>
):
Event
<
TaskEvent
>
{
return
(
listener
,
thisArgs
=
null
,
disposables
?)
=>
{
...
...
@@ -44,7 +44,7 @@ export class DebugTaskRunner {
@
ITaskService
private
readonly
taskService
:
ITaskService
,
@
IMarkerService
private
readonly
markerService
:
IMarkerService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
I
PanelService
private
readonly
panelService
:
IPanel
Service
,
@
I
ViewsService
private
readonly
viewsService
:
IViews
Service
,
@
IDialogService
private
readonly
dialogService
:
IDialogService
,
)
{
}
...
...
@@ -68,7 +68,7 @@ export class DebugTaskRunner {
return
TaskRunResult
.
Success
;
}
if
(
onTaskErrors
===
'
showErrors
'
)
{
await
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
);
await
this
.
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
);
return
Promise
.
resolve
(
TaskRunResult
.
Failure
);
}
...
...
@@ -97,7 +97,7 @@ export class DebugTaskRunner {
return
TaskRunResult
.
Success
;
}
await
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
);
await
this
.
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
);
return
Promise
.
resolve
(
TaskRunResult
.
Failure
);
}
catch
(
err
)
{
await
onError
(
err
.
message
,
[
this
.
taskService
.
configureAction
()]);
...
...
src/vs/workbench/contrib/markers/browser/constants.ts
浏览文件 @
9f188595
...
...
@@ -6,22 +6,23 @@
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
export
default
{
MARKERS_PANEL_ID
:
'
workbench.panel.markers
'
,
MARKERS_PANEL_STORAGE_ID
:
'
workbench.panel.markers
'
,
MARKERS_CONTAINER_ID
:
'
workbench.panel.markers
'
,
MARKERS_VIEW_ID
:
'
workbench.panel.markers.view
'
,
MARKERS_VIEW_STORAGE_ID
:
'
workbench.panel.markers
'
,
MARKER_COPY_ACTION_ID
:
'
problems.action.copy
'
,
MARKER_COPY_MESSAGE_ACTION_ID
:
'
problems.action.copyMessage
'
,
RELATED_INFORMATION_COPY_MESSAGE_ACTION_ID
:
'
problems.action.copyRelatedInformationMessage
'
,
FOCUS_PROBLEMS_FROM_FILTER
:
'
problems.action.focusProblemsFromFilter
'
,
MARKERS_
PANEL
_FOCUS_FILTER
:
'
problems.action.focusFilter
'
,
MARKERS_
PANEL
_SHOW_MULTILINE_MESSAGE
:
'
problems.action.showMultilineMessage
'
,
MARKERS_
PANEL
_SHOW_SINGLELINE_MESSAGE
:
'
problems.action.showSinglelineMessage
'
,
MARKERS_
VIEW
_FOCUS_FILTER
:
'
problems.action.focusFilter
'
,
MARKERS_
VIEW
_SHOW_MULTILINE_MESSAGE
:
'
problems.action.showMultilineMessage
'
,
MARKERS_
VIEW
_SHOW_SINGLELINE_MESSAGE
:
'
problems.action.showSinglelineMessage
'
,
MARKER_OPEN_SIDE_ACTION_ID
:
'
problems.action.openToSide
'
,
MARKER_SHOW_PANEL_ID
:
'
workbench.action.showErrorsWarnings
'
,
MARKER_SHOW_QUICK_FIX
:
'
problems.action.showQuickFixes
'
,
TOGGLE_MARKERS_VIEW_ACTION_ID
:
'
workbench.actions.view.toggleProblems
'
,
Marker
Panel
FocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemsViewFocus
'
,
false
),
Marker
View
FocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemsViewFocus
'
,
false
),
MarkerFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemFocus
'
,
false
),
Marker
Panel
FilterFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemsFilterFocus
'
,
false
),
Marker
View
FilterFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemsFilterFocus
'
,
false
),
RelatedInformationFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
relatedInformationFocus
'
,
false
)
};
src/vs/workbench/contrib/markers/browser/markers.contribution.ts
浏览文件 @
9f188595
...
...
@@ -12,7 +12,7 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
Marker
,
RelatedInformation
}
from
'
vs/workbench/contrib/markers/browser/markersModel
'
;
import
{
MarkersView
,
getMarkersView
}
from
'
vs/workbench/contrib/markers/browser/markersView
'
;
import
{
MarkersView
}
from
'
vs/workbench/contrib/markers/browser/markersView
'
;
import
{
MenuId
,
MenuRegistry
,
SyncActionDescriptor
,
registerAction2
,
Action2
}
from
'
vs/platform/actions/common/actions
'
;
import
{
TogglePanelAction
}
from
'
vs/workbench/browser/panel
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
...
...
@@ -24,12 +24,11 @@ import { IMarkersWorkbenchService, MarkersWorkbenchService, ActivityUpdater } fr
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
ActivePanelContext
}
from
'
vs/workbench/common/panel
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IStatusbarEntryAccessor
,
IStatusbarService
,
StatusbarAlignment
,
IStatusbarEntry
}
from
'
vs/workbench/services/statusbar/common/statusbar
'
;
import
{
IMarkerService
,
MarkerStatistics
}
from
'
vs/platform/markers/common/markers
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ViewContainer
,
IViewContainersRegistry
,
Extensions
as
ViewContainerExtensions
,
ViewContainerLocation
,
IViewsRegistry
}
from
'
vs/workbench/common/views
'
;
import
{
ViewContainer
,
IViewContainersRegistry
,
Extensions
as
ViewContainerExtensions
,
ViewContainerLocation
,
IViewsRegistry
,
IViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
ViewPaneContainer
}
from
'
vs/workbench/browser/parts/views/viewPaneContainer
'
;
import
{
IWorkbenchLayoutService
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
...
...
@@ -46,7 +45,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
primary
:
KeyMod
.
WinCtrl
|
KeyCode
.
Enter
},
handler
:
(
accessor
,
args
:
any
)
=>
{
const
markersView
=
getMarkersView
(
accessor
.
get
(
IPanelService
)
)
!
;
const
markersView
=
accessor
.
get
(
IViewsService
).
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
)
!
;
markersView
.
openFileAtElement
(
markersView
.
getFocusElement
(),
false
,
true
,
true
);
}
});
...
...
@@ -57,7 +56,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when
:
undefined
,
primary
:
undefined
,
handler
:
async
(
accessor
,
args
:
any
)
=>
{
await
accessor
.
get
(
I
PanelService
).
openPanel
(
Constants
.
MARKERS_PANEL
_ID
);
await
accessor
.
get
(
I
ViewsService
).
openView
(
Constants
.
MARKERS_VIEW
_ID
);
}
});
...
...
@@ -67,7 +66,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when
:
Constants
.
MarkerFocusContextKey
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
US_DOT
,
handler
:
(
accessor
,
args
:
any
)
=>
{
const
markersView
=
getMarkersView
(
accessor
.
get
(
IPanelService
)
)
!
;
const
markersView
=
accessor
.
get
(
IViewsService
).
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
)
!
;
const
focusedElement
=
markersView
.
getFocusElement
();
if
(
focusedElement
instanceof
Marker
)
{
markersView
.
showQuickFixes
(
focusedElement
);
...
...
@@ -104,15 +103,15 @@ class ToggleMarkersPanelAction extends TogglePanelAction {
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
,
@
IPanelService
panelService
:
IPanelService
)
{
super
(
id
,
label
,
Constants
.
MARKERS_
PANEL
_ID
,
panelService
,
layoutService
);
super
(
id
,
label
,
Constants
.
MARKERS_
CONTAINER
_ID
,
panelService
,
layoutService
);
}
}
// markers view container
const
VIEW_CONTAINER
:
ViewContainer
=
Registry
.
as
<
IViewContainersRegistry
>
(
ViewContainerExtensions
.
ViewContainersRegistry
).
registerViewContainer
({
id
:
Constants
.
MARKERS_
PANEL
_ID
,
id
:
Constants
.
MARKERS_
CONTAINER
_ID
,
name
:
Messages
.
MARKERS_PANEL_TITLE_PROBLEMS
,
ctorDescriptor
:
new
SyncDescriptor
(
ViewPaneContainer
,
[
Constants
.
MARKERS_
PANEL_ID
,
Constants
.
MARKERS_PANEL
_STORAGE_ID
,
{
mergeViewWithContainerWhenSingleView
:
true
,
donotShowContainerTitleWhenMergedWithContainer
:
true
}]),
ctorDescriptor
:
new
SyncDescriptor
(
ViewPaneContainer
,
[
Constants
.
MARKERS_
CONTAINER_ID
,
Constants
.
MARKERS_VIEW
_STORAGE_ID
,
{
mergeViewWithContainerWhenSingleView
:
true
,
donotShowContainerTitleWhenMergedWithContainer
:
true
}]),
focusCommand
:
{
id
:
ToggleMarkersPanelAction
.
ID
,
keybindings
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_M
...
...
@@ -155,7 +154,7 @@ registerAction2(class extends Action2 {
});
}
async
run
(
accessor
:
ServicesAccessor
)
{
await
copyMarker
(
accessor
.
get
(
I
Panel
Service
),
accessor
.
get
(
IClipboardService
));
await
copyMarker
(
accessor
.
get
(
I
Views
Service
),
accessor
.
get
(
IClipboardService
));
}
});
registerAction2
(
class
extends
Action2
{
...
...
@@ -171,7 +170,7 @@ registerAction2(class extends Action2 {
});
}
async
run
(
accessor
:
ServicesAccessor
)
{
await
copyMessage
(
accessor
.
get
(
I
Panel
Service
),
accessor
.
get
(
IClipboardService
));
await
copyMessage
(
accessor
.
get
(
I
Views
Service
),
accessor
.
get
(
IClipboardService
));
}
});
registerAction2
(
class
extends
Action2
{
...
...
@@ -187,7 +186,7 @@ registerAction2(class extends Action2 {
});
}
async
run
(
accessor
:
ServicesAccessor
)
{
await
copyRelatedInformationMessage
(
accessor
.
get
(
I
Panel
Service
),
accessor
.
get
(
IClipboardService
));
await
copyRelatedInformationMessage
(
accessor
.
get
(
I
Views
Service
),
accessor
.
get
(
IClipboardService
));
}
});
registerAction2
(
class
extends
Action2
{
...
...
@@ -196,46 +195,46 @@ registerAction2(class extends Action2 {
id
:
Constants
.
FOCUS_PROBLEMS_FROM_FILTER
,
title
:
localize
(
'
focusProblemsList
'
,
"
Focus problems view
"
),
keybinding
:
{
when
:
Constants
.
Marker
Panel
FilterFocusContextKey
,
when
:
Constants
.
Marker
View
FilterFocusContextKey
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
DownArrow
}
});
}
run
(
accessor
:
ServicesAccessor
)
{
focusProblemsView
(
accessor
.
get
(
I
Panel
Service
));
focusProblemsView
(
accessor
.
get
(
I
Views
Service
));
}
});
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
Constants
.
MARKERS_
PANEL
_FOCUS_FILTER
,
id
:
Constants
.
MARKERS_
VIEW
_FOCUS_FILTER
,
title
:
localize
(
'
focusProblemsFilter
'
,
"
Focus problems filter
"
),
keybinding
:
{
when
:
Constants
.
Marker
Panel
FocusContextKey
,
when
:
Constants
.
Marker
View
FocusContextKey
,
weight
:
KeybindingWeight
.
WorkbenchContrib
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_F
}
});
}
run
(
accessor
:
ServicesAccessor
)
{
focusProblemsFilter
(
accessor
.
get
(
I
Panel
Service
));
focusProblemsFilter
(
accessor
.
get
(
I
Views
Service
));
}
});
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
Constants
.
MARKERS_
PANEL
_SHOW_MULTILINE_MESSAGE
,
id
:
Constants
.
MARKERS_
VIEW
_SHOW_MULTILINE_MESSAGE
,
title
:
{
value
:
localize
(
'
show multiline
'
,
"
Show message in multiple lines
"
),
original
:
'
Problems: Show message in multiple lines
'
},
category
:
localize
(
'
problems
'
,
"
Problems
"
),
menu
:
{
id
:
MenuId
.
CommandPalette
,
when
:
ActivePanelContext
.
isEqualTo
(
Constants
.
MARKERS_PANEL_ID
)
when
:
ContextKeyExpr
.
has
(
`
${
Constants
.
MARKERS_VIEW_ID
}
.visible`
)
}
});
}
run
(
accessor
:
ServicesAccessor
)
{
const
markersView
=
getMarkersView
(
accessor
.
get
(
IPanelService
))
;
const
markersView
=
accessor
.
get
(
IViewsService
).
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
)
!
;
if
(
markersView
)
{
markersView
.
markersViewModel
.
multiline
=
true
;
}
...
...
@@ -244,25 +243,25 @@ registerAction2(class extends Action2 {
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
Constants
.
MARKERS_
PANEL
_SHOW_SINGLELINE_MESSAGE
,
id
:
Constants
.
MARKERS_
VIEW
_SHOW_SINGLELINE_MESSAGE
,
title
:
{
value
:
localize
(
'
show singleline
'
,
"
Show message in single line
"
),
original
:
'
Problems: Show message in single line
'
},
category
:
localize
(
'
problems
'
,
"
Problems
"
),
menu
:
{
id
:
MenuId
.
CommandPalette
,
when
:
ActivePanelContext
.
isEqualTo
(
Constants
.
MARKERS_PANEL_ID
)
when
:
ContextKeyExpr
.
has
(
`
${
Constants
.
MARKERS_VIEW_ID
}
.visible`
)
}
});
}
run
(
accessor
:
ServicesAccessor
)
{
const
markersView
=
getMarkersView
(
accessor
.
get
(
IPanelService
)
);
const
markersView
=
accessor
.
get
(
IViewsService
).
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
);
if
(
markersView
)
{
markersView
.
markersViewModel
.
multiline
=
false
;
}
}
});
async
function
copyMarker
(
panelService
:
IPanel
Service
,
clipboardService
:
IClipboardService
)
{
const
markersView
=
getMarkersView
(
panelService
);
async
function
copyMarker
(
viewsService
:
IViews
Service
,
clipboardService
:
IClipboardService
)
{
const
markersView
=
viewsService
.
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
);
if
(
markersView
)
{
const
element
=
markersView
.
getFocusElement
();
if
(
element
instanceof
Marker
)
{
...
...
@@ -271,8 +270,8 @@ async function copyMarker(panelService: IPanelService, clipboardService: IClipbo
}
}
async
function
copyMessage
(
panelService
:
IPanel
Service
,
clipboardService
:
IClipboardService
)
{
const
markersView
=
getMarkersView
(
panelService
);
async
function
copyMessage
(
viewsService
:
IViews
Service
,
clipboardService
:
IClipboardService
)
{
const
markersView
=
viewsService
.
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
);
if
(
markersView
)
{
const
element
=
markersView
.
getFocusElement
();
if
(
element
instanceof
Marker
)
{
...
...
@@ -281,8 +280,8 @@ async function copyMessage(panelService: IPanelService, clipboardService: IClipb
}
}
async
function
copyRelatedInformationMessage
(
panelService
:
IPanel
Service
,
clipboardService
:
IClipboardService
)
{
const
markersView
=
getMarkersView
(
panelService
);
async
function
copyRelatedInformationMessage
(
viewsService
:
IViews
Service
,
clipboardService
:
IClipboardService
)
{
const
markersView
=
viewsService
.
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
);
if
(
markersView
)
{
const
element
=
markersView
.
getFocusElement
();
if
(
element
instanceof
RelatedInformation
)
{
...
...
@@ -291,15 +290,15 @@ async function copyRelatedInformationMessage(panelService: IPanelService, clipbo
}
}
function
focusProblemsView
(
panelService
:
IPanel
Service
)
{
const
markersView
=
getMarkersView
(
panelService
);
function
focusProblemsView
(
viewsService
:
IViews
Service
)
{
const
markersView
=
viewsService
.
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
);
if
(
markersView
)
{
markersView
.
focus
();
}
}
function
focusProblemsFilter
(
panelService
:
IPanel
Service
):
void
{
const
markersView
=
getMarkersView
(
panelService
);
function
focusProblemsFilter
(
viewsService
:
IViews
Service
):
void
{
const
markersView
=
viewsService
.
getActiveViewWithId
<
MarkersView
>
(
Constants
.
MARKERS_VIEW_ID
);
if
(
markersView
)
{
markersView
.
focusFilter
();
}
...
...
@@ -314,13 +313,12 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
order
:
4
});
CommandsRegistry
.
registerCommand
(
'
workbench.actions.view.toggleProblems
'
,
async
(
accessor
)
=>
{
const
panelService
=
accessor
.
get
(
IPanelService
);
const
panel
=
accessor
.
get
(
IPanelService
).
getActivePanel
();
if
(
panel
&&
panel
.
getId
()
===
Constants
.
MARKERS_PANEL_ID
)
{
panelService
.
hideActivePanel
();
CommandsRegistry
.
registerCommand
(
Constants
.
TOGGLE_MARKERS_VIEW_ACTION_ID
,
async
(
accessor
)
=>
{
const
viewsService
=
accessor
.
get
(
IViewsService
);
if
(
viewsService
.
isViewVisible
(
Constants
.
MARKERS_VIEW_ID
))
{
viewsService
.
closeView
(
Constants
.
MARKERS_VIEW_ID
);
}
else
{
await
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
,
true
);
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
,
true
);
}
});
...
...
src/vs/workbench/contrib/markers/browser/markers.ts
浏览文件 @
9f188595
...
...
@@ -70,6 +70,6 @@ export class ActivityUpdater extends Disposable implements IWorkbenchContributio
const
{
errors
,
warnings
,
infos
}
=
this
.
markerService
.
getStatistics
();
const
total
=
errors
+
warnings
+
infos
;
const
message
=
localize
(
'
totalProblems
'
,
'
Total {0} Problems
'
,
total
);
this
.
activity
.
value
=
this
.
activityService
.
showActivity
(
Constants
.
MARKERS_
PANEL
_ID
,
new
NumberBadge
(
total
,
()
=>
message
));
this
.
activity
.
value
=
this
.
activityService
.
showActivity
(
Constants
.
MARKERS_
CONTAINER
_ID
,
new
NumberBadge
(
total
,
()
=>
message
));
}
}
src/vs/workbench/contrib/markers/browser/markersView.ts
浏览文件 @
9f188595
...
...
@@ -9,7 +9,6 @@ import { URI } from 'vs/base/common/uri';
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IAction
,
IActionViewItem
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
PaneCompositePanel
}
from
'
vs/workbench/browser/panel
'
;
import
{
IEditorService
,
SIDE_GROUP
,
ACTIVE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
Constants
from
'
vs/workbench/contrib/markers/browser/constants
'
;
import
{
Marker
,
ResourceMarkers
,
RelatedInformation
,
MarkerChangesEvent
}
from
'
vs/workbench/contrib/markers/browser/markersModel
'
;
...
...
@@ -49,17 +48,8 @@ import { PANEL_BACKGROUND } from 'vs/workbench/common/theme';
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
editorLightBulbForeground
,
editorLightBulbAutoFixForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
ViewPane
,
IViewPaneOptions
}
from
'
vs/workbench/browser/parts/views/viewPaneContainer
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IViewDescriptorService
}
from
'
vs/workbench/common/views
'
;
export
function
getMarkersView
(
panelService
:
IPanelService
):
MarkersView
|
undefined
{
const
activePanel
=
panelService
.
getActivePanel
();
if
(
activePanel
instanceof
PaneCompositePanel
)
{
return
<
MarkersView
>
activePanel
.
getViewPaneContainer
().
getView
(
Constants
.
MARKERS_VIEW_ID
);
}
return
undefined
;
}
function
createResourceMarkersIterator
(
resourceMarkers
:
ResourceMarkers
):
Iterator
<
ITreeElement
<
TreeElement
>>
{
const
markersIt
=
Iterator
.
fromArray
(
resourceMarkers
.
markers
);
...
...
@@ -116,8 +106,8 @@ export class MarkersView extends ViewPane implements IMarkerFilterController {
@
IStorageService
storageService
:
IStorageService
,
)
{
super
({
...(
options
as
IViewPaneOptions
),
id
:
Constants
.
MARKERS_VIEW_ID
,
ariaHeaderLabel
:
Messages
.
MARKERS_PANEL_TITLE_PROBLEMS
},
keybindingService
,
contextMenuService
,
configurationService
,
contextKeyService
,
viewDescriptorService
,
instantiationService
);
this
.
panelFoucusContextKey
=
Constants
.
Marker
Panel
FocusContextKey
.
bindTo
(
contextKeyService
);
this
.
panelState
=
new
Memento
(
Constants
.
MARKERS_
PANEL
_STORAGE_ID
,
storageService
).
getMemento
(
StorageScope
.
WORKSPACE
);
this
.
panelFoucusContextKey
=
Constants
.
Marker
View
FocusContextKey
.
bindTo
(
contextKeyService
);
this
.
panelState
=
new
Memento
(
Constants
.
MARKERS_
VIEW
_STORAGE_ID
,
storageService
).
getMemento
(
StorageScope
.
WORKSPACE
);
this
.
markersViewModel
=
this
.
_register
(
instantiationService
.
createInstance
(
MarkersViewModel
,
this
.
panelState
[
'
multiline
'
]));
this
.
_register
(
this
.
markersViewModel
.
onDidChange
(
marker
=>
this
.
onDidChangeViewState
(
marker
)));
this
.
setCurrentActiveEditor
();
...
...
src/vs/workbench/contrib/markers/browser/markersViewActions.ts
浏览文件 @
9f188595
...
...
@@ -12,7 +12,6 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
Messages
from
'
vs/workbench/contrib/markers/browser/messages
'
;
import
Constants
from
'
vs/workbench/contrib/markers/browser/constants
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IThemeService
,
registerThemingParticipant
,
ICssStyleCollector
,
ITheme
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
attachInputBoxStyler
,
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -27,6 +26,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
FilterOptions
}
from
'
vs/workbench/contrib/markers/browser/markersFilterOptions
'
;
import
{
DropdownMenuActionViewItem
}
from
'
vs/base/browser/ui/dropdown/dropdown
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
export
class
ShowProblemsPanelAction
extends
Action
{
...
...
@@ -34,13 +34,13 @@ export class ShowProblemsPanelAction extends Action {
public
static
readonly
LABEL
=
Messages
.
MARKERS_PANEL_SHOW_LABEL
;
constructor
(
id
:
string
,
label
:
string
,
@
I
PanelService
private
readonly
panelService
:
IPanel
Service
@
I
ViewsService
private
readonly
viewsService
:
IViews
Service
)
{
super
(
id
,
label
);
}
public
run
():
Promise
<
any
>
{
return
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
,
true
);
return
this
.
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
,
true
);
}
}
...
...
@@ -271,7 +271,7 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
super
(
null
,
action
);
this
.
focusContextKey
=
Constants
.
Marker
Panel
FilterFocusContextKey
.
bindTo
(
contextKeyService
);
this
.
focusContextKey
=
Constants
.
Marker
View
FilterFocusContextKey
.
bindTo
(
contextKeyService
);
this
.
delayedFilterUpdate
=
new
Delayer
<
void
>
(
200
);
this
.
_register
(
toDisposable
(()
=>
this
.
delayedFilterUpdate
.
cancel
()));
this
.
_register
(
action
.
onFocus
(()
=>
this
.
focus
()));
...
...
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
浏览文件 @
9f188595
...
...
@@ -27,7 +27,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IFileService
,
IFileStat
}
from
'
vs/platform/files/common/files
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
CommandsRegistry
,
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ProblemMatcherRegistry
,
NamedProblemMatcher
}
from
'
vs/workbench/contrib/tasks/common/problemMatcher
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IProgressService
,
IProgressOptions
,
ProgressLocation
}
from
'
vs/platform/progress/common/progress
'
;
...
...
@@ -41,7 +41,6 @@ import { IModelService } from 'vs/editor/common/services/modelService';
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
Constants
from
'
vs/workbench/contrib/markers/browser/constants
'
;
import
{
IWorkbenchLayoutService
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
,
IWorkspaceFolder
,
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -80,6 +79,7 @@ import { ITextEditorSelection, TextEditorSelectionRevealType } from 'vs/platform
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
find
}
from
'
vs/base/common/arrays
'
;
import
{
CancellationToken
,
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
const
QUICKOPEN_HISTORY_LIMIT_CONFIG
=
'
task.quickOpen.history
'
;
const
QUICKOPEN_DETAIL_CONFIG
=
'
task.quickOpen.detail
'
;
...
...
@@ -238,6 +238,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
@
IMarkerService
protected
readonly
markerService
:
IMarkerService
,
@
IOutputService
protected
readonly
outputService
:
IOutputService
,
@
IPanelService
private
readonly
panelService
:
IPanelService
,
@
IViewsService
private
readonly
viewsService
:
IViewsService
,
@
ICommandService
private
readonly
commandService
:
ICommandService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IFileService
protected
readonly
fileService
:
IFileService
,
@
IWorkspaceContextService
protected
readonly
contextService
:
IWorkspaceContextService
,
...
...
@@ -257,7 +259,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
ITerminalInstanceService
private
readonly
terminalInstanceService
:
ITerminalInstanceService
,
@
IRemotePathService
private
readonly
remotePathService
:
IRemotePathService
,
@
ITextModelService
private
readonly
textModelResolverService
:
ITextModelService
,
...
...
@@ -413,14 +414,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
return
this
.
runShowTasks
();
});
CommandsRegistry
.
registerCommand
(
'
workbench.action.tasks.toggleProblems
'
,
async
()
=>
{
const
panel
=
this
.
panelService
.
getActivePanel
();
if
(
panel
&&
panel
.
getId
()
===
Constants
.
MARKERS_PANEL_ID
)
{
this
.
layoutService
.
setPanelHidden
(
true
);
}
else
{
await
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL_ID
,
true
);
}
});
CommandsRegistry
.
registerCommand
(
'
workbench.action.tasks.toggleProblems
'
,
()
=>
this
.
commandService
.
executeCommand
(
Constants
.
TOGGLE_MARKERS_VIEW_ACTION_ID
));
CommandsRegistry
.
registerCommand
(
'
workbench.action.tasks.openUserTasks
'
,
async
()
=>
{
const
resource
=
this
.
getResourceForKind
(
TaskSourceKind
.
User
);
...
...
@@ -1336,7 +1330,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
protected
createTerminalTaskSystem
():
ITaskSystem
{
return
new
TerminalTaskSystem
(
this
.
terminalService
,
this
.
outputService
,
this
.
panelService
,
this
.
markerService
,
this
.
terminalService
,
this
.
outputService
,
this
.
panelService
,
this
.
viewsService
,
this
.
markerService
,
this
.
modelService
,
this
.
configurationResolverService
,
this
.
telemetryService
,
this
.
contextService
,
this
.
environmentService
,
AbstractTaskService
.
OutputChannelId
,
this
.
fileService
,
this
.
terminalInstanceService
,
...
...
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
浏览文件 @
9f188595
...
...
@@ -45,6 +45,7 @@ import { Schemas } from 'vs/base/common/network';
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IRemotePathService
}
from
'
vs/workbench/services/path/common/remotePathService
'
;
import
{
env
as
processEnv
,
cwd
as
processCwd
}
from
'
vs/base/common/process
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
interface
TerminalData
{
terminal
:
ITerminalInstance
;
...
...
@@ -170,6 +171,7 @@ export class TerminalTaskSystem implements ITaskSystem {
private
terminalService
:
ITerminalService
,
private
outputService
:
IOutputService
,
private
panelService
:
IPanelService
,
private
viewsService
:
IViewsService
,
private
markerService
:
IMarkerService
,
private
modelService
:
IModelService
,
private
configurationResolverService
:
IConfigurationResolverService
,
private
telemetryService
:
ITelemetryService
,
...
...
@@ -619,7 +621,7 @@ export class TerminalTaskSystem implements ITaskSystem {
let
reveal
=
task
.
command
.
presentation
!
.
reveal
;
let
revealProblems
=
task
.
command
.
presentation
!
.
revealProblems
;
if
(
revealProblems
===
RevealProblemKind
.
OnProblem
)
{
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
,
true
);
this
.
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
,
true
);
}
else
if
(
reveal
===
RevealKind
.
Silent
)
{
this
.
terminalService
.
setActiveInstance
(
terminal
!
);
this
.
terminalService
.
showPanel
(
false
);
...
...
@@ -768,7 +770,7 @@ export class TerminalTaskSystem implements ITaskSystem {
let
revealProblems
=
task
.
command
.
presentation
!
.
revealProblems
;
let
revealProblemPanel
=
terminal
&&
(
revealProblems
===
RevealProblemKind
.
OnProblem
)
&&
(
startStopProblemMatcher
.
numberOfMatches
>
0
);
if
(
revealProblemPanel
)
{
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
);
this
.
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
);
}
else
if
(
terminal
&&
(
reveal
===
RevealKind
.
Silent
)
&&
((
exitCode
!==
0
)
||
(
startStopProblemMatcher
.
numberOfMatches
>
0
)
&&
startStopProblemMatcher
.
maxMarkerSeverity
&&
(
startStopProblemMatcher
.
maxMarkerSeverity
>=
MarkerSeverity
.
Error
)))
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
...
...
@@ -799,7 +801,7 @@ export class TerminalTaskSystem implements ITaskSystem {
let
showProblemPanel
=
task
.
command
.
presentation
&&
(
task
.
command
.
presentation
.
revealProblems
===
RevealProblemKind
.
Always
);
if
(
showProblemPanel
)
{
this
.
panelService
.
openPanel
(
Constants
.
MARKERS_PANEL
_ID
);
this
.
viewsService
.
openView
(
Constants
.
MARKERS_VIEW
_ID
);
}
else
if
(
task
.
command
.
presentation
&&
(
task
.
command
.
presentation
.
reveal
===
RevealKind
.
Always
))
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
task
.
command
.
presentation
.
focus
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录