Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
44762243
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
44762243
编写于
5月 26, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove ProblemMatchers from API.
上级
e81c07d7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
231 addition
and
227 deletion
+231
-227
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+3
-212
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+0
-2
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+4
-4
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+11
-9
src/vs/workbench/parts/tasks/common/task.api.ts
src/vs/workbench/parts/tasks/common/task.api.ts
+213
-0
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
44762243
...
...
@@ -3509,215 +3509,6 @@ declare module 'vscode' {
update
(
key
:
string
,
value
:
any
):
Thenable
<
void
>
;
}
/**
* Defines a problem pattern
*/
export
interface
ProblemPattern
{
/**
* The regular expression to find a problem in the console output of an
* executed task.
*/
regexp
:
RegExp
;
/**
* The match group index of the filename.
*
* Defaults to 1 if omitted.
*/
file
?:
number
;
/**
* The match group index of the problems's location. Valid location
* patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn).
* If omitted the line and colum properties are used.
*/
location
?:
number
;
/**
* The match group index of the problem's line in the source file.
*
* Defaults to 2 if omitted.
*/
line
?:
number
;
/**
* The match group index of the problem's character in the source file.
*
* Defaults to 3 if omitted.
*/
character
?:
number
;
/**
* The match group index of the problem's end line in the source file.
*
* Defaults to undefined. No end line is captured.
*/
endLine
?:
number
;
/**
* The match group index of the problem's end character in the source file.
*
* Defaults to undefined. No end column is captured.
*/
endCharacter
?:
number
;
/**
* The match group index of the problem's severity.
*
* Defaults to undefined. In this case the problem matcher's severity
* is used.
*/
severity
?:
number
;
/**
* The match group index of the problems's code.
*
* Defaults to undefined. No code is captured.
*/
code
?:
number
;
/**
* The match group index of the message. If omitted it defaults
* to 4 if location is specified. Otherwise it defaults to 5.
*/
message
?:
number
;
/**
* Specifies if the last pattern in a multi line problem matcher should
* loop as long as it does match a line consequently. Only valid on the
* last problem pattern in a multi line problem matcher.
*/
loop
?:
boolean
;
}
/**
* A multi line problem pattern.
*/
export
type
MultiLineProblemPattern
=
ProblemPattern
[];
/**
* The way how the file location is interpreted
*/
export
enum
FileLocationKind
{
/**
* VS Code should decide based on whether the file path found in the
* output is absolute or relative. A relative file path will be treated
* relative to the workspace root.
*/
Auto
=
1
,
/**
* Always treat the file path relative.
*/
Relative
=
2
,
/**
* Always treat the file path absolute.
*/
Absolute
=
3
}
/**
* Controls to which kind of documents problems are applied.
*/
export
enum
ApplyToKind
{
/**
* Problems are applied to all documents.
*/
AllDocuments
=
1
,
/**
* Problems are applied to open documents only.
*/
OpenDocuments
=
2
,
/**
* Problems are applied to closed documents only.
*/
ClosedDocuments
=
3
}
/**
* A background monitor pattern
*/
export
interface
BackgroundPattern
{
/**
* The actual regular expression
*/
regexp
:
RegExp
;
/**
* The match group index of the filename. If provided the expression
* is matched for that file only.
*/
file
?:
number
;
}
/**
* A description to control the activity of a problem matcher
* watching a background task.
*/
export
interface
BackgroundMonitor
{
/**
* If set to true the monitor is in active mode when the task
* starts. This is equals of issuing a line that matches the
* beginPattern.
*/
activeOnStart
?:
boolean
;
/**
* If matched in the output the start of a background activity is signaled.
*/
beginsPattern
:
RegExp
|
BackgroundPattern
;
/**
* If matched in the output the end of a background activity is signaled.
*/
endsPattern
:
RegExp
|
BackgroundPattern
;
}
/**
* Defines a problem matcher
*/
export
interface
ProblemMatcher
{
/**
* The owner of a problem. Defaults to a generated id
* if omitted.
*/
owner
?:
string
;
/**
* The type of documents problems detected by this matcher
* apply to. Default to `ApplyToKind.AllDocuments` if omitted.
*/
applyTo
?:
ApplyToKind
;
/**
* How a file location recognized by a matcher should be interpreted. If omitted the file location
* if `FileLocationKind.Auto`.
*/
fileLocation
?:
FileLocationKind
|
string
;
/**
* The actual pattern used by the problem matcher.
*/
pattern
:
ProblemPattern
|
MultiLineProblemPattern
;
/**
* The default severity of a detected problem in the output. Used
* if the `ProblemPattern` doesn't define a severity match group.
*/
severity
?:
DiagnosticSeverity
;
/**
* A background monitor for tasks that are running in the background.
*/
backgound
?:
BackgroundMonitor
;
}
/**
* Controls the behaviour of the terminal's visibility.
*/
...
...
@@ -3797,7 +3588,7 @@ declare module 'vscode' {
/**
* The ProblemMatchers type definition.
*/
export
type
ProblemMatchers
=
string
|
ProblemMatcher
|
(
string
|
ProblemMatcher
)
[];
export
type
ProblemMatchers
=
string
|
string
[];
/**
* A task that starts an external process.
...
...
@@ -3881,7 +3672,7 @@ declare module 'vscode' {
* The problem matchers attached to the task. Defaults to an empty
* array.
*/
problemMatchers
:
(
string
|
ProblemMatcher
)
[];
problemMatchers
:
string
[];
}
export
type
ShellOptions
=
{
...
...
@@ -4001,7 +3792,7 @@ declare module 'vscode' {
* The problem matchers attached to the task. Defaults to an empty
* array.
*/
problemMatchers
:
(
string
|
ProblemMatcher
)
[];
problemMatchers
:
string
[];
}
export
type
Task
=
ProcessTask
|
ShellTask
;
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
44762243
...
...
@@ -536,8 +536,6 @@ export function createApiFactory(
TreeItemCollapsibleState
:
extHostTypes
.
TreeItemCollapsibleState
,
ThemeColor
:
extHostTypes
.
ThemeColor
,
// functions
FileLocationKind
:
extHostTypes
.
FileLocationKind
,
ApplyToKind
:
extHostTypes
.
ApplyToKind
,
RevealKind
:
extHostTypes
.
RevealKind
,
TaskGroup
:
extHostTypes
.
TaskGroup
,
ShellTask
:
extHostTypes
.
ShellTask
,
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
44762243
...
...
@@ -8,13 +8,11 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
*
as
UUID
from
'
vs/base/common/uuid
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
*
as
Problems
from
'
vs/platform/markers/common/problemMatcher
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
*
as
TaskSystem
from
'
vs/workbench/parts/tasks/common/tasks
'
;
import
{
IThreadService
}
from
'
vs/workbench/services/thread/common/threadService
'
;
import
{
MainContext
,
MainThreadTaskShape
,
ExtHostTaskShape
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
fromDiagnosticSeverity
}
from
'
vs/workbench/api/node/extHostTypeConverters
'
;
import
*
as
types
from
'
vs/workbench/api/node/extHostTypes
'
;
import
*
as
vscode
from
'
vscode
'
;
...
...
@@ -23,6 +21,7 @@ interface StringMap<V> {
[
key
:
string
]:
V
;
}
/*
namespace ProblemPattern {
export function from(value: vscode.ProblemPattern | vscode.MultiLineProblemPattern): Problems.ProblemPattern | Problems.MultiLineProblemPattern {
if (value === void 0 || value === null) {
...
...
@@ -144,7 +143,7 @@ namespace WatchingPattern {
}
}
namespace
WathingMatche
r
{
namespace
BackgroundMonito
r {
export function from(value: vscode.BackgroundMonitor): Problems.WatchingMatcher {
if (value === void 0 || value === null) {
return undefined;
...
...
@@ -190,6 +189,7 @@ namespace ProblemMatcher {
return result;
}
}
*/
namespace
RevealKind
{
export
function
from
(
value
:
vscode
.
RevealKind
):
TaskSystem
.
ShowOutput
{
...
...
@@ -314,7 +314,7 @@ namespace Tasks {
showOutput
:
behaviour
.
showOutput
,
isBackground
:
!!
task
.
isBackground
,
suppressTaskName
:
true
,
problemMatchers
:
ProblemMatcher
.
from
(
task
.
problemMatchers
)
problemMatchers
:
task
.
problemMatchers
.
slice
(
)
};
return
result
;
}
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
44762243
...
...
@@ -1018,12 +1018,12 @@ export enum RevealKind {
export
class
BaseTask
{
private
_name
:
string
;
private
_problemMatchers
:
(
string
|
vscode
.
ProblemMatcher
)
[];
private
_problemMatchers
:
string
[];
private
_identifier
:
string
;
private
_isBackground
:
boolean
;
private
_terminal
:
vscode
.
TerminalBehaviour
;
constructor
(
name
:
string
,
problemMatchers
:
(
string
|
vscode
.
ProblemMatcher
)
[])
{
constructor
(
name
:
string
,
problemMatchers
:
string
[])
{
if
(
typeof
name
!==
'
string
'
)
{
throw
illegalArgument
(
'
name
'
);
}
...
...
@@ -1074,11 +1074,11 @@ export class BaseTask {
this
.
_terminal
=
value
;
}
get
problemMatchers
():
(
string
|
vscode
.
ProblemMatcher
)
[]
{
get
problemMatchers
():
string
[]
{
return
this
.
_problemMatchers
;
}
set
problemMatchers
(
value
:
(
string
|
vscode
.
ProblemMatcher
)
[])
{
set
problemMatchers
(
value
:
string
[])
{
if
(
!
Array
.
isArray
(
value
))
{
value
=
[];
}
...
...
@@ -1086,12 +1086,14 @@ export class BaseTask {
}
}
/*
namespace ProblemMatcher {
export function is(value: any): value is vscode.ProblemMatcher {
let candidate: vscode.ProblemMatcher = value;
return candidate && !!candidate.pattern;
}
}
*/
namespace
ShellOptions
{
export
function
is
(
value
:
any
):
value
is
vscode
.
ShellOptions
{
...
...
@@ -1144,7 +1146,7 @@ export class ProcessTask extends BaseTask {
args
=
arg3
||
[];
if
(
arg4
)
{
if
(
Array
.
isArray
(
arg4
)
||
typeof
arg4
===
'
string
'
||
ProblemMatcher
.
is
(
arg4
)
)
{
if
(
Array
.
isArray
(
arg4
)
||
typeof
arg4
===
'
string
'
)
{
problemMatchers
=
arg4
;
}
else
{
options
=
arg4
;
...
...
@@ -1153,8 +1155,8 @@ export class ProcessTask extends BaseTask {
if
(
arg5
&&
!
problemMatchers
)
{
problemMatchers
=
arg5
;
}
let
pm
:
(
string
|
vscode
.
ProblemMatcher
)
[];
if
(
problemMatchers
&&
(
typeof
problemMatchers
===
'
string
'
||
ProblemMatcher
.
is
(
problemMatchers
)
))
{
let
pm
:
string
[];
if
(
problemMatchers
&&
(
typeof
problemMatchers
===
'
string
'
))
{
pm
=
[
problemMatchers
];
}
else
if
(
Array
.
isArray
(
problemMatchers
))
{
pm
=
problemMatchers
;
...
...
@@ -1217,13 +1219,13 @@ export class ShellTask extends BaseTask implements vscode.ShellTask {
throw
illegalArgument
(
'
commandLine
'
);
}
let
options
:
vscode
.
ShellOptions
=
undefined
;
let
pm
:
(
string
|
vscode
.
ProblemMatcher
)
[];
let
pm
:
string
[];
if
(
ShellOptions
.
is
(
optionsOrProblemMatchers
))
{
options
=
optionsOrProblemMatchers
;
}
else
{
problemMatchers
=
optionsOrProblemMatchers
;
}
if
(
problemMatchers
&&
(
typeof
problemMatchers
===
'
string
'
||
ProblemMatcher
.
is
(
problemMatchers
)
))
{
if
(
problemMatchers
&&
(
typeof
problemMatchers
===
'
string
'
))
{
pm
=
[
problemMatchers
];
}
else
if
(
Array
.
isArray
(
problemMatchers
))
{
pm
=
problemMatchers
;
...
...
src/vs/workbench/parts/tasks/common/task.api.ts
0 → 100644
浏览文件 @
44762243
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Defines a problem pattern
*/
export
interface
ProblemPattern
{
/**
* The regular expression to find a problem in the console output of an
* executed task.
*/
regexp
:
RegExp
;
/**
* The match group index of the filename.
*
* Defaults to 1 if omitted.
*/
file
?:
number
;
/**
* The match group index of the problems's location. Valid location
* patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn).
* If omitted the line and colum properties are used.
*/
location
?:
number
;
/**
* The match group index of the problem's line in the source file.
*
* Defaults to 2 if omitted.
*/
line
?:
number
;
/**
* The match group index of the problem's character in the source file.
*
* Defaults to 3 if omitted.
*/
character
?:
number
;
/**
* The match group index of the problem's end line in the source file.
*
* Defaults to undefined. No end line is captured.
*/
endLine
?:
number
;
/**
* The match group index of the problem's end character in the source file.
*
* Defaults to undefined. No end column is captured.
*/
endCharacter
?:
number
;
/**
* The match group index of the problem's severity.
*
* Defaults to undefined. In this case the problem matcher's severity
* is used.
*/
severity
?:
number
;
/**
* The match group index of the problems's code.
*
* Defaults to undefined. No code is captured.
*/
code
?:
number
;
/**
* The match group index of the message. If omitted it defaults
* to 4 if location is specified. Otherwise it defaults to 5.
*/
message
?:
number
;
/**
* Specifies if the last pattern in a multi line problem matcher should
* loop as long as it does match a line consequently. Only valid on the
* last problem pattern in a multi line problem matcher.
*/
loop
?:
boolean
;
}
/**
* A multi line problem pattern.
*/
export
type
MultiLineProblemPattern
=
ProblemPattern
[];
/**
* The way how the file location is interpreted
*/
export
enum
FileLocationKind
{
/**
* VS Code should decide based on whether the file path found in the
* output is absolute or relative. A relative file path will be treated
* relative to the workspace root.
*/
Auto
=
1
,
/**
* Always treat the file path relative.
*/
Relative
=
2
,
/**
* Always treat the file path absolute.
*/
Absolute
=
3
}
/**
* Controls to which kind of documents problems are applied.
*/
export
enum
ApplyToKind
{
/**
* Problems are applied to all documents.
*/
AllDocuments
=
1
,
/**
* Problems are applied to open documents only.
*/
OpenDocuments
=
2
,
/**
* Problems are applied to closed documents only.
*/
ClosedDocuments
=
3
}
/**
* A background monitor pattern
*/
export
interface
BackgroundPattern
{
/**
* The actual regular expression
*/
regexp
:
RegExp
;
/**
* The match group index of the filename. If provided the expression
* is matched for that file only.
*/
file
?:
number
;
}
/**
* A description to control the activity of a problem matcher
* watching a background task.
*/
export
interface
BackgroundMonitor
{
/**
* If set to true the monitor is in active mode when the task
* starts. This is equals of issuing a line that matches the
* beginPattern.
*/
activeOnStart
?:
boolean
;
/**
* If matched in the output the start of a background activity is signaled.
*/
beginsPattern
:
RegExp
|
BackgroundPattern
;
/**
* If matched in the output the end of a background activity is signaled.
*/
endsPattern
:
RegExp
|
BackgroundPattern
;
}
/**
* Defines a problem matcher
*/
export
interface
ProblemMatcher
{
/**
* The owner of a problem. Defaults to a generated id
* if omitted.
*/
owner
?:
string
;
/**
* The type of documents problems detected by this matcher
* apply to. Default to `ApplyToKind.AllDocuments` if omitted.
*/
applyTo
?:
ApplyToKind
;
/**
* How a file location recognized by a matcher should be interpreted. If omitted the file location
* if `FileLocationKind.Auto`.
*/
fileLocation
?:
FileLocationKind
|
string
;
/**
* The actual pattern used by the problem matcher.
*/
pattern
:
ProblemPattern
|
MultiLineProblemPattern
;
/**
* The default severity of a detected problem in the output. Used
* if the `ProblemPattern` doesn't define a severity match group.
*/
severity
?:
any
;
/**
* A background monitor for tasks that are running in the background.
*/
backgound
?:
BackgroundMonitor
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录