-
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
use task definition as a reference to compare tasks #5975
Conversation
548d6da
to
0f8e3c6
Compare
0f8e3c6
to
528ded1
Compare
@theia-ide/task-extension @theia-ide/plugin-system |
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.
Hello!
I tested the changes and can not reproduce the issue #5878
thank you!
but I faced with another problem, please see video
before changes: https://youtu.be/VCCnIkjE9vQ
after changes: https://youtu.be/RFB3bkZn-tk
So:
- displaying of a typescript task is different
- I can not get output for a typescript task
Could you check it?
thanks in advance!
Thank you for your time! I will check what I did wrong. |
@RomanNikitenko I checked the latest master 06346e5 and found it populated the same error when running the I am curious which version of Theia you used to make the first video ? Could you please help me check? |
For
I guess you tried to run thank you! |
0ce0e93
to
56c44db
Compare
@RomanNikitenko thank you for all the details ! yes i can finally reproduce the problem. The latest version of my code in this pull request should have fixed it. Not only the "configured tsc" but also the "detected tsc" can be started from Theia. Please take a look when you get the chance, and kindly let me know if you have any suggestions. Thanks ! |
56c44db
to
8fcc050
Compare
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
Hello!
I tested the PR changes after update and can confirm that:
- the bug Incorrect displaying of configured task after refreshing page #5878 is fixed
- I can run and get output for
detected
tsc
task as well as forconfigured
one
Do we have some reasons to change displaying of typescript tasks?
I mean that typescript tasks for Terminal -> Run Task
menu are displayed:
So the behavior for Configure Tasks
is closer to VS Code behavior than for Run Task
.
I guess it's related to changes for TaskRunQuickOpenItem
.
For TaskConfigureQuickOpenItem
as label still this way is used.
It works well for me, thank you, just to know if we have some reasons to change way of displaying items...
@RomanNikitenko
I quickly looked at the code and found we don't have extra sorting logic for the displayed tasks in the quick open. the reason I changed the task label is that, the "task type" could possibly be overwritten after task resolution, and "tsc: run" would be displayed as "shell: run" after the task is run once. I could create a separate issue in github and address it in a separete pull request. are you OK with that? After all, the sorting might be a little beyond the scope the #5878 |
@elaihau
So the question is - why do we display it like |
@RomanNikitenko wow thank you for finding it out and pinpoint the root cause. I can revert my changes to I will create a separate GH issue for the problem I described. |
8fcc050
to
f235bda
Compare
@elaihau Could you try the following case:
You can see that
You can see that the task in the Please see the video: https://youtu.be/DixaBLnl1M8 Can you reproduce it? Should I create the separate issue for the case? |
Yes I am aware of this problem. And that is why I changed getLabel() function in the quick-open-task.ts. The problem comes from the vscode extension typescript-language-features, where the type of tasks is “tsc” in the Task instantiation, while the type in the task definition is “typescript”. Therefore, if I want the tsc tasks to be added to the “recently run”, we have inconsistent labels. And if we want consistent labels in the display, they are not added to the “recently run”. It’s really annoying. Luckily enough, this only happens to detected tasks from “typescript-language-features”. The ones from npm and grunt are not impacted. Maybe I should take a deeper look into this problem. If you have time please create an issue in GitHub and I will tackle it after the “fetchTask()” pull request. **With all the given information, do you prefer “tsc build” or “typescript build” in the quick open ? ** “tsc build” is consistent with vscode with the bug you described, whereas “typescript build” is inconsistent with vscode. Your comments are really helpful. Thank you! |
Let’s keep this pull request open. I prefer to fix it in this one instead of leaving it to the future :) |
Do you mean - we don't have the problem described here if we have your changes for In general, when I do review I don't have the goal to block some PR - my goal is to identify the potential problems before merge some changes. Then the author, reviewers, code owners can assess and discuss - should it be fixed within the current PR or we should create an issue for detected problem and fix it in separate PR. |
f235bda
to
8555761
Compare
- Although task users have much flexibility to define tasks through contributing to the Task definitions, TaskConfiguration.equals() and ContributedTaskConfiguration.equals() compare certain properties of task configs, and thus are not reliable enough. With changes in this pull request, Theia uses task definitions as a reference to decide which properties in task configs should be considered in comparison. - fixed #5878 Signed-off-by: Liang Huang <liang.huang@ericsson.com>
8555761
to
8eec728
Compare
there is no misunderstanding here :) i think you have made all the comments in good faith, and i sincerely appreciate it. I made more changes to my code, and tested with npm and typescript-language-feature. i believe the display problem has been fixed with my latest change. and "recently run tasks" should also be functional. @RomanNikitenko |
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.
I tested the changes using npm
and tsc
tasks after update:
- I can not reproduce the bug Incorrect displaying of configured task after refreshing page #5878
- I can run a
tsc
task asdetected
as well asconfigured
- thank you very much for the fix fordetected
tsc
task! - a task after running is placed in
recently used
section - after refreshing page label for a task looks correctly
- labels for
tsc
tasks are consistent
@elaihau thank you for fix!
Thank you Roman 👍 |
contributing to the Task definitions, TaskConfiguration.equals() and
ContributedTaskConfiguration.equals() compare certain properties of task
configs, and thus are not reliable enough. With changes in this pull
request, Theia uses task definitions as a reference to decide which
properties in task configs should be considered in comparison.
Signed-off-by: Liang Huang liang.huang@ericsson.com
How to test
Review checklist