Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ed2b9d0e
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,发现更多精彩内容 >>
提交
ed2b9d0e
编写于
9月 15, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make problem matcher work in multi folder setup
上级
c6176160
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
28 addition
and
24 deletion
+28
-24
src/vs/platform/markers/common/problemMatcher.ts
src/vs/platform/markers/common/problemMatcher.ts
+5
-5
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+5
-0
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
...rkbench/parts/tasks/electron-browser/task.contribution.ts
+1
-1
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
...kbench/parts/tasks/electron-browser/terminalTaskSystem.ts
+16
-17
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
+1
-1
未找到文件。
src/vs/platform/markers/common/problemMatcher.ts
浏览文件 @
ed2b9d0e
...
...
@@ -1180,13 +1180,13 @@ export class ProblemMatcherParser extends Parser {
let
kind
:
FileLocationKind
;
if
(
Types
.
isUndefined
(
description
.
fileLocation
))
{
fileLocation
=
FileLocationKind
.
Relative
;
filePrefix
=
'
${
cwd
}
'
;
filePrefix
=
'
${
workspaceFolder
}
'
;
}
else
if
(
Types
.
isString
(
description
.
fileLocation
))
{
kind
=
FileLocationKind
.
fromString
(
<
string
>
description
.
fileLocation
);
if
(
kind
)
{
fileLocation
=
kind
;
if
(
kind
===
FileLocationKind
.
Relative
)
{
filePrefix
=
'
${
cwd
}
'
;
filePrefix
=
'
${
workspaceFolder
}
'
;
}
}
}
else
if
(
Types
.
isStringArray
(
description
.
fileLocation
))
{
...
...
@@ -1601,7 +1601,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
owner
:
'
typescript
'
,
applyTo
:
ApplyToKind
.
closedDocuments
,
fileLocation
:
FileLocationKind
.
Relative
,
filePrefix
:
'
${
cwd
}
'
,
filePrefix
:
'
${
workspaceFolder
}
'
,
pattern
:
ProblemPatternRegistry
.
get
(
'
gulp-tsc
'
)
});
...
...
@@ -1629,7 +1629,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
owner
:
'
eslint
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Relative
,
filePrefix
:
'
${
cwd
}
'
,
filePrefix
:
'
${
workspaceFolder
}
'
,
pattern
:
ProblemPatternRegistry
.
get
(
'
eslint-compact
'
)
});
...
...
@@ -1648,7 +1648,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry {
owner
:
'
go
'
,
applyTo
:
ApplyToKind
.
allDocuments
,
fileLocation
:
FileLocationKind
.
Relative
,
filePrefix
:
'
${
cwd
}
'
,
filePrefix
:
'
${
workspaceFolder
}
'
,
pattern
:
ProblemPatternRegistry
.
get
(
'
go
'
)
});
}
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
ed2b9d0e
...
...
@@ -7,6 +7,7 @@
import
URI
from
'
vs/base/common/uri
'
;
import
*
as
Types
from
'
vs/base/common/types
'
;
import
{
IJSONSchemaMap
}
from
'
vs/base/common/jsonSchema
'
;
import
*
as
Objects
from
'
vs/base/common/objects
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ProblemMatcher
}
from
'
vs/platform/markers/common/problemMatcher
'
;
...
...
@@ -435,6 +436,10 @@ export namespace Task {
}
}
export
function
clone
(
task
:
Task
):
Task
{
return
Objects
.
assign
({},
task
);
}
export
function
getTelemetryKind
(
task
:
Task
):
string
{
if
(
ContributedTask
.
is
(
task
))
{
return
'
extension
'
;
...
...
src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
浏览文件 @
ed2b9d0e
...
...
@@ -1019,7 +1019,7 @@ class TaskService extends EventEmitter implements ITaskService {
this
.
customize
(
task
,
{
problemMatcher
:
[]
},
true
);
return
task
;
}
else
if
(
selected
.
matcher
)
{
let
newTask
=
Objects
.
deepC
lone
(
task
);
let
newTask
=
Task
.
c
lone
(
task
);
let
matcherReference
=
`$
${
selected
.
matcher
.
name
}
`
;
newTask
.
problemMatchers
=
[
matcherReference
];
this
.
customize
(
task
,
{
problemMatcher
:
[
matcherReference
]
},
true
);
...
...
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
ed2b9d0e
...
...
@@ -285,7 +285,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let
promise
:
TPromise
<
ITaskSummary
>
=
undefined
;
if
(
task
.
isBackground
)
{
promise
=
new
TPromise
<
ITaskSummary
>
((
resolve
,
reject
)
=>
{
const
problemMatchers
=
this
.
resolveMatchers
(
task
.
problemMatchers
);
const
problemMatchers
=
this
.
resolveMatchers
(
task
,
task
.
problemMatchers
);
let
watchingProblemMatcher
=
new
WatchingProblemCollector
(
problemMatchers
,
this
.
markerService
,
this
.
modelService
);
let
toUnbind
:
IDisposable
[]
=
[];
let
event
:
TaskEvent
=
{
taskId
:
task
.
_id
,
taskName
:
task
.
name
,
type
:
TaskType
.
Watching
,
group
:
task
.
group
,
__task
:
task
};
...
...
@@ -354,7 +354,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let
event
:
TaskEvent
=
{
taskId
:
task
.
_id
,
taskName
:
task
.
name
,
type
:
TaskType
.
SingleRun
,
group
:
task
.
group
,
__task
:
task
};
this
.
emit
(
TaskSystemEvents
.
Active
,
event
);
let
decoder
=
new
TerminalDecoder
();
let
problemMatchers
=
this
.
resolveMatchers
(
task
.
problemMatchers
);
let
problemMatchers
=
this
.
resolveMatchers
(
task
,
task
.
problemMatchers
);
let
startStopProblemMatcher
=
new
StartStopProblemCollector
(
problemMatchers
,
this
.
markerService
,
this
.
modelService
);
const
registeredLinkMatchers
=
this
.
registerLinkMatchers
(
terminal
,
problemMatchers
);
const
onData
=
terminal
.
onData
((
data
:
string
)
=>
{
...
...
@@ -428,7 +428,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
}
private
createTerminal
(
task
:
CustomTask
|
ContributedTask
):
[
ITerminalInstance
,
string
]
{
let
options
=
this
.
resolveOptions
(
task
.
command
.
options
);
let
options
=
this
.
resolveOptions
(
task
,
task
.
command
.
options
);
let
{
command
,
args
}
=
this
.
resolveCommandAndArgs
(
task
);
let
terminalName
=
nls
.
localize
(
'
TerminalTaskSystem.terminalName
'
,
'
Task - {0}
'
,
task
.
name
);
let
waitOnExit
:
boolean
|
string
=
false
;
...
...
@@ -566,8 +566,8 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
private
resolveCommandAndArgs
(
task
:
CustomTask
|
ContributedTask
):
{
command
:
string
,
args
:
string
[]
}
{
// First we need to use the command args:
let
args
:
string
[]
=
task
.
command
.
args
?
task
.
command
.
args
.
slice
()
:
[];
args
=
this
.
resolveVariables
(
args
);
let
command
:
string
=
this
.
resolveVariable
(
task
.
command
.
name
);
args
=
this
.
resolveVariables
(
task
,
args
);
let
command
:
string
=
this
.
resolveVariable
(
task
,
task
.
command
.
name
);
return
{
command
,
args
};
}
...
...
@@ -610,11 +610,11 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
return
command
;
}
private
resolveVariables
(
value
:
string
[]):
string
[]
{
return
value
.
map
(
s
=>
this
.
resolveVariable
(
s
));
private
resolveVariables
(
task
:
CustomTask
|
ContributedTask
,
value
:
string
[]):
string
[]
{
return
value
.
map
(
s
=>
this
.
resolveVariable
(
task
,
s
));
}
private
resolveMatchers
(
values
:
(
string
|
ProblemMatcher
)[]):
ProblemMatcher
[]
{
private
resolveMatchers
(
task
:
CustomTask
|
ContributedTask
,
values
:
(
string
|
ProblemMatcher
)[]):
ProblemMatcher
[]
{
if
(
values
===
void
0
||
values
===
null
||
values
.
length
===
0
)
{
return
[];
}
...
...
@@ -638,31 +638,30 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
result
.
push
(
matcher
);
}
else
{
let
copy
=
Objects
.
clone
(
matcher
);
copy
.
filePrefix
=
this
.
resolveVariable
(
copy
.
filePrefix
);
copy
.
filePrefix
=
this
.
resolveVariable
(
task
,
copy
.
filePrefix
);
result
.
push
(
copy
);
}
});
return
result
;
}
private
resolveVariable
(
value
:
string
):
string
{
// TODO@Dirk adopt new configuration resolver service https://github.com/Microsoft/vscode/issues/31365
return
this
.
configurationResolverService
.
resolve
(
this
.
contextService
.
getWorkspace
().
folders
[
0
],
value
);
private
resolveVariable
(
task
:
CustomTask
|
ContributedTask
,
value
:
string
):
string
{
return
this
.
configurationResolverService
.
resolve
(
Task
.
getWorkspaceFolder
(
task
).
uri
,
value
);
}
private
resolveOptions
(
options
:
CommandOptions
):
CommandOptions
{
private
resolveOptions
(
task
:
CustomTask
|
ContributedTask
,
options
:
CommandOptions
):
CommandOptions
{
if
(
options
===
void
0
||
options
===
null
)
{
return
{
cwd
:
this
.
resolveVariable
(
'
${cwd
}
'
)
};
return
{
cwd
:
this
.
resolveVariable
(
task
,
'
${workspaceFolder
}
'
)
};
}
let
result
:
CommandOptions
=
Types
.
isString
(
options
.
cwd
)
?
{
cwd
:
this
.
resolveVariable
(
options
.
cwd
)
}
:
{
cwd
:
this
.
resolveVariable
(
'
${cwd
}
'
)
};
?
{
cwd
:
this
.
resolveVariable
(
task
,
options
.
cwd
)
}
:
{
cwd
:
this
.
resolveVariable
(
task
,
'
${workspaceFolder
}
'
)
};
if
(
options
.
env
)
{
result
.
env
=
Object
.
create
(
null
);
Object
.
keys
(
options
.
env
).
forEach
((
key
)
=>
{
let
value
:
any
=
options
.
env
[
key
];
if
(
Types
.
isString
(
value
))
{
result
.
env
[
key
]
=
this
.
resolveVariable
(
value
);
result
.
env
[
key
]
=
this
.
resolveVariable
(
task
,
value
);
}
else
{
result
.
env
[
key
]
=
value
.
toString
();
}
...
...
src/vs/workbench/parts/tasks/node/taskConfiguration.ts
浏览文件 @
ed2b9d0e
...
...
@@ -617,7 +617,7 @@ namespace ShellConfiguration {
namespace
CommandOptions
{
const
properties
:
MetaData
<
Tasks
.
CommandOptions
,
Tasks
.
ShellConfiguration
>
[]
=
[{
property
:
'
cwd
'
},
{
property
:
'
env
'
},
{
property
:
'
shell
'
,
type
:
ShellConfiguration
}];
const
defaults
:
CommandOptions
=
{
cwd
:
'
${workspace
Root
}
'
};
const
defaults
:
CommandOptions
=
{
cwd
:
'
${workspace
Folder
}
'
};
export
function
from
(
this
:
void
,
options
:
CommandOptions
,
context
:
ParseContext
):
Tasks
.
CommandOptions
{
let
result
:
Tasks
.
CommandOptions
=
{};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录