Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
83001adc
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,发现更多精彩内容 >>
提交
83001adc
编写于
5月 31, 2017
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More work on #27581
上级
c78ebcb2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
32 addition
and
32 deletion
+32
-32
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+2
-2
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+2
-2
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+6
-6
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
+11
-11
src/vs/workbench/parts/tasks/common/tasks.ts
src/vs/workbench/parts/tasks/common/tasks.ts
+1
-1
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
...kbench/parts/tasks/electron-browser/terminalTaskSystem.ts
+6
-6
src/vs/workbench/parts/tasks/node/processTaskSystem.ts
src/vs/workbench/parts/tasks/node/processTaskSystem.ts
+2
-2
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
+2
-2
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
83001adc
...
...
@@ -3700,7 +3700,7 @@ declare module 'vscode' {
/**
* The terminal behavior. Defaults to an empty object literal.
*/
terminal
:
TaskTerminalBehavior
;
terminal
Behavior
:
TaskTerminalBehavior
;
/**
* The problem matchers attached to the task. Defaults to an empty
...
...
@@ -3832,7 +3832,7 @@ declare module 'vscode' {
/**
* The terminal behavior. Defaults to an empty object literal.
*/
terminal
:
TaskTerminalBehavior
;
terminal
Behavior
:
TaskTerminalBehavior
;
/**
* The problem matchers attached to the task. Defaults to an empty
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
83001adc
...
...
@@ -338,7 +338,7 @@ namespace Tasks {
name
:
value
.
process
,
args
:
Strings
.
from
(
value
.
args
),
type
:
TaskSystem
.
CommandType
.
Process
,
terminal
:
TerminalBehaviour
.
from
(
value
.
terminal
)
terminal
Behavior
:
TerminalBehaviour
.
from
(
value
.
terminalBehavior
)
};
if
(
value
.
options
)
{
result
.
options
=
CommandOptions
.
from
(
value
.
options
);
...
...
@@ -353,7 +353,7 @@ namespace Tasks {
let
result
:
TaskSystem
.
CommandConfiguration
=
{
name
:
value
.
commandLine
,
type
:
TaskSystem
.
CommandType
.
Shell
,
terminal
:
TerminalBehaviour
.
from
(
value
.
terminal
)
terminal
Behavior
:
TerminalBehaviour
.
from
(
value
.
terminalBehavior
)
};
if
(
value
.
options
)
{
result
.
options
=
CommandOptions
.
from
(
value
.
options
);
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
83001adc
...
...
@@ -1045,7 +1045,7 @@ export class BaseTask {
private
_isBackground
:
boolean
;
private
_source
:
string
;
private
_group
:
string
;
private
_terminal
:
vscode
.
TaskTerminalBehavior
;
private
_terminal
Behavior
:
vscode
.
TaskTerminalBehavior
;
constructor
(
name
:
string
,
problemMatchers
:
string
[])
{
if
(
typeof
name
!==
'
string
'
)
{
...
...
@@ -1054,7 +1054,7 @@ export class BaseTask {
this
.
_name
=
name
;
this
.
_problemMatchers
=
problemMatchers
||
[];
this
.
_isBackground
=
false
;
this
.
_terminal
=
Object
.
create
(
null
);
this
.
_terminal
Behavior
=
Object
.
create
(
null
);
}
get
identifier
():
string
{
...
...
@@ -1116,15 +1116,15 @@ export class BaseTask {
this
.
_group
=
value
;
}
get
terminal
():
vscode
.
TaskTerminalBehavior
{
return
this
.
_terminal
;
get
terminal
Behavior
():
vscode
.
TaskTerminalBehavior
{
return
this
.
_terminal
Behavior
;
}
set
terminal
(
value
:
vscode
.
TaskTerminalBehavior
)
{
set
terminal
Behavior
(
value
:
vscode
.
TaskTerminalBehavior
)
{
if
(
value
===
void
0
||
value
===
null
)
{
value
=
Object
.
create
(
null
);
}
this
.
_terminal
=
value
;
this
.
_terminal
Behavior
=
value
;
}
get
problemMatchers
():
string
[]
{
...
...
src/vs/workbench/parts/tasks/common/taskConfiguration.ts
浏览文件 @
83001adc
...
...
@@ -568,7 +568,7 @@ namespace CommandConfiguration {
let
result
:
Tasks
.
CommandConfiguration
=
{
name
:
undefined
,
type
:
undefined
,
terminal
:
undefined
terminal
Behavior
:
undefined
};
if
(
Types
.
isString
(
config
.
command
))
{
result
.
name
=
config
.
command
;
...
...
@@ -600,7 +600,7 @@ namespace CommandConfiguration {
}
let
terminal
=
TerminalBehavior
.
from
(
config
,
context
);
if
(
terminal
)
{
result
.
terminal
=
terminal
;
result
.
terminal
Behavior
=
terminal
;
}
if
(
Types
.
isString
(
config
.
taskSelector
))
{
result
.
taskSelector
=
config
.
taskSelector
;
...
...
@@ -609,12 +609,12 @@ namespace CommandConfiguration {
}
export
function
isEmpty
(
value
:
Tasks
.
CommandConfiguration
):
boolean
{
return
!
value
||
value
.
name
===
void
0
&&
value
.
type
===
void
0
&&
value
.
args
===
void
0
&&
CommandOptions
.
isEmpty
(
value
.
options
)
&&
value
.
terminal
===
void
0
;
return
!
value
||
value
.
name
===
void
0
&&
value
.
type
===
void
0
&&
value
.
args
===
void
0
&&
CommandOptions
.
isEmpty
(
value
.
options
)
&&
value
.
terminal
Behavior
===
void
0
;
}
export
function
onlyTerminalBehaviour
(
value
:
Tasks
.
CommandConfiguration
):
boolean
{
return
value
&&
value
.
terminal
&&
(
value
.
terminal
.
echo
!==
void
0
||
value
.
terminal
.
reveal
!==
void
0
)
&&
value
.
terminal
Behavior
&&
(
value
.
terminalBehavior
.
echo
!==
void
0
||
value
.
terminalBehavior
.
reveal
!==
void
0
)
&&
value
.
name
===
void
0
&&
value
.
type
===
void
0
&&
value
.
args
===
void
0
&&
CommandOptions
.
isEmpty
(
value
.
options
);
}
...
...
@@ -632,7 +632,7 @@ namespace CommandConfiguration {
target
.
type
=
source
.
type
;
}
target
.
terminal
=
TerminalBehavior
.
merge
(
target
.
terminal
,
source
.
terminal
);
target
.
terminal
Behavior
=
TerminalBehavior
.
merge
(
target
.
terminalBehavior
,
source
.
terminalBehavior
);
mergeProperty
(
target
,
source
,
'
taskSelector
'
);
if
(
source
.
args
!==
void
0
)
{
if
(
target
.
args
===
void
0
)
{
...
...
@@ -652,7 +652,7 @@ namespace CommandConfiguration {
if
(
value
.
name
!==
void
0
&&
value
.
type
===
void
0
)
{
value
.
type
=
Tasks
.
CommandType
.
Process
;
}
value
.
terminal
=
TerminalBehavior
.
fillDefault
(
value
.
terminal
);
value
.
terminal
Behavior
=
TerminalBehavior
.
fillDefault
(
value
.
terminalBehavior
);
if
(
value
.
args
===
void
0
)
{
value
.
args
=
EMPTY_ARRAY
;
}
...
...
@@ -669,8 +669,8 @@ namespace CommandConfiguration {
if
(
value
.
options
)
{
CommandOptions
.
freeze
(
value
.
options
);
}
if
(
value
.
terminal
)
{
TerminalBehavior
.
freeze
(
value
.
terminal
);
if
(
value
.
terminal
Behavior
)
{
TerminalBehavior
.
freeze
(
value
.
terminal
Behavior
);
}
}
}
...
...
@@ -793,7 +793,7 @@ namespace TaskDescription {
let
command
:
Tasks
.
CommandConfiguration
=
externalTask
.
command
!==
void
0
?
CommandConfiguration
.
from
(
externalTask
,
context
)
:
externalTask
.
echoCommand
!==
void
0
?
{
name
:
undefined
,
type
:
undefined
,
terminal
:
CommandConfiguration
.
TerminalBehavior
.
from
(
externalTask
,
context
)
}
?
{
name
:
undefined
,
type
:
undefined
,
terminal
Behavior
:
CommandConfiguration
.
TerminalBehavior
.
from
(
externalTask
,
context
)
}
:
undefined
;
let
identifer
=
Types
.
isString
(
externalTask
.
identifier
)
?
externalTask
.
identifier
:
taskName
;
let
task
:
Tasks
.
Task
=
{
...
...
@@ -940,9 +940,9 @@ namespace TaskDescription {
// The globals can have a echo set which would override the local echo
// Saves the need of a additional fill method. But might be necessary
// at some point.
let
oldTerminal
=
Objects
.
clone
(
task
.
command
.
terminal
);
let
oldTerminal
=
Objects
.
clone
(
task
.
command
.
terminal
Behavior
);
CommandConfiguration
.
merge
(
task
.
command
,
globals
.
command
);
task
.
command
.
terminal
=
oldTerminal
;
task
.
command
.
terminal
Behavior
=
oldTerminal
;
}
}
// promptOnClose is inferred from isBackground if available
...
...
src/vs/workbench/parts/tasks/common/tasks.ts
浏览文件 @
83001adc
...
...
@@ -141,7 +141,7 @@ export interface CommandConfiguration {
/**
* Describes how the terminal is supposed to behave.
*/
terminal
:
TerminalBehavior
;
terminal
Behavior
:
TerminalBehavior
;
}
export
namespace
TaskGroup
{
...
...
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
83001adc
...
...
@@ -134,7 +134,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
public
run
(
task
:
Task
,
resolver
:
ITaskResolver
,
trigger
:
string
=
Triggers
.
command
):
ITaskExecuteResult
{
let
terminalData
=
this
.
activeTasks
[
task
.
_id
];
if
(
terminalData
&&
terminalData
.
promise
)
{
let
reveal
=
task
.
command
.
terminal
.
reveal
;
let
reveal
=
task
.
command
.
terminal
Behavior
.
reveal
;
if
(
reveal
===
RevealKind
.
Always
)
{
terminalData
.
terminal
.
setVisible
(
true
);
}
...
...
@@ -289,7 +289,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
this
.
emit
(
TaskSystemEvents
.
Inactive
,
event
);
}
eventCounter
=
0
;
let
reveal
=
task
.
command
.
terminal
.
reveal
;
let
reveal
=
task
.
command
.
terminal
Behavior
.
reveal
;
if
(
exitCode
&&
exitCode
===
1
&&
watchingProblemMatcher
.
numberOfMatches
===
0
&&
reveal
!==
RevealKind
.
Never
)
{
this
.
terminalService
.
setActiveInstance
(
terminal
);
this
.
terminalService
.
showPanel
(
false
);
...
...
@@ -332,7 +332,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
});
}
this
.
terminalService
.
setActiveInstance
(
terminal
);
if
(
task
.
command
.
terminal
.
reveal
===
RevealKind
.
Always
)
{
if
(
task
.
command
.
terminal
Behavior
.
reveal
===
RevealKind
.
Always
)
{
this
.
terminalService
.
showPanel
(
false
);
}
this
.
activeTasks
[
task
.
_id
]
=
{
terminal
,
task
,
promise
};
...
...
@@ -369,7 +369,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let
{
command
,
args
}
=
this
.
resolveCommandAndArgs
(
task
);
let
terminalName
=
nls
.
localize
(
'
TerminalTaskSystem.terminalName
'
,
'
Task - {0}
'
,
task
.
name
);
let
waitOnExit
:
boolean
|
string
=
false
;
if
(
task
.
command
.
terminal
.
reveal
!==
RevealKind
.
Never
||
!
task
.
isBackground
)
{
if
(
task
.
command
.
terminal
Behavior
.
reveal
!==
RevealKind
.
Never
||
!
task
.
isBackground
)
{
waitOnExit
=
nls
.
localize
(
'
reuseTerminal
'
,
'
Terminal will be reused by tasks, press any key to close it.
'
);
};
let
shellLaunchConfig
:
IShellLaunchConfig
=
undefined
;
...
...
@@ -422,7 +422,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
});
shellArgs
.
push
(
commandLine
);
shellLaunchConfig
.
args
=
Platform
.
isWindows
?
shellArgs
.
join
(
'
'
)
:
shellArgs
;
if
(
task
.
command
.
terminal
.
echo
)
{
if
(
task
.
command
.
terminal
Behavior
.
echo
)
{
shellLaunchConfig
.
initialText
=
`>
${
commandLine
}
`
;
}
}
else
{
...
...
@@ -436,7 +436,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
args
,
waitOnExit
};
if
(
task
.
command
.
terminal
.
echo
)
{
if
(
task
.
command
.
terminal
Behavior
.
echo
)
{
let
getArgsToEcho
=
(
args
:
string
|
string
[]):
string
=>
{
if
(
!
args
||
args
.
length
===
0
)
{
return
''
;
...
...
src/vs/workbench/parts/tasks/node/processTaskSystem.ts
浏览文件 @
83001adc
...
...
@@ -179,12 +179,12 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem {
this
.
childProcess
=
new
LineProcess
(
command
,
args
,
commandConfig
.
type
===
CommandType
.
Shell
,
this
.
resolveOptions
(
commandConfig
.
options
));
telemetryEvent
.
command
=
this
.
childProcess
.
getSanitizedCommand
();
// we have no problem matchers defined. So show the output log
let
reveal
=
task
.
command
.
terminal
.
reveal
;
let
reveal
=
task
.
command
.
terminal
Behavior
.
reveal
;
if
(
reveal
===
RevealKind
.
Always
||
(
reveal
===
RevealKind
.
Silent
&&
task
.
problemMatchers
.
length
===
0
))
{
this
.
showOutput
();
}
if
(
commandConfig
.
terminal
.
echo
)
{
if
(
commandConfig
.
terminal
Behavior
.
echo
)
{
let
prompt
:
string
=
Platform
.
isWindows
?
'
>
'
:
'
$
'
;
this
.
log
(
`running command
${
prompt
}
${
command
}
${
args
.
join
(
'
'
)}
`
);
}
...
...
src/vs/workbench/parts/tasks/test/node/configuration.test.ts
浏览文件 @
83001adc
...
...
@@ -101,7 +101,7 @@ class CommandConfigurationBuilder {
options
:
{
cwd
:
'
${workspaceRoot}
'
},
terminal
:
this
.
terminalBuilder
.
result
terminal
Behavior
:
this
.
terminalBuilder
.
result
};
}
...
...
@@ -432,7 +432,7 @@ function assertTask(actual: Tasks.Task, expected: Tasks.Task) {
function
assertCommandConfiguration
(
actual
:
Tasks
.
CommandConfiguration
,
expected
:
Tasks
.
CommandConfiguration
)
{
assert
.
strictEqual
(
typeof
actual
,
typeof
expected
);
if
(
actual
&&
expected
)
{
assertTerminalBehavior
(
actual
.
terminal
,
expected
.
terminal
);
assertTerminalBehavior
(
actual
.
terminal
Behavior
,
expected
.
terminalBehavior
);
assert
.
strictEqual
(
actual
.
name
,
expected
.
name
,
'
name
'
);
assert
.
strictEqual
(
actual
.
type
,
expected
.
type
,
'
task type
'
);
assert
.
deepEqual
(
actual
.
args
,
expected
.
args
,
'
args
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录