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

support user-defined labels for detected tasks #7574

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

elaihau
Copy link
Contributor

@elaihau elaihau commented Apr 14, 2020

Signed-off-by: Liang Huang lhuang4@ualberta.ca

How to test

  1. define a detected task in your workspace. Mine was defined in package.json as follows:
  "scripts": {
    "list": "sleep 1 && ls"
  },
  1. the task defined in Step 1 should show up in the task list as npm: list.
  2. customize the label. I added the following config into tasks.json
        {
            "type": "npm",
            "script": "list",
            "label": "NPM LIST CUSTOMIZED LABEL",
            "problemMatcher": []
        },
  1. The customized npm: list should show up as NPM LIST CUSTOMIZED LABEL in the task list
  2. Check if the customized detected task can be run.

Peek 2020-04-14 16-48

Review checklist

@elaihau elaihau added the tasks issues related to the task system label Apr 14, 2020
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I verified that configured tasks can now define their own custom labels, and that these such tasks still work correctly when executed 👍

Copy link
Contributor

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

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

Hello, Liang!

I tried these changes to define a label for tsc:watch task and it doesn't work for me.

watch

Please let me know if I'm doing something wrong.
Thank you!

- With this change users would be able to define labels in the task configs to overwrite the task names from providers.
- fixes #6507
- fixes #7515

Signed-off-by: Liang Huang <lhuang4@ualberta.ca>
@elaihau
Copy link
Contributor Author

elaihau commented Apr 16, 2020

I tried these changes to define a label for tsc:watch task and it doesn't work for me.

Hi Roman thank you for the review, really appreciated !
The bug you found should have been fixed after the most recent patch. @RomanNikitenko

@RomanNikitenko RomanNikitenko self-requested a review April 16, 2020 13:39
Copy link
Contributor

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

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

Tested after update using tsc:watch task:

  • the bug described above was fixed
  • a label is correctly applied for all tasks related actions (attach, terminate, configure, restart, show running)
  • I don't see any regression

Thanks, Liang!

@elaihau elaihau merged commit 05ea8fd into master Apr 16, 2020
@elaihau elaihau deleted the Liang/labelDetectedTask branch April 16, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks issues related to the task system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot run configured Task with Label support overwriting the label of detected tasks
3 participants