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

Calling a task using TaskDefinition data does not work in 1.70.0 #157814

Closed
ivankravets opened this issue Aug 10, 2022 · 7 comments · Fixed by #159632
Closed

Calling a task using TaskDefinition data does not work in 1.70.0 #157814

ivankravets opened this issue Aug 10, 2022 · 7 comments · Fixed by #159632
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues verified Verification succeeded

Comments

@ivankravets
Copy link

ivankravets commented Aug 10, 2022

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

  • VS Code Version: 1.70.0
  • OS Version: Darwin x64 21.6.0

Steps to Reproduce:

  1. Provide a task to the vscode.tasks.registerTaskProvider wit the following data:
    const vscodeTask = new vscode.Task(
      {
        type: "Foo",
        task: "foo.clean-project",
      },
       projectDir,
      "Clean project",
      "Foo",
      ....
    );
 ...
  1. Run the task:

This code works:

    vscode.commands.executeCommand('workbench.action.tasks.runTask', {
      type: "Foo",
      task: "Clean project",
    });

whereas, this does not:

    vscode.commands.executeCommand('workbench.action.tasks.runTask', {
      type: "Foo",
      task: "foo.clean-project",
    });
@ivankravets
Copy link
Author

Hi @meganrogge and @alexr00,

Could it be a regression of #155635 ?

@ivankravets
Copy link
Author

I forgot to mentioned, that we tried to follow VSCode API which has the next:

The task's name. Is presented in the user interface.

So, we show a human-readable task name/description, where call a task later using its ID. You can check the original issue which was reported at platformio/platformio-core#4386 by @DigiH

@meganrogge meganrogge added this to the July 2022 Recovery 2 milestone Aug 11, 2022
@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug tasks Task system issues candidate Issue identified as probable candidate for fixing in the next release and removed candidate Issue identified as probable candidate for fixing in the next release labels Aug 11, 2022
@meganrogge
Copy link
Contributor

@ivankravets this is how task is currently described and supported - as you state above, providing the label and type will work. I've marked this as a bug because it seems historically using the task identifier was also supported.

https://github.com/microsoft/vscode/pull/156603/files#diff-f77e08d48fa5a43f6cd385c0bac2c04ee2123565ead5f0f4b60e23c8af821b76R403

@Tyriar Tyriar removed their assignment Aug 30, 2022
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Sep 7, 2022
@roblourens
Copy link
Member

roblourens commented Sep 29, 2022

I think I have this set up correctly with the task provider sample. But when I run the runTask command, it just pops up the task picker

image

Same whether I pass the task name or task property from the definition. I also don't really understand how the task property is special since that doesn't seem to show up in the dts

@roblourens roblourens added the author-verification-requested Issues potentially verifiable by issue author label Sep 29, 2022
@vscodenpa
Copy link

This bug has been fixed in the latest release of VS Code Insiders!

@ivankravets, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 2c80125 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@connor4312 connor4312 added the verified Verification succeeded label Sep 30, 2022
@connor4312
Copy link
Member

If I understand, the latter example from the reporter should be the one that worked, selecting the task by its definition. The first "this code works" example should not actually have worked. I happened to have a 1.68 stable still on my system and verified that Insiders and 1.68 now match this behavior, so the regression was fixed.

@ivankravets
Copy link
Author

I've just tested the latest Insiders build and everything works as expected. Thanks for the fix! 🙏

@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants