Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
50d49c8c
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,发现更多精彩内容 >>
提交
50d49c8c
编写于
1月 18, 2019
作者:
G
Gabriel DeBacker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move to proposed API and rename things for consistency
上级
1faf0981
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
98 addition
and
50 deletion
+98
-50
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+3
-19
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+39
-0
src/vs/workbench/api/electron-browser/mainThreadTask.ts
src/vs/workbench/api/electron-browser/mainThreadTask.ts
+7
-7
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+1
-1
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+19
-14
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+21
-5
src/vs/workbench/api/shared/tasks.ts
src/vs/workbench/api/shared/tasks.ts
+2
-2
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
...kbench/parts/tasks/electron-browser/terminalTaskSystem.ts
+6
-2
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
50d49c8c
...
@@ -5074,21 +5074,6 @@ declare module 'vscode' {
...
@@ -5074,21 +5074,6 @@ declare module 'vscode' {
options
?:
ShellExecutionOptions
;
options
?:
ShellExecutionOptions
;
}
}
/**
* Class used to execute an extension callback as a task.
*/
export
class
ExtensionCallbackExecution
{
/**
* @param callback The callback that will be called when the extension callback task is executed.
*/
constructor
(
callback
:
(
terminalRenderer
:
TerminalRenderer
,
cancellationToken
:
CancellationToken
,
thisArg
?:
any
)
=>
Thenable
<
void
>
);
/**
* The callback used to execute the task.
*/
callback
:
(
terminalRenderer
:
TerminalRenderer
,
cancellationToken
:
CancellationToken
,
thisArg
?:
any
)
=>
Thenable
<
void
>
;
}
/**
/**
* The scope of a task.
* The scope of a task.
*/
*/
...
@@ -5118,7 +5103,6 @@ declare module 'vscode' {
...
@@ -5118,7 +5103,6 @@ declare module 'vscode' {
* A task to execute
* A task to execute
*/
*/
export
class
Task
{
export
class
Task
{
/**
/**
* Creates a new task.
* Creates a new task.
*
*
...
@@ -5131,7 +5115,7 @@ declare module 'vscode' {
...
@@ -5131,7 +5115,7 @@ declare module 'vscode' {
* or '$eslint'. Problem matchers can be contributed by an extension using
* or '$eslint'. Problem matchers can be contributed by an extension using
* the `problemMatchers` extension point.
* the `problemMatchers` extension point.
*/
*/
constructor
(
taskDefinition
:
TaskDefinition
,
scope
:
WorkspaceFolder
|
TaskScope
.
Global
|
TaskScope
.
Workspace
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
,
problemMatchers
?:
string
|
string
[]);
constructor
(
taskDefinition
:
TaskDefinition
,
scope
:
WorkspaceFolder
|
TaskScope
.
Global
|
TaskScope
.
Workspace
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
,
problemMatchers
?:
string
|
string
[]);
/**
/**
* ~~Creates a new task.~~
* ~~Creates a new task.~~
...
@@ -5146,7 +5130,7 @@ declare module 'vscode' {
...
@@ -5146,7 +5130,7 @@ declare module 'vscode' {
* or '$eslint'. Problem matchers can be contributed by an extension using
* or '$eslint'. Problem matchers can be contributed by an extension using
* the `problemMatchers` extension point.
* the `problemMatchers` extension point.
*/
*/
constructor
(
taskDefinition
:
TaskDefinition
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
,
problemMatchers
?:
string
|
string
[]);
constructor
(
taskDefinition
:
TaskDefinition
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
,
problemMatchers
?:
string
|
string
[]);
/**
/**
* The task's definition.
* The task's definition.
...
@@ -5166,7 +5150,7 @@ declare module 'vscode' {
...
@@ -5166,7 +5150,7 @@ declare module 'vscode' {
/**
/**
* The task's execution engine
* The task's execution engine
*/
*/
execution
?:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
;
execution
?:
ProcessExecution
|
ShellExecution
;
/**
/**
* Whether the task is a background task or not.
* Whether the task is a background task or not.
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
50d49c8c
...
@@ -1098,4 +1098,43 @@ declare module 'vscode' {
...
@@ -1098,4 +1098,43 @@ declare module 'vscode' {
readonly
activeSignatureHelp
?:
SignatureHelp
;
readonly
activeSignatureHelp
?:
SignatureHelp
;
}
}
//#endregion
//#endregion
/**
* Class used to execute an extension callback as a task.
*/
export
class
ExtensionCallbackExecution
{
/**
* @param callback The callback that will be called when the extension callback task is executed.
*/
constructor
(
callback
:
(
terminalRenderer
:
TerminalRenderer
,
cancellationToken
:
CancellationToken
,
thisArg
?:
any
)
=>
Thenable
<
void
>
);
/**
* The callback used to execute the task.
*/
callback
:
(
terminalRenderer
:
TerminalRenderer
,
cancellationToken
:
CancellationToken
,
thisArg
?:
any
)
=>
Thenable
<
void
>
;
}
/**
* A task to execute
*/
export
class
TaskWithExtensionCallback
extends
Task
{
/**
* Creates a new task.
*
* @param definition The task definition as defined in the taskDefinitions extension point.
* @param scope Specifies the task's scope. It is either a global or a workspace task or a task for a specific workspace folder.
* @param name The task's name. Is presented in the user interface.
* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.
* @param execution The process or shell execution.
* @param problemMatchers the names of problem matchers to use, like '$tsc'
* or '$eslint'. Problem matchers can be contributed by an extension using
* the `problemMatchers` extension point.
*/
constructor
(
taskDefinition
:
TaskDefinition
,
scope
:
WorkspaceFolder
|
TaskScope
.
Global
|
TaskScope
.
Workspace
,
name
:
string
,
source
:
string
,
execution
?:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
,
problemMatchers
?:
string
|
string
[]);
/**
* The task's execution engine
*/
executionWithExtensionCallback
?:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
;
}
}
}
src/vs/workbench/api/electron-browser/mainThreadTask.ts
浏览文件 @
50d49c8c
...
@@ -32,7 +32,7 @@ import {
...
@@ -32,7 +32,7 @@ import {
TaskDefinitionDTO
,
TaskExecutionDTO
,
ProcessExecutionOptionsDTO
,
TaskPresentationOptionsDTO
,
TaskDefinitionDTO
,
TaskExecutionDTO
,
ProcessExecutionOptionsDTO
,
TaskPresentationOptionsDTO
,
ProcessExecutionDTO
,
ShellExecutionDTO
,
ShellExecutionOptionsDTO
,
TaskDTO
,
TaskSourceDTO
,
TaskHandleDTO
,
TaskFilterDTO
,
TaskProcessStartedDTO
,
TaskProcessEndedDTO
,
TaskSystemInfoDTO
,
ProcessExecutionDTO
,
ShellExecutionDTO
,
ShellExecutionOptionsDTO
,
TaskDTO
,
TaskSourceDTO
,
TaskHandleDTO
,
TaskFilterDTO
,
TaskProcessStartedDTO
,
TaskProcessEndedDTO
,
TaskSystemInfoDTO
,
RunOptionsDTO
,
RunOptionsDTO
,
CallbackExecutionDTO
Extension
CallbackExecutionDTO
}
from
'
vs/workbench/api/shared/tasks
'
;
}
from
'
vs/workbench/api/shared/tasks
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
...
@@ -139,7 +139,7 @@ namespace ProcessExecutionOptionsDTO {
...
@@ -139,7 +139,7 @@ namespace ProcessExecutionOptionsDTO {
}
}
namespace
ProcessExecutionDTO
{
namespace
ProcessExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
):
value
is
ProcessExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
Extension
CallbackExecutionDTO
):
value
is
ProcessExecutionDTO
{
let
candidate
=
value
as
ProcessExecutionDTO
;
let
candidate
=
value
as
ProcessExecutionDTO
;
return
candidate
&&
!!
candidate
.
process
;
return
candidate
&&
!!
candidate
.
process
;
}
}
...
@@ -207,7 +207,7 @@ namespace ShellExecutionOptionsDTO {
...
@@ -207,7 +207,7 @@ namespace ShellExecutionOptionsDTO {
}
}
namespace
ShellExecutionDTO
{
namespace
ShellExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
):
value
is
ShellExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
Extension
CallbackExecutionDTO
):
value
is
ShellExecutionDTO
{
let
candidate
=
value
as
ShellExecutionDTO
;
let
candidate
=
value
as
ShellExecutionDTO
;
return
candidate
&&
(
!!
candidate
.
commandLine
||
!!
candidate
.
command
);
return
candidate
&&
(
!!
candidate
.
commandLine
||
!!
candidate
.
command
);
}
}
...
@@ -239,18 +239,18 @@ namespace ShellExecutionDTO {
...
@@ -239,18 +239,18 @@ namespace ShellExecutionDTO {
}
}
namespace
CallbackExecutionDTO
{
namespace
CallbackExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
):
value
is
CallbackExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
ExtensionCallbackExecutionDTO
):
value
is
Extension
CallbackExecutionDTO
{
let
candidate
=
value
as
CallbackExecutionDTO
;
let
candidate
=
value
as
Extension
CallbackExecutionDTO
;
return
candidate
&&
candidate
.
extensionCallback
===
'
extensionCallback
'
;
return
candidate
&&
candidate
.
extensionCallback
===
'
extensionCallback
'
;
}
}
export
function
from
(
value
:
CommandConfiguration
):
CallbackExecutionDTO
{
export
function
from
(
value
:
CommandConfiguration
):
Extension
CallbackExecutionDTO
{
return
{
return
{
extensionCallback
:
'
extensionCallback
'
extensionCallback
:
'
extensionCallback
'
};
};
}
}
export
function
to
(
value
:
CallbackExecutionDTO
):
CommandConfiguration
{
export
function
to
(
value
:
Extension
CallbackExecutionDTO
):
CommandConfiguration
{
return
{
return
{
runtime
:
RuntimeType
.
ExtensionCallback
,
runtime
:
RuntimeType
.
ExtensionCallback
,
presentation
:
undefined
presentation
:
undefined
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
50d49c8c
...
@@ -800,7 +800,7 @@ export function createApiFactory(
...
@@ -800,7 +800,7 @@ export function createApiFactory(
SymbolInformation
:
extHostTypes
.
SymbolInformation
,
SymbolInformation
:
extHostTypes
.
SymbolInformation
,
SymbolKind
:
extHostTypes
.
SymbolKind
,
SymbolKind
:
extHostTypes
.
SymbolKind
,
Task
:
extHostTypes
.
Task
,
Task
:
extHostTypes
.
Task
,
Task
2
:
extHostTypes
.
Task
,
Task
WithExtensionCallback
:
extHostTypes
.
Task
,
TaskGroup
:
extHostTypes
.
TaskGroup
,
TaskGroup
:
extHostTypes
.
TaskGroup
,
TaskPanelKind
:
extHostTypes
.
TaskPanelKind
,
TaskPanelKind
:
extHostTypes
.
TaskPanelKind
,
TaskRevealKind
:
extHostTypes
.
TaskRevealKind
,
TaskRevealKind
:
extHostTypes
.
TaskRevealKind
,
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
50d49c8c
...
@@ -22,7 +22,7 @@ import {
...
@@ -22,7 +22,7 @@ import {
TaskDefinitionDTO
,
TaskExecutionDTO
,
TaskPresentationOptionsDTO
,
TaskDefinitionDTO
,
TaskExecutionDTO
,
TaskPresentationOptionsDTO
,
ProcessExecutionOptionsDTO
,
ProcessExecutionDTO
,
ProcessExecutionOptionsDTO
,
ProcessExecutionDTO
,
ShellExecutionOptionsDTO
,
ShellExecutionDTO
,
ShellExecutionOptionsDTO
,
ShellExecutionDTO
,
CallbackExecutionDTO
,
Extension
CallbackExecutionDTO
,
TaskDTO
,
TaskHandleDTO
,
TaskFilterDTO
,
TaskProcessStartedDTO
,
TaskProcessEndedDTO
,
TaskSystemInfoDTO
,
TaskSetDTO
TaskDTO
,
TaskHandleDTO
,
TaskFilterDTO
,
TaskProcessStartedDTO
,
TaskProcessEndedDTO
,
TaskSystemInfoDTO
,
TaskSetDTO
}
from
'
../shared/tasks
'
;
}
from
'
../shared/tasks
'
;
import
{
ExtHostVariableResolverService
}
from
'
vs/workbench/api/node/extHostDebugService
'
;
import
{
ExtHostVariableResolverService
}
from
'
vs/workbench/api/node/extHostDebugService
'
;
...
@@ -79,7 +79,7 @@ namespace ProcessExecutionOptionsDTO {
...
@@ -79,7 +79,7 @@ namespace ProcessExecutionOptionsDTO {
}
}
namespace
ProcessExecutionDTO
{
namespace
ProcessExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
):
value
is
ProcessExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
Extension
CallbackExecutionDTO
):
value
is
ProcessExecutionDTO
{
let
candidate
=
value
as
ProcessExecutionDTO
;
let
candidate
=
value
as
ProcessExecutionDTO
;
return
candidate
&&
!!
candidate
.
process
;
return
candidate
&&
!!
candidate
.
process
;
}
}
...
@@ -120,7 +120,7 @@ namespace ShellExecutionOptionsDTO {
...
@@ -120,7 +120,7 @@ namespace ShellExecutionOptionsDTO {
}
}
namespace
ShellExecutionDTO
{
namespace
ShellExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
):
value
is
ShellExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
Extension
CallbackExecutionDTO
):
value
is
ShellExecutionDTO
{
let
candidate
=
value
as
ShellExecutionDTO
;
let
candidate
=
value
as
ShellExecutionDTO
;
return
candidate
&&
(
!!
candidate
.
commandLine
||
!!
candidate
.
command
);
return
candidate
&&
(
!!
candidate
.
commandLine
||
!!
candidate
.
command
);
}
}
...
@@ -153,13 +153,13 @@ namespace ShellExecutionDTO {
...
@@ -153,13 +153,13 @@ namespace ShellExecutionDTO {
}
}
}
}
namespace
CallbackExecutionDTO
{
namespace
Extension
CallbackExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
):
value
is
CallbackExecutionDTO
{
export
function
is
(
value
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
ExtensionCallbackExecutionDTO
):
value
is
Extension
CallbackExecutionDTO
{
let
candidate
=
value
as
CallbackExecutionDTO
;
let
candidate
=
value
as
Extension
CallbackExecutionDTO
;
return
candidate
&&
candidate
.
extensionCallback
===
'
extensionCallback
'
;
return
candidate
&&
candidate
.
extensionCallback
===
'
extensionCallback
'
;
}
}
export
function
from
(
value
:
vscode
.
ExtensionCallbackExecution
):
CallbackExecutionDTO
{
export
function
from
(
value
:
vscode
.
ExtensionCallbackExecution
):
Extension
CallbackExecutionDTO
{
return
{
return
{
extensionCallback
:
'
extensionCallback
'
extensionCallback
:
'
extensionCallback
'
};
};
...
@@ -199,13 +199,13 @@ namespace TaskDTO {
...
@@ -199,13 +199,13 @@ namespace TaskDTO {
if
(
value
===
undefined
||
value
===
null
)
{
if
(
value
===
undefined
||
value
===
null
)
{
return
undefined
;
return
undefined
;
}
}
let
execution
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
CallbackExecutionDTO
;
let
execution
:
ShellExecutionDTO
|
ProcessExecutionDTO
|
Extension
CallbackExecutionDTO
;
if
(
value
.
execution
instanceof
types
.
ProcessExecution
)
{
if
(
value
.
execution
instanceof
types
.
ProcessExecution
)
{
execution
=
ProcessExecutionDTO
.
from
(
value
.
execution
);
execution
=
ProcessExecutionDTO
.
from
(
value
.
execution
);
}
else
if
(
value
.
execution
instanceof
types
.
ShellExecution
)
{
}
else
if
(
value
.
execution
instanceof
types
.
ShellExecution
)
{
execution
=
ShellExecutionDTO
.
from
(
value
.
execution
);
execution
=
ShellExecutionDTO
.
from
(
value
.
execution
);
}
else
if
(
value
.
execution
instanceof
types
.
ExtensionCallbackExecution
)
{
}
else
if
(
(
<
vscode
.
TaskWithExtensionCallback
>
value
).
executionWithExtensionCallback
&&
(
<
vscode
.
TaskWithExtensionCallback
>
value
).
executionWithExtensionCallback
instanceof
types
.
ExtensionCallbackExecution
)
{
execution
=
CallbackExecutionDTO
.
from
(
value
.
execution
);
execution
=
ExtensionCallbackExecutionDTO
.
from
(
<
types
.
ExtensionCallbackExecution
>
(
<
vscode
.
TaskWithExtensionCallback
>
value
).
executionWithExtensionCallback
);
}
}
let
definition
:
TaskDefinitionDTO
=
TaskDefinitionDTO
.
from
(
value
.
definition
);
let
definition
:
TaskDefinitionDTO
=
TaskDefinitionDTO
.
from
(
value
.
definition
);
...
@@ -387,8 +387,13 @@ class ExtensionCallbackExecutionData implements IDisposable {
...
@@ -387,8 +387,13 @@ class ExtensionCallbackExecutionData implements IDisposable {
// Regardless of how the task completes, we are done with this extension callback task execution.
// Regardless of how the task completes, we are done with this extension callback task execution.
return
this
.
callbackData
.
callback
(
terminalRenderer
,
this
.
_cancellationSource
.
token
).
then
(
return
this
.
callbackData
.
callback
(
terminalRenderer
,
this
.
_cancellationSource
.
token
).
then
(
()
=>
this
.
_onTaskExecutionComplete
.
fire
(
this
),
(
success
)
=>
{
()
=>
this
.
_onTaskExecutionComplete
.
fire
(
this
));
this
.
_onTaskExecutionComplete
.
fire
(
this
);
terminalRenderer
.
terminal
.
dispose
();
},
(
rejected
)
=>
{
this
.
_onTaskExecutionComplete
.
fire
(
this
);
terminalRenderer
.
terminal
.
dispose
();
});
}
}
return
undefined
;
return
undefined
;
...
@@ -617,11 +622,11 @@ export class ExtHostTask implements ExtHostTaskShape {
...
@@ -617,11 +622,11 @@ export class ExtHostTask implements ExtHostTaskShape {
const
taskDTO
:
TaskDTO
=
TaskDTO
.
from
(
task
,
handler
.
extension
);
const
taskDTO
:
TaskDTO
=
TaskDTO
.
from
(
task
,
handler
.
extension
);
taskDTOs
.
push
(
taskDTO
);
taskDTOs
.
push
(
taskDTO
);
if
(
CallbackExecutionDTO
.
is
(
taskDTO
.
execution
))
{
if
(
Extension
CallbackExecutionDTO
.
is
(
taskDTO
.
execution
))
{
taskIdPromises
.
push
(
new
Promise
((
resolve
)
=>
{
taskIdPromises
.
push
(
new
Promise
((
resolve
)
=>
{
// The ID is calculated on the main thread task side, so, let's call into it here.
// The ID is calculated on the main thread task side, so, let's call into it here.
this
.
_proxy
.
$createTaskId
(
taskDTO
).
then
((
taskId
)
=>
{
this
.
_proxy
.
$createTaskId
(
taskDTO
).
then
((
taskId
)
=>
{
this
.
_providedExtensionCallbacks
.
set
(
taskId
,
new
ExtensionCallbackExecutionData
(
<
vscode
.
ExtensionCallbackExecution
>
task
.
execution
,
this
.
_terminalService
));
this
.
_providedExtensionCallbacks
.
set
(
taskId
,
new
ExtensionCallbackExecutionData
(
<
vscode
.
ExtensionCallbackExecution
>
(
<
vscode
.
TaskWithExtensionCallback
>
task
).
executionWithExtensionCallback
,
this
.
_terminalService
));
resolve
();
resolve
();
});
});
}));
}));
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
50d49c8c
...
@@ -1646,7 +1646,7 @@ export class ExtensionCallbackExecution implements vscode.ExtensionCallbackExecu
...
@@ -1646,7 +1646,7 @@ export class ExtensionCallbackExecution implements vscode.ExtensionCallbackExecu
}
}
}
}
export
class
Task
implements
vscode
.
Task
{
export
class
Task
implements
vscode
.
Task
WithExtensionCallback
{
private
static
ExtensionCallbackType
:
string
=
'
extensionCallback
'
;
private
static
ExtensionCallbackType
:
string
=
'
extensionCallback
'
;
private
static
ProcessType
:
string
=
'
process
'
;
private
static
ProcessType
:
string
=
'
process
'
;
...
@@ -1733,7 +1733,7 @@ export class Task implements vscode.Task {
...
@@ -1733,7 +1733,7 @@ export class Task implements vscode.Task {
type
:
Task
.
ShellType
,
type
:
Task
.
ShellType
,
id
:
this
.
_execution
.
computeId
()
id
:
this
.
_execution
.
computeId
()
};
};
}
else
if
(
this
.
_execution
instanceof
Extension
ScriptApis
)
{
}
else
if
(
this
.
_execution
instanceof
Extension
CallbackExecution
)
{
this
.
_definition
=
{
this
.
_definition
=
{
type
:
Task
.
ExtensionCallbackType
,
type
:
Task
.
ExtensionCallbackType
,
id
:
this
.
_execution
.
computeId
()
id
:
this
.
_execution
.
computeId
()
...
@@ -1779,18 +1779,34 @@ export class Task implements vscode.Task {
...
@@ -1779,18 +1779,34 @@ export class Task implements vscode.Task {
this
.
_name
=
value
;
this
.
_name
=
value
;
}
}
get
execution
():
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
|
undefined
{
get
execution
():
ProcessExecution
|
ShellExecution
|
undefined
{
return
(
this
.
_execution
instanceof
ExtensionCallbackExecution
)
?
undefined
:
this
.
_execution
;
}
set
execution
(
value
:
ProcessExecution
|
ShellExecution
|
undefined
)
{
this
.
executionInternal
=
value
;
}
get
executionWithExtensionCallback
():
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
|
undefined
{
return
this
.
executionInternal
;
}
set
executionWithExtensionCallback
(
value
:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
|
undefined
)
{
this
.
executionInternal
=
value
;
}
private
get
executionInternal
():
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
|
undefined
{
return
this
.
_execution
;
return
this
.
_execution
;
}
}
set
execution
(
value
:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
|
undefined
)
{
private
set
executionInternal
(
value
:
ProcessExecution
|
ShellExecution
|
ExtensionCallbackExecution
|
undefined
)
{
if
(
value
===
null
)
{
if
(
value
===
null
)
{
value
=
undefined
;
value
=
undefined
;
}
}
this
.
clear
();
this
.
clear
();
this
.
_execution
=
value
;
this
.
_execution
=
value
;
let
type
=
this
.
_definition
.
type
;
let
type
=
this
.
_definition
.
type
;
if
(
Task
.
EmptyType
===
type
||
Task
.
ProcessType
===
type
||
Task
.
ShellType
===
type
)
{
if
(
Task
.
EmptyType
===
type
||
Task
.
ProcessType
===
type
||
Task
.
ShellType
===
type
||
Task
.
ExtensionCallbackType
===
type
)
{
this
.
computeDefinitionBasedOnExecution
();
this
.
computeDefinitionBasedOnExecution
();
}
}
}
}
...
...
src/vs/workbench/api/shared/tasks.ts
浏览文件 @
50d49c8c
...
@@ -65,7 +65,7 @@ export interface ShellExecutionDTO {
...
@@ -65,7 +65,7 @@ export interface ShellExecutionDTO {
options
?:
ShellExecutionOptionsDTO
;
options
?:
ShellExecutionOptionsDTO
;
}
}
export
interface
CallbackExecutionDTO
{
export
interface
Extension
CallbackExecutionDTO
{
extensionCallback
:
'
extensionCallback
'
;
extensionCallback
:
'
extensionCallback
'
;
}
}
...
@@ -83,7 +83,7 @@ export interface TaskHandleDTO {
...
@@ -83,7 +83,7 @@ export interface TaskHandleDTO {
export
interface
TaskDTO
{
export
interface
TaskDTO
{
_id
:
string
;
_id
:
string
;
name
:
string
;
name
:
string
;
execution
:
ProcessExecutionDTO
|
ShellExecutionDTO
|
CallbackExecutionDTO
;
execution
:
ProcessExecutionDTO
|
ShellExecutionDTO
|
Extension
CallbackExecutionDTO
;
definition
:
TaskDefinitionDTO
;
definition
:
TaskDefinitionDTO
;
isBackground
:
boolean
;
isBackground
:
boolean
;
source
:
TaskSourceDTO
;
source
:
TaskSourceDTO
;
...
...
src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
50d49c8c
...
@@ -514,7 +514,9 @@ export class TerminalTaskSystem implements ITaskSystem {
...
@@ -514,7 +514,9 @@ export class TerminalTaskSystem implements ITaskSystem {
let
processStartedSignaled
=
false
;
let
processStartedSignaled
=
false
;
terminal
.
processReady
.
then
(()
=>
{
terminal
.
processReady
.
then
(()
=>
{
if
(
!
processStartedSignaled
)
{
if
(
!
processStartedSignaled
)
{
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
ProcessStarted
,
task
,
terminal
!
.
processId
!
));
if
(
task
.
command
.
runtime
!==
RuntimeType
.
ExtensionCallback
)
{
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
ProcessStarted
,
task
,
terminal
!
.
processId
!
));
}
processStartedSignaled
=
true
;
processStartedSignaled
=
true
;
}
}
},
(
_error
)
=>
{
},
(
_error
)
=>
{
...
@@ -581,7 +583,9 @@ export class TerminalTaskSystem implements ITaskSystem {
...
@@ -581,7 +583,9 @@ export class TerminalTaskSystem implements ITaskSystem {
let
processStartedSignaled
=
false
;
let
processStartedSignaled
=
false
;
terminal
.
processReady
.
then
(()
=>
{
terminal
.
processReady
.
then
(()
=>
{
if
(
!
processStartedSignaled
)
{
if
(
!
processStartedSignaled
)
{
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
ProcessStarted
,
task
,
terminal
!
.
processId
!
));
if
(
task
.
command
.
runtime
!==
RuntimeType
.
ExtensionCallback
)
{
this
.
_onDidStateChange
.
fire
(
TaskEvent
.
create
(
TaskEventKind
.
ProcessStarted
,
task
,
terminal
!
.
processId
!
));
}
processStartedSignaled
=
true
;
processStartedSignaled
=
true
;
}
}
},
(
_error
)
=>
{
},
(
_error
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录