-
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
[tasks] add the display of configured tasks when executing 'configure tasks...' #5472
Conversation
9963b15
to
1d1c2b1
Compare
Just force-pushed to re-trigger the Gitpod build :) |
Did a quick test.
|
I'll try on master, perhaps it never worked in a multi-root use case since it doesn't know where to look for the |
this.items.push(new QuickOpenItem({ | ||
label: 'No tasks found', | ||
run: (_mode: QuickOpenMode): boolean => false | ||
})); | ||
} | ||
|
||
providedTasks.forEach(task => { | ||
[...configuredTasks, ...providedTasks].forEach(task => { |
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 think about use case when at first user has some detected task, then user configures the task.
Will 'Configure Tasks' action display both tasks after that?
So two tasks with the same label will be displayed.
Is it expected behavior?
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.
@RomanNikitenko what do you believe is the correct behavior?
The configure tasks...
menu should display all configured tasks, and provided (detected tasks) which have yet to be configured?
This means if the provided task is configured, it'll no longer show in the menu as detected?
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.
vscode doesn't display both configurations for this case.
"Run Task" menu of Theia displays only configured configuration if both are present (configured and detected)
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.
Thanks! I'll wait for your PR #5313 to resolve before continuing.
Unfortunately you are right #4919 |
this one should be unblocked once #5777 is merged. |
1d1c2b1
to
d87ecf2
Compare
@elaihau I've rebased the PR to take advantage of the changes you made :) |
d87ecf2
to
1beac5e
Compare
@RomanNikitenko thank you for reviewing, I now perform the same operation to determine the |
@vince-fugnitto Is it something wrong with my assembly? |
1beac5e
to
94305d5
Compare
@RomanNikitenko thank you for pointing it out to me! I've updated the code and now get the following behavior: |
@@ -321,7 +324,9 @@ export class TaskConfigureQuickOpenItem extends QuickOpenGroupItem { | |||
} | |||
|
|||
getLabel(): string { | |||
return `${this.task._source}: ${this.task.label}`; | |||
return this.task._source |
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 guess for a configured task the name of the root folder will be used for displaying.
Please see here
Is it expected behavior?
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.
@vince-fugnitto |
@RomanNikitenko sure thank you for pointing it out, I'll investigate it more closely. |
94305d5
to
d7283f9
Compare
d7283f9
to
b11fe53
Compare
0022aa6
to
7ab3104
Compare
@elaihau do you mind reviewing the PR for me when you get the chance? |
) { | ||
super(); | ||
const stat = this.workspaceService.workspace; | ||
this.isMulti = stat ? !stat.isDirectory : false; |
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.
you should not cache such things, but always compute them from WorkspaceService
to make sure that you read up-to-date state, please review others places in the PR
Generally try to have a single source for the some state and read it from there, don't replicate it. Replication sometimes helpful, usually between processes, but introduces with keeping replica in sync and invalidating it properly.
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.
WorkspaceService
has isMultiRootWorkspaceOpened
, just call it everywhere
@vince-fugnitto is not clear from the description how to test, please align with our template and assign more people for review |
Fixed #5468 Added `configured` tasks when executing the command and menu item for `configure tasks...`. Previously, only `provided` tasks were displayed which is inconsistent with vscode, and our own implementation present in the command `run task...` which permits configuring all tasks using the `configure` icon. In order to be consistent, and align with vscode and our own implementations, `configured` tasks should also be added to the menu. Triggering the `configure` for any given task opens the `task.json`. - fixed the deprecated import statements - fixed the deprecated unused injection. Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
7ab3104
to
eae6569
Compare
Thanks, I update the PR description based on the new template. |
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
extension:
configured
tasks are displayed correctly: comment is fixed- the case described here is fixed
configured
anddetected
tasks are displayed forConfigure Tasks
action- tried the cases for multi-root workspace
It works well for me! @vince-fugnitto thank you!
Tested only the single root for now, I found the following when using the procedure "How to test" describe above:
|
That is a behavior currently present in master and is not addressed in the scope of the PR. |
Question: |
I assume you mean when executing the |
Yes in the Configure Task quick-open menu. I just tested with VSCode, you are right, but still I think a separator would make it better |
I tested the following things:
|
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.
Thank you for the work !
Thank you @RomanNikitenko @elaihau for the review. |
What it does
Fixed #5468
How to test
npm
vscode-builtin-extension plugin when testingnpm
for the tasksnpm
for taskstasks.json
file with a new entryReview checklist
Reminder for reviewers
Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com