Skip to content

Conversation

@SchoofsKelvin
Copy link
Contributor

@SchoofsKelvin SchoofsKelvin commented Jan 16, 2021

This PR fixes #114473

The string ${abc:test} ${abc} would result in commandValueMapping having:

{
    "abc": "${abc}",
    "abc:test": "${abc:test}"
}

where resolveFromMap would get "abc" for both variables, resulting in ${abc:test} being replaced with ${abc}, disregarding the splitting of abc:test into ['abc', 'test'] that happened beforehand.

This PR makes the call to resolveFromMap recreate the original variable ("abc:test") to pass to it. Running the example code in the mentioned issue with this fix produces the following output:

> Executing task: ABC <

Original: echo '${workspaceFolderBasename}' '${def:arg}' '${abc:test}' '${abc}' '${abc:def}' '${xyz:123}' '${xyz:456}'
Resolved: echo 'Empty workspace' '${def:arg}' '${abc:test}' '${abc}' '${abc:def}' '${xyz:123}' '${xyz:456}'

Terminal will be reused by tasks, press any key to close it.

The ${abc:test} remains ${abc:test}, unlike before where it would've been "resolved" to ${abc} instead.

@alexr00 alexr00 added this to the February 2021 milestone Feb 12, 2021
@alexr00 alexr00 merged commit 8156941 into microsoft:master Feb 12, 2021
@alexr00 alexr00 self-requested a review February 12, 2021 15:18
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@SchoofsKelvin SchoofsKelvin deleted the issue/114473 branch February 12, 2021 15:24
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CustomExecution missing task variables with arguments get truncated

2 participants