Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
640caaef
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,发现更多精彩内容 >>
提交
640caaef
编写于
8月 20, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Finalize task custom execution variable resolving
Fixes #81007
上级
362e4922
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
12 addition
and
26 deletion
+12
-26
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+3
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+0
-14
src/vs/workbench/api/browser/mainThreadTask.ts
src/vs/workbench/api/browser/mainThreadTask.ts
+2
-2
src/vs/workbench/api/common/extHost.api.impl.ts
src/vs/workbench/api/common/extHost.api.impl.ts
+0
-1
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/common/extHostTask.ts
src/vs/workbench/api/common/extHostTask.ts
+1
-1
src/vs/workbench/api/common/extHostTypes.ts
src/vs/workbench/api/common/extHostTypes.ts
+5
-5
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
640caaef
...
@@ -6123,9 +6123,10 @@ declare module 'vscode' {
...
@@ -6123,9 +6123,10 @@ declare module 'vscode' {
* [Pseudoterminal.close](#Pseudoterminal.close). When the task is complete fire
* [Pseudoterminal.close](#Pseudoterminal.close). When the task is complete fire
* [Pseudoterminal.onDidClose](#Pseudoterminal.onDidClose).
* [Pseudoterminal.onDidClose](#Pseudoterminal.onDidClose).
* @param process The [Pseudoterminal](#Pseudoterminal) to be used by the task to display output.
* @param process The [Pseudoterminal](#Pseudoterminal) to be used by the task to display output.
* @param callback The callback that will be called when the task is started by a user.
* @param callback The callback that will be called when the task is started by a user. Any ${} style variables that
* were in the task definition will be resolved and passed into the callback.
*/
*/
constructor
(
callback
:
()
=>
Thenable
<
Pseudoterminal
>
);
constructor
(
callback
:
(
resolvedDefinition
:
TaskDefinition
)
=>
Thenable
<
Pseudoterminal
>
);
}
}
/**
/**
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
640caaef
...
@@ -981,7 +981,6 @@ declare module 'vscode' {
...
@@ -981,7 +981,6 @@ declare module 'vscode' {
}
}
//#endregion
//#endregion
//#region CustomExecution: https://github.com/microsoft/vscode/issues/81007
/**
/**
* A task to execute
* A task to execute
*/
*/
...
@@ -989,19 +988,6 @@ declare module 'vscode' {
...
@@ -989,19 +988,6 @@ declare module 'vscode' {
detail
?:
string
;
detail
?:
string
;
}
}
export
class
CustomExecution2
extends
CustomExecution
{
/**
* Constructs a CustomExecution task object. The callback will be executed the task is run, at which point the
* extension should return the Pseudoterminal it will "run in". The task should wait to do further execution until
* [Pseudoterminal.open](#Pseudoterminal.open) is called. Task cancellation should be handled using
* [Pseudoterminal.close](#Pseudoterminal.close). When the task is complete fire
* [Pseudoterminal.onDidClose](#Pseudoterminal.onDidClose).
* @param callback The callback that will be called when the task is started by a user.
*/
constructor
(
callback
:
(
resolvedDefinition
:
TaskDefinition
)
=>
Thenable
<
Pseudoterminal
>
);
}
//#endregion
//#region Task presentation group: https://github.com/microsoft/vscode/issues/47265
//#region Task presentation group: https://github.com/microsoft/vscode/issues/47265
export
interface
TaskPresentationOptions
{
export
interface
TaskPresentationOptions
{
/**
/**
...
...
src/vs/workbench/api/browser/mainThreadTask.ts
浏览文件 @
640caaef
...
@@ -418,8 +418,8 @@ export class MainThreadTask implements MainThreadTaskShape {
...
@@ -418,8 +418,8 @@ export class MainThreadTask implements MainThreadTaskShape {
const
task
=
event
.
__task
!
;
const
task
=
event
.
__task
!
;
if
(
event
.
kind
===
TaskEventKind
.
Start
)
{
if
(
event
.
kind
===
TaskEventKind
.
Start
)
{
const
execution
=
TaskExecutionDTO
.
from
(
task
.
getTaskExecution
());
const
execution
=
TaskExecutionDTO
.
from
(
task
.
getTaskExecution
());
let
resolvedDefinition
:
TaskDefinitionDTO
|
undefined
;
let
resolvedDefinition
:
TaskDefinitionDTO
=
execution
.
task
!
.
definition
;
if
(
execution
.
task
&&
execution
.
task
.
execution
&&
CustomExecutionDTO
.
is
(
execution
.
task
.
execution
)
&&
event
.
resolvedVariables
)
{
if
(
execution
.
task
?
.
execution
&&
CustomExecutionDTO
.
is
(
execution
.
task
.
execution
)
&&
event
.
resolvedVariables
)
{
const
dictionary
:
IStringDictionary
<
string
>
=
{};
const
dictionary
:
IStringDictionary
<
string
>
=
{};
Array
.
from
(
event
.
resolvedVariables
.
entries
()).
forEach
(
entry
=>
dictionary
[
entry
[
0
]]
=
entry
[
1
]);
Array
.
from
(
event
.
resolvedVariables
.
entries
()).
forEach
(
entry
=>
dictionary
[
entry
[
0
]]
=
entry
[
1
]);
resolvedDefinition
=
await
this
.
_configurationResolverService
.
resolveAny
(
task
.
getWorkspaceFolder
(),
resolvedDefinition
=
await
this
.
_configurationResolverService
.
resolveAny
(
task
.
getWorkspaceFolder
(),
...
...
src/vs/workbench/api/common/extHost.api.impl.ts
浏览文件 @
640caaef
...
@@ -1039,7 +1039,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
...
@@ -1039,7 +1039,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
ExtensionMode
:
extHostTypes
.
ExtensionMode
,
ExtensionMode
:
extHostTypes
.
ExtensionMode
,
ExtensionRuntime
:
extHostTypes
.
ExtensionRuntime
,
ExtensionRuntime
:
extHostTypes
.
ExtensionRuntime
,
CustomExecution
:
extHostTypes
.
CustomExecution
,
CustomExecution
:
extHostTypes
.
CustomExecution
,
CustomExecution2
:
extHostTypes
.
CustomExecution
,
FileChangeType
:
extHostTypes
.
FileChangeType
,
FileChangeType
:
extHostTypes
.
FileChangeType
,
FileSystemError
:
extHostTypes
.
FileSystemError
,
FileSystemError
:
extHostTypes
.
FileSystemError
,
FileType
:
files
.
FileType
,
FileType
:
files
.
FileType
,
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
640caaef
...
@@ -1449,7 +1449,7 @@ export interface ExtHostSCMShape {
...
@@ -1449,7 +1449,7 @@ export interface ExtHostSCMShape {
export
interface
ExtHostTaskShape
{
export
interface
ExtHostTaskShape
{
$provideTasks
(
handle
:
number
,
validTypes
:
{
[
key
:
string
]:
boolean
;
}):
Thenable
<
tasks
.
TaskSetDTO
>
;
$provideTasks
(
handle
:
number
,
validTypes
:
{
[
key
:
string
]:
boolean
;
}):
Thenable
<
tasks
.
TaskSetDTO
>
;
$resolveTask
(
handle
:
number
,
taskDTO
:
tasks
.
TaskDTO
):
Thenable
<
tasks
.
TaskDTO
|
undefined
>
;
$resolveTask
(
handle
:
number
,
taskDTO
:
tasks
.
TaskDTO
):
Thenable
<
tasks
.
TaskDTO
|
undefined
>
;
$onDidStartTask
(
execution
:
tasks
.
TaskExecutionDTO
,
terminalId
:
number
,
resolvedDefinition
?
:
tasks
.
TaskDefinitionDTO
):
void
;
$onDidStartTask
(
execution
:
tasks
.
TaskExecutionDTO
,
terminalId
:
number
,
resolvedDefinition
:
tasks
.
TaskDefinitionDTO
):
void
;
$onDidStartTaskProcess
(
value
:
tasks
.
TaskProcessStartedDTO
):
void
;
$onDidStartTaskProcess
(
value
:
tasks
.
TaskProcessStartedDTO
):
void
;
$onDidEndTaskProcess
(
value
:
tasks
.
TaskProcessEndedDTO
):
void
;
$onDidEndTaskProcess
(
value
:
tasks
.
TaskProcessEndedDTO
):
void
;
$OnDidEndTask
(
execution
:
tasks
.
TaskExecutionDTO
):
void
;
$OnDidEndTask
(
execution
:
tasks
.
TaskExecutionDTO
):
void
;
...
...
src/vs/workbench/api/common/extHostTask.ts
浏览文件 @
640caaef
...
@@ -475,7 +475,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
...
@@ -475,7 +475,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
return
this
.
_onDidExecuteTask
.
event
;
return
this
.
_onDidExecuteTask
.
event
;
}
}
public
async
$onDidStartTask
(
execution
:
tasks
.
TaskExecutionDTO
,
terminalId
:
number
,
resolvedDefinition
?
:
tasks
.
TaskDefinitionDTO
):
Promise
<
void
>
{
public
async
$onDidStartTask
(
execution
:
tasks
.
TaskExecutionDTO
,
terminalId
:
number
,
resolvedDefinition
:
tasks
.
TaskDefinitionDTO
):
Promise
<
void
>
{
const
customExecution
:
types
.
CustomExecution
|
undefined
=
this
.
_providedCustomExecutions2
.
get
(
execution
.
id
);
const
customExecution
:
types
.
CustomExecution
|
undefined
=
this
.
_providedCustomExecutions2
.
get
(
execution
.
id
);
if
(
customExecution
)
{
if
(
customExecution
)
{
if
(
this
.
_activeCustomExecutions2
.
get
(
execution
.
id
)
!==
undefined
)
{
if
(
this
.
_activeCustomExecutions2
.
get
(
execution
.
id
)
!==
undefined
)
{
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
640caaef
...
@@ -1831,20 +1831,20 @@ export enum TaskScope {
...
@@ -1831,20 +1831,20 @@ export enum TaskScope {
Workspace
=
2
Workspace
=
2
}
}
export
class
CustomExecution
implements
vscode
.
CustomExecution
2
{
export
class
CustomExecution
implements
vscode
.
CustomExecution
{
private
_callback
:
(
resolvedDefintion
?
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
;
private
_callback
:
(
resolvedDefintion
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
;
constructor
(
callback
:
(
resolvedDefintion
?
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
)
{
constructor
(
callback
:
(
resolvedDefintion
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
)
{
this
.
_callback
=
callback
;
this
.
_callback
=
callback
;
}
}
public
computeId
():
string
{
public
computeId
():
string
{
return
'
customExecution
'
+
generateUuid
();
return
'
customExecution
'
+
generateUuid
();
}
}
public
set
callback
(
value
:
(
resolvedDefintion
?
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
)
{
public
set
callback
(
value
:
(
resolvedDefintion
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
)
{
this
.
_callback
=
value
;
this
.
_callback
=
value
;
}
}
public
get
callback
():
((
resolvedDefintion
?
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
)
{
public
get
callback
():
((
resolvedDefintion
:
vscode
.
TaskDefinition
)
=>
Thenable
<
vscode
.
Pseudoterminal
>
)
{
return
this
.
_callback
;
return
this
.
_callback
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录