-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support input variables for tasks #6331
Conversation
- add support to input variables which have the syntax: ${input:variableID}, where the variableID refers to entries in the inputs section of `tasks.json`. - resolves #5836 Signed-off-by: Liang Huang <liang.huang@ericsson.com>
@elaihau I think it'd also be useful to update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works great for me 👍
I tried using the angular example from VSCode and all the features worked correctly including the dropdown (options) and the input.
Thank you Vincent @vince-fugnitto ! |
@@ -150,6 +150,7 @@ export namespace VariableResolverService { | |||
} catch (e) { | |||
console.error(`Failed to resolved '${name}' variable`, e); | |||
this.resolved.set(name, undefined); | |||
throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elaihau could you elaborate why? It is a breaking change, before broken variables will computed as undefined, but the entire operation won't be stopped.
It affects not only tasks but also launch configurations. We should test this changes agains the debug extension before merging this PR.
@elaihau it would be better if you wait till Monday that other back to work and can have a look |
@@ -85,7 +85,7 @@ export class CommonVariableContribution implements VariableContribution { | |||
const inputs = !!configuration && 'inputs' in configuration ? configuration.inputs : undefined; | |||
const input = Array.isArray(inputs) && inputs.find(item => !!item && item.id === variable); | |||
if (!input) { | |||
return undefined; | |||
throw new Error(`Undefined input variable "${variable}" encountered. Remove or define "${variable}" to continue.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elaihau please revert all changes to resolver
I see what you want now, but we should do it holistically and fix in all other places. Please file an issue for it
Sorry I didn't realize the change i made to @akosyakov
I will also change the schema updater so that users have content assist. |
- content assist is added to help the users of tasks.json input variables. - changes made to VariableResolverService and CommonVariableContribution in #6331 are reverted. Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- content assist is added to help the users of tasks.json input variables. - changes made to VariableResolverService and CommonVariableContribution in #6331 are reverted. Signed-off-by: Liang Huang <liang.huang@ericsson.com>
- content assist is added to help the users of tasks.json input variables. - changes made to VariableResolverService and CommonVariableContribution in eclipse-theia#6331 are reverted. Signed-off-by: Liang Huang <liang.huang@ericsson.com>
tasks.json
. Check https://code.visualstudio.com/docs/editor/variables-reference#_input-variables for more of how this feature works in vsCode.Signed-off-by: Liang Huang liang.huang@ericsson.com
How to test
Please kindly note, the input variable resolution is not supported in all properties under the task config.
Properties include
type
&label
for configured tasks,script
for detected npm tasks, andproblemMatchers
cannot have input variables. (vsCode does the same)
Review checklist