Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1d237013
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,发现更多精彩内容 >>
提交
1d237013
编写于
4月 25, 2018
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #46439: Task exit code is set to 1 regardless of problem severity
上级
a7e2e2d7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
14 deletion
+37
-14
src/vs/workbench/parts/tasks/common/problemCollectors.ts
src/vs/workbench/parts/tasks/common/problemCollectors.ts
+19
-4
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
...kbench/parts/tasks/electron-browser/terminalTaskSystem.ts
+18
-10
未找到文件。
src/vs/workbench/parts/tasks/common/problemCollectors.ts
浏览文件 @
1d237013
...
...
@@ -12,7 +12,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ILineMatcher
,
createLineMatcher
,
ProblemMatcher
,
ProblemMatch
,
ApplyToKind
,
WatchingPattern
,
getResource
}
from
'
vs/workbench/parts/tasks/common/problemMatcher
'
;
import
{
IMarkerService
,
IMarkerData
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IMarkerService
,
IMarkerData
,
MarkerSeverity
}
from
'
vs/platform/markers/common/markers
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
export
enum
ProblemCollectorEventKind
{
...
...
@@ -39,6 +39,7 @@ export class AbstractProblemCollector implements IDisposable {
private
matchers
:
INumberDictionary
<
ILineMatcher
[]
>
;
private
activeMatcher
:
ILineMatcher
;
private
_numberOfMatches
:
number
;
private
_maxMarkerSeverity
:
MarkerSeverity
;
private
buffer
:
string
[];
private
bufferLength
:
number
;
private
openModels
:
IStringDictionary
<
boolean
>
;
...
...
@@ -73,6 +74,7 @@ export class AbstractProblemCollector implements IDisposable {
this
.
buffer
=
[];
this
.
activeMatcher
=
null
;
this
.
_numberOfMatches
=
0
;
this
.
_maxMarkerSeverity
=
undefined
;
this
.
openModels
=
Object
.
create
(
null
);
this
.
modelListeners
=
[];
this
.
applyToByOwner
=
new
Map
<
string
,
ApplyToKind
>
();
...
...
@@ -110,12 +112,16 @@ export class AbstractProblemCollector implements IDisposable {
return
this
.
_numberOfMatches
;
}
public
get
maxMarkerSeverity
():
MarkerSeverity
{
return
this
.
_maxMarkerSeverity
;
}
protected
tryFindMarker
(
line
:
string
):
ProblemMatch
{
let
result
:
ProblemMatch
=
null
;
if
(
this
.
activeMatcher
)
{
result
=
this
.
activeMatcher
.
next
(
line
);
if
(
result
)
{
this
.
_numberOfMatches
++
;
this
.
captureMatch
(
result
)
;
return
result
;
}
this
.
clearBuffer
();
...
...
@@ -170,7 +176,7 @@ export class AbstractProblemCollector implements IDisposable {
let
matcher
=
candidates
[
i
];
let
result
=
matcher
.
handle
(
this
.
buffer
,
startIndex
);
if
(
result
.
match
)
{
this
.
_numberOfMatches
++
;
this
.
captureMatch
(
result
.
match
)
;
if
(
result
.
continue
)
{
this
.
activeMatcher
=
matcher
;
}
...
...
@@ -181,6 +187,13 @@ export class AbstractProblemCollector implements IDisposable {
return
null
;
}
private
captureMatch
(
match
:
ProblemMatch
):
void
{
this
.
_numberOfMatches
++
;
if
(
this
.
_maxMarkerSeverity
===
void
0
||
match
.
marker
.
severity
>
this
.
_maxMarkerSeverity
)
{
this
.
_maxMarkerSeverity
=
match
.
marker
.
severity
;
}
}
private
clearBuffer
():
void
{
if
(
this
.
buffer
.
length
>
0
)
{
this
.
buffer
=
[];
...
...
@@ -300,6 +313,8 @@ export class AbstractProblemCollector implements IDisposable {
}
protected
cleanMarkerCaches
():
void
{
this
.
_numberOfMatches
=
0
;
this
.
_maxMarkerSeverity
=
undefined
;
this
.
markers
.
clear
();
this
.
deliveredMarkers
.
clear
();
}
...
...
@@ -464,10 +479,10 @@ export class WatchingProblemCollector extends AbstractProblemCollector implement
if
(
matches
)
{
if
(
this
.
_activeBackgroundMatchers
.
has
(
background
.
key
))
{
this
.
_activeBackgroundMatchers
.
delete
(
background
.
key
);
this
.
resetCurrentResource
();
this
.
_onDidStateChange
.
fire
(
ProblemCollectorEvent
.
create
(
ProblemCollectorEventKind
.
BackgroundProcessingEnds
));
result
=
true
;
let
owner
=
background
.
matcher
.
owner
;
this
.
resetCurrentResource
();
this
.
cleanMarkers
(
owner
);
this
.
cleanMarkerCaches
();
}
...
...
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
1d237013
...
...
@@ -20,7 +20,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
TPath
from
'
vs/base/common/paths
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IMarkerService
,
MarkerSeverity
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ProblemMatcher
,
ProblemMatcherRegistry
/*, ProblemPattern, getResource */
}
from
'
vs/workbench/parts/tasks/common/problemMatcher
'
;
...
...
@@ -290,6 +290,13 @@ export class TerminalTaskSystem implements ITaskSystem {
}
else
if
(
event
.
kind
===
ProblemCollectorEventKind
.
BackgroundProcessingEnds
)
{
eventCounter
--
;
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
Inactive
,
task
));
if
(
eventCounter
===
0
)
{
let
reveal
=
task
.
command
.
presentation
.
reveal
;
if
(
reveal
===
RevealKind
.
Silent
&&
watchingProblemMatcher
.
numberOfMatches
>
0
&&
watchingProblemMatcher
.
maxMarkerSeverity
>=
MarkerSeverity
.
Error
)
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
false
);
}
}
}
}));
watchingProblemMatcher
.
aboutToStart
();
...
...
@@ -324,6 +331,11 @@ export class TerminalTaskSystem implements ITaskSystem {
this
.
idleTaskTerminals
.
set
(
key
,
terminal
.
id
.
toString
(),
Touch
.
AsOld
);
break
;
}
let
reveal
=
task
.
command
.
presentation
.
reveal
;
if
(
reveal
===
RevealKind
.
Silent
&&
(
exitCode
!==
0
||
watchingProblemMatcher
.
numberOfMatches
>
0
&&
watchingProblemMatcher
.
maxMarkerSeverity
>=
MarkerSeverity
.
Error
))
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
false
);
}
watchingProblemMatcher
.
done
();
watchingProblemMatcher
.
dispose
();
registeredLinkMatchers
.
forEach
(
handle
=>
terminal
.
deregisterLinkMatcher
(
handle
));
...
...
@@ -334,11 +346,6 @@ export class TerminalTaskSystem implements ITaskSystem {
this
.
_onDidStateChange
.
fire
(
event
);
}
eventCounter
=
0
;
let
reveal
=
task
.
command
.
presentation
.
reveal
;
if
(
exitCode
&&
exitCode
===
1
&&
watchingProblemMatcher
.
numberOfMatches
===
0
&&
reveal
!==
RevealKind
.
Never
)
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
false
);
}
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
End
,
task
));
resolve
({
exitCode
});
});
...
...
@@ -371,15 +378,16 @@ export class TerminalTaskSystem implements ITaskSystem {
this
.
idleTaskTerminals
.
set
(
key
,
terminal
.
id
.
toString
(),
Touch
.
AsOld
);
break
;
}
let
reveal
=
task
.
command
.
presentation
.
reveal
;
if
(
reveal
===
RevealKind
.
Silent
&&
(
exitCode
!==
0
||
startStopProblemMatcher
.
numberOfMatches
>
0
&&
startStopProblemMatcher
.
maxMarkerSeverity
>=
MarkerSeverity
.
Error
))
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
false
);
}
startStopProblemMatcher
.
done
();
startStopProblemMatcher
.
dispose
();
registeredLinkMatchers
.
forEach
(
handle
=>
terminal
.
deregisterLinkMatcher
(
handle
));
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
Inactive
,
task
));
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
End
,
task
));
// See https://github.com/Microsoft/vscode/issues/31965
if
(
exitCode
===
0
&&
startStopProblemMatcher
.
numberOfMatches
>
0
)
{
exitCode
=
1
;
}
resolve
({
exitCode
});
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录