Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9c4ebe22
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,发现更多精彩内容 >>
提交
9c4ebe22
编写于
7月 23, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix escape from command variable in remote tasks
Fixes #102931
上级
a4738140
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
7 deletion
+18
-7
src/vs/workbench/api/browser/mainThreadTask.ts
src/vs/workbench/api/browser/mainThreadTask.ts
+6
-2
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
+11
-4
src/vs/workbench/contrib/tasks/common/taskSystem.ts
src/vs/workbench/contrib/tasks/common/taskSystem.ts
+1
-1
未找到文件。
src/vs/workbench/api/browser/mainThreadTask.ts
浏览文件 @
9c4ebe22
...
...
@@ -634,7 +634,7 @@ export class MainThreadTask implements MainThreadTaskShape {
return
URI
.
parse
(
`
${
info
.
scheme
}
://
${
info
.
authority
}${
path
}
`
);
},
context
:
this
.
_extHostContext
,
resolveVariables
:
(
workspaceFolder
:
IWorkspaceFolder
,
toResolve
:
ResolveSet
,
target
:
ConfigurationTarget
):
Promise
<
ResolvedVariables
>
=>
{
resolveVariables
:
(
workspaceFolder
:
IWorkspaceFolder
,
toResolve
:
ResolveSet
,
target
:
ConfigurationTarget
):
Promise
<
ResolvedVariables
|
undefined
>
=>
{
const
vars
:
string
[]
=
[];
toResolve
.
variables
.
forEach
(
item
=>
vars
.
push
(
item
));
return
Promise
.
resolve
(
this
.
_proxy
.
$resolveVariables
(
workspaceFolder
.
uri
,
{
process
:
toResolve
.
process
,
variables
:
vars
})).
then
(
values
=>
{
...
...
@@ -642,8 +642,12 @@ export class MainThreadTask implements MainThreadTaskShape {
forEach
(
values
.
variables
,
(
entry
)
=>
{
partiallyResolvedVars
.
push
(
entry
.
value
);
});
return
new
Promise
<
ResolvedVariables
>
((
resolve
,
reject
)
=>
{
return
new
Promise
<
ResolvedVariables
|
undefined
>
((
resolve
,
reject
)
=>
{
this
.
_configurationResolverService
.
resolveWithInteraction
(
workspaceFolder
,
partiallyResolvedVars
,
'
tasks
'
,
undefined
,
target
).
then
(
resolvedVars
=>
{
if
(
!
resolvedVars
)
{
resolve
(
undefined
);
}
const
result
:
ResolvedVariables
=
{
process
:
undefined
,
variables
:
new
Map
<
string
,
string
>
()
...
...
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
浏览文件 @
9c4ebe22
...
...
@@ -528,7 +528,7 @@ export class TerminalTaskSystem implements ITaskSystem {
}
}
private
resolveVariablesFromSet
(
taskSystemInfo
:
TaskSystemInfo
|
undefined
,
workspaceFolder
:
IWorkspaceFolder
|
undefined
,
task
:
CustomTask
|
ContributedTask
,
variables
:
Set
<
string
>
,
alreadyResolved
:
Map
<
string
,
string
>
):
Promise
<
ResolvedVariables
>
{
private
resolveVariablesFromSet
(
taskSystemInfo
:
TaskSystemInfo
|
undefined
,
workspaceFolder
:
IWorkspaceFolder
|
undefined
,
task
:
CustomTask
|
ContributedTask
,
variables
:
Set
<
string
>
,
alreadyResolved
:
Map
<
string
,
string
>
):
Promise
<
ResolvedVariables
|
undefined
>
{
let
isProcess
=
task
.
command
&&
task
.
command
.
runtime
===
RuntimeType
.
Process
;
let
options
=
task
.
command
&&
task
.
command
.
options
?
task
.
command
.
options
:
undefined
;
let
cwd
=
options
?
options
.
cwd
:
undefined
;
...
...
@@ -544,7 +544,7 @@ export class TerminalTaskSystem implements ITaskSystem {
}
}
const
unresolved
=
this
.
findUnresolvedVariables
(
variables
,
alreadyResolved
);
let
resolvedVariables
:
Promise
<
ResolvedVariables
>
;
let
resolvedVariables
:
Promise
<
ResolvedVariables
|
undefined
>
;
if
(
taskSystemInfo
&&
workspaceFolder
)
{
let
resolveSet
:
ResolveSet
=
{
variables
:
unresolved
...
...
@@ -560,6 +560,10 @@ export class TerminalTaskSystem implements ITaskSystem {
}
}
resolvedVariables
=
taskSystemInfo
.
resolveVariables
(
workspaceFolder
,
resolveSet
,
TaskSourceKind
.
toConfigurationTarget
(
task
.
_source
.
kind
)).
then
(
async
(
resolved
)
=>
{
if
(
!
resolved
)
{
return
undefined
;
}
this
.
mergeMaps
(
alreadyResolved
,
resolved
.
variables
);
resolved
.
variables
=
new
Map
(
alreadyResolved
);
if
(
isProcess
)
{
...
...
@@ -569,14 +573,14 @@ export class TerminalTaskSystem implements ITaskSystem {
}
resolved
.
variables
.
set
(
TerminalTaskSystem
.
ProcessVarName
,
process
);
}
return
Promise
.
resolve
(
resolved
)
;
return
resolved
;
});
return
resolvedVariables
;
}
else
{
let
variablesArray
=
new
Array
<
string
>
();
unresolved
.
forEach
(
variable
=>
variablesArray
.
push
(
variable
));
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
<
ResolvedVariables
|
undefined
>
((
resolve
,
reject
)
=>
{
this
.
configurationResolverService
.
resolveWithInteraction
(
workspaceFolder
,
variablesArray
,
'
tasks
'
,
undefined
,
TaskSourceKind
.
toConfigurationTarget
(
task
.
_source
.
kind
)).
then
(
async
(
resolvedVariablesMap
:
Map
<
string
,
string
>
|
undefined
)
=>
{
if
(
resolvedVariablesMap
)
{
this
.
mergeMaps
(
alreadyResolved
,
resolvedVariablesMap
);
...
...
@@ -657,6 +661,9 @@ export class TerminalTaskSystem implements ITaskSystem {
if
(
!
hasAllVariables
)
{
return
this
.
resolveVariablesFromSet
(
lastTask
.
getVerifiedTask
().
systemInfo
,
lastTask
.
getVerifiedTask
().
workspaceFolder
,
task
,
variables
,
alreadyResolved
).
then
((
resolvedVariables
)
=>
{
if
(
!
resolvedVariables
)
{
return
{
exitCode
:
0
};
}
this
.
currentTask
.
resolvedVariables
=
resolvedVariables
;
return
this
.
executeInTerminal
(
task
,
trigger
,
new
VariableResolver
(
lastTask
.
getVerifiedTask
().
workspaceFolder
,
lastTask
.
getVerifiedTask
().
systemInfo
,
resolvedVariables
.
variables
,
this
.
configurationResolverService
),
workspaceFolder
!
);
},
reason
=>
{
...
...
src/vs/workbench/contrib/tasks/common/taskSystem.ts
浏览文件 @
9c4ebe22
...
...
@@ -119,7 +119,7 @@ export interface TaskSystemInfo {
platform
:
Platform
;
context
:
any
;
uriProvider
:
(
this
:
void
,
path
:
string
)
=>
URI
;
resolveVariables
(
workspaceFolder
:
IWorkspaceFolder
,
toResolve
:
ResolveSet
,
target
:
ConfigurationTarget
):
Promise
<
ResolvedVariables
>
;
resolveVariables
(
workspaceFolder
:
IWorkspaceFolder
,
toResolve
:
ResolveSet
,
target
:
ConfigurationTarget
):
Promise
<
ResolvedVariables
|
undefined
>
;
getDefaultShellAndArgs
():
Promise
<
{
shell
:
string
,
args
:
string
[]
|
string
|
undefined
}
>
;
findExecutable
(
command
:
string
,
cwd
?:
string
,
paths
?:
string
[]):
Promise
<
string
|
undefined
>
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录