Skip to content
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

Tasks stall when using command variables with custom execution #136746

Closed
HampusAdolfsson opened this issue Nov 9, 2021 · 3 comments
Closed

Tasks stall when using command variables with custom execution #136746

HampusAdolfsson opened this issue Nov 9, 2021 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues verified Verification succeeded
Milestone

Comments

@HampusAdolfsson
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.63.0-insider
  • OS Version: Windows 10 Enterprise - build 19042.1288

Steps to Reproduce:

  1. Create a task that uses a CustomExecution (e.g. the task-provider-sample).
  2. Return a task from provideTasks() where one task definition property uses a command variable (e.g. ${command:workbench.action.findInFiles}, the command is never run so it doesn't matter what it is. I have also tested with more meaningful commands, that return a value from a quick pick dialog).
  3. Launch the extension and run the task.
  4. Observe that it is launched but never goes anywhere (and never reaches the CustomExecution). It is stuck like this:
    bild
    Note that tasks returned from resolveTask do not behave like this, so configuring the task or running it from "recently used" works fine. Shell and Process executions do not behave like this.
@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tasks Task system issues labels Nov 9, 2021
@alexr00 alexr00 modified the milestones: On Deck, November 2021 Nov 9, 2021
@rchiodo rchiodo added the verified Verification succeeded label Dec 2, 2021
@rchiodo
Copy link
Contributor

rchiodo commented Dec 2, 2021

Maybe I'm doing this wrong, but I don't think this is working?

I modified the customTaskProvider sample to take an 'extra' flag like so:

        {
            "type": "custombuildscript",
            "flavor": "64",
            "flags": [],
            "extra": "${command:workbench.action.files.openFile}",
            "problemMatcher": [],
            "label": "custombuildscript: 64 "
        }

Running the task does bring up the open file dialog but the custom task execution never runs.

If I remove the command argument for extra, the custom command task runs. So it seems like this is halfway fixed?

@rchiodo rchiodo removed the verified Verification succeeded label Dec 2, 2021
@rchiodo rchiodo reopened this Dec 2, 2021
@rchiodo rchiodo added the verification-found Issue verification failed label Dec 2, 2021
@HampusAdolfsson
Copy link
Author

@rchiodo The fix (9923e8e) solves the bug I had. I use a custom command that shows a quick pick and returns a value, and it works great in insiders.

It seems some builtin commands prevent tasks from starting (e.g. ${command:workbench.action.files.openFile} or ${command:workbench.action.findInFiles}). However this is the case for me even when using ShellExecution so it is probably a separate bug (or intented? I'm not sure what would be the expected result when calling openFile in a task definition).

@alexr00
Copy link
Member

alexr00 commented Dec 2, 2021

Thank you for verifying @HampusAdolfsson!

Commands that don't return a string are not supported for variable resolving, so this is intended.

@alexr00 alexr00 closed this as completed Dec 2, 2021
@alexr00 alexr00 added verified Verification succeeded and removed verification-found Issue verification failed labels Dec 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@HampusAdolfsson @rchiodo @alexr00 and others