Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c3a5ac08
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,发现更多精彩内容 >>
提交
c3a5ac08
编写于
1月 22, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adopt deprecation service for deprecated task constructor
Part of
https://github.com/microsoft/vscode/issues/88391
上级
df801d7c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
30 addition
and
5 deletion
+30
-5
src/vs/workbench/api/common/extHostTask.ts
src/vs/workbench/api/common/extHostTask.ts
+18
-3
src/vs/workbench/api/common/extHostTypes.ts
src/vs/workbench/api/common/extHostTypes.ts
+6
-0
src/vs/workbench/api/node/extHostTask.ts
src/vs/workbench/api/node/extHostTask.ts
+6
-2
未找到文件。
src/vs/workbench/api/common/extHostTask.ts
浏览文件 @
c3a5ac08
...
...
@@ -25,6 +25,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
*
as
Platform
from
'
vs/base/common/platform
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IExtHostApiDeprecationService
}
from
'
vs/workbench/api/common/extHostApiDeprecationService
'
;
export
interface
IExtHostTask
extends
ExtHostTaskShape
{
...
...
@@ -376,6 +377,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
protected
readonly
_configurationService
:
IExtHostConfiguration
;
protected
readonly
_terminalService
:
IExtHostTerminalService
;
protected
readonly
_logService
:
ILogService
;
protected
readonly
_deprecationService
:
IExtHostApiDeprecationService
;
protected
_handleCounter
:
number
;
protected
_handlers
:
Map
<
number
,
HandlerData
>
;
protected
_taskExecutions
:
Map
<
string
,
TaskExecutionImpl
>
;
...
...
@@ -396,7 +398,8 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
@
IExtHostDocumentsAndEditors
editorService
:
IExtHostDocumentsAndEditors
,
@
IExtHostConfiguration
configurationService
:
IExtHostConfiguration
,
@
IExtHostTerminalService
extHostTerminalService
:
IExtHostTerminalService
,
@
ILogService
logService
:
ILogService
@
ILogService
logService
:
ILogService
,
@
IExtHostApiDeprecationService
deprecationService
:
IExtHostApiDeprecationService
)
{
this
.
_proxy
=
extHostRpc
.
getProxy
(
MainContext
.
MainThreadTask
);
this
.
_workspaceProvider
=
workspaceService
;
...
...
@@ -410,6 +413,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
this
.
_notProvidedCustomExecutions
=
new
Set
<
string
>
();
this
.
_activeCustomExecutions2
=
new
Map
<
string
,
types
.
CustomExecution
>
();
this
.
_logService
=
logService
;
this
.
_deprecationService
=
deprecationService
;
}
public
registerTaskProvider
(
extension
:
IExtensionDescription
,
type
:
string
,
provider
:
vscode
.
TaskProvider
):
vscode
.
Disposable
{
...
...
@@ -576,6 +580,8 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
return
;
}
this
.
checkDeprecation
(
resolvedTask
,
handler
);
const
resolvedTaskDTO
:
tasks
.
TaskDTO
|
undefined
=
TaskDTO
.
from
(
resolvedTask
,
handler
.
extension
);
if
(
!
resolvedTaskDTO
)
{
throw
new
Error
(
'
Unexpected: Task cannot be resolved.
'
);
...
...
@@ -630,6 +636,13 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
return
createdResult
;
}
protected
checkDeprecation
(
task
:
vscode
.
Task
,
handler
:
HandlerData
)
{
const
tTask
=
(
task
as
types
.
Task
);
if
(
tTask
.
_deprecated
)
{
this
.
_deprecationService
.
report
(
'
Task.constructor
'
,
handler
.
extension
,
'
Use the Task constructor that takes a `scope` instead.
'
);
}
}
private
customExecutionComplete
(
execution
:
tasks
.
TaskExecutionDTO
):
void
{
const
extensionCallback2
:
vscode
.
CustomExecution
|
undefined
=
this
.
_activeCustomExecutions2
.
get
(
execution
.
id
);
if
(
extensionCallback2
)
{
...
...
@@ -666,9 +679,10 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
@
IExtHostDocumentsAndEditors
editorService
:
IExtHostDocumentsAndEditors
,
@
IExtHostConfiguration
configurationService
:
IExtHostConfiguration
,
@
IExtHostTerminalService
extHostTerminalService
:
IExtHostTerminalService
,
@
ILogService
logService
:
ILogService
@
ILogService
logService
:
ILogService
,
@
IExtHostApiDeprecationService
deprecationService
:
IExtHostApiDeprecationService
)
{
super
(
extHostRpc
,
initData
,
workspaceService
,
editorService
,
configurationService
,
extHostTerminalService
,
logService
);
super
(
extHostRpc
,
initData
,
workspaceService
,
editorService
,
configurationService
,
extHostTerminalService
,
logService
,
deprecationService
);
if
(
initData
.
remote
.
isRemote
&&
initData
.
remote
.
authority
)
{
this
.
registerTaskSystem
(
Schemas
.
vscodeRemote
,
{
scheme
:
Schemas
.
vscodeRemote
,
...
...
@@ -700,6 +714,7 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
const
taskDTOs
:
tasks
.
TaskDTO
[]
=
[];
if
(
value
)
{
for
(
let
task
of
value
)
{
this
.
checkDeprecation
(
task
,
handler
);
if
(
!
task
.
definition
||
!
validTypes
[
task
.
definition
.
type
])
{
this
.
_logService
.
warn
(
`The task [
${
task
.
source
}
,
${
task
.
name
}
] uses an undefined task type. The task will be ignored in the future.`
);
}
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
c3a5ac08
...
...
@@ -1838,6 +1838,7 @@ export class Task implements vscode.Task2 {
private
static
EmptyType
:
string
=
'
$empty
'
;
private
__id
:
string
|
undefined
;
private
__deprecated
:
boolean
=
false
;
private
_definition
:
vscode
.
TaskDefinition
;
private
_scope
:
vscode
.
TaskScope
.
Global
|
vscode
.
TaskScope
.
Workspace
|
vscode
.
WorkspaceFolder
|
undefined
;
...
...
@@ -1862,6 +1863,7 @@ export class Task implements vscode.Task2 {
this
.
_source
=
this
.
source
=
arg3
;
this
.
execution
=
arg4
;
problemMatchers
=
arg5
;
this
.
__deprecated
=
true
;
}
else
if
(
arg2
===
TaskScope
.
Global
||
arg2
===
TaskScope
.
Workspace
)
{
this
.
target
=
arg2
;
this
.
_name
=
this
.
name
=
arg3
;
...
...
@@ -1898,6 +1900,10 @@ export class Task implements vscode.Task2 {
this
.
__id
=
value
;
}
get
_deprecated
():
boolean
{
return
this
.
__deprecated
;
}
private
clear
():
void
{
if
(
this
.
__id
===
undefined
)
{
return
;
...
...
src/vs/workbench/api/node/extHostTask.ts
浏览文件 @
c3a5ac08
...
...
@@ -24,6 +24,7 @@ import { ExtHostTaskBase, TaskHandleDTO, TaskDTO, CustomExecutionDTO, HandlerDat
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IProcessEnvironment
}
from
'
vs/base/common/platform
'
;
import
{
IExtHostApiDeprecationService
}
from
'
vs/workbench/api/common/extHostApiDeprecationService
'
;
export
class
ExtHostTask
extends
ExtHostTaskBase
{
private
_variableResolver
:
ExtHostVariableResolverService
|
undefined
;
...
...
@@ -35,9 +36,10 @@ export class ExtHostTask extends ExtHostTaskBase {
@
IExtHostDocumentsAndEditors
editorService
:
IExtHostDocumentsAndEditors
,
@
IExtHostConfiguration
configurationService
:
IExtHostConfiguration
,
@
IExtHostTerminalService
extHostTerminalService
:
IExtHostTerminalService
,
@
ILogService
logService
:
ILogService
@
ILogService
logService
:
ILogService
,
@
IExtHostApiDeprecationService
deprecationService
:
IExtHostApiDeprecationService
)
{
super
(
extHostRpc
,
initData
,
workspaceService
,
editorService
,
configurationService
,
extHostTerminalService
,
logService
);
super
(
extHostRpc
,
initData
,
workspaceService
,
editorService
,
configurationService
,
extHostTerminalService
,
logService
,
deprecationService
);
if
(
initData
.
remote
.
isRemote
&&
initData
.
remote
.
authority
)
{
this
.
registerTaskSystem
(
Schemas
.
vscodeRemote
,
{
scheme
:
Schemas
.
vscodeRemote
,
...
...
@@ -73,6 +75,8 @@ export class ExtHostTask extends ExtHostTaskBase {
const
taskDTOs
:
tasks
.
TaskDTO
[]
=
[];
if
(
value
)
{
for
(
let
task
of
value
)
{
this
.
checkDeprecation
(
task
,
handler
);
if
(
!
task
.
definition
||
!
validTypes
[
task
.
definition
.
type
])
{
this
.
_logService
.
warn
(
`The task [
${
task
.
source
}
,
${
task
.
name
}
] uses an undefined task type. The task will be ignored in the future.`
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录