-
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
access tasks configs as preferences #6268
Conversation
ec7a447
to
8f66f5a
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.
Awesome changes! Code looks very good besides minor remarks.
From user perspective: content assist does not work in tasks.json regardless whether I create it in .theia
or .vscode
folder.
@RomanNikitenko @vince-fugnitto if you do smoke testing it would help too, just to be safe, i.e. with some VS Code extensions. You should be able to define now tasks.json in .vscode or .theia folder and in settings.json under |
8f66f5a
to
b477487
Compare
Thank you for the review Anton ! |
@elaihau more important that it can be loaded from |
model.onDispose(() => this.models.delete(key)); | ||
this.models.set(key, model); | ||
} | ||
this.onDidChangeTaskConfigEmitter.fire({ uri: key, type: FileChangeType.UPDATED }); |
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.
It should happen only in if
branch, if model already exists then we don't need to fire update event
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.
Code changes looks good to me just please have a look at https://github.com/eclipse-theia/theia/pull/6268/files#r328968945
I can define and run tasks now under .vscode
as well, content assist is there.
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 following functionality in Theia:
Use Case | Status |
---|---|
run task without selecting a problem matcher |
👍 |
run task selecting 'never ask' (this successfully writes "problemMatcher": [] in the tasks.json |
👍 |
run task which has [] as a problem matcher (does not prompt me again) |
👍 |
run task selecting a problem matcher (this successfully writes the problem matcher in the tasks.json |
👍 |
run task which has a problem matcher (does not prompt me again) |
👍 |
verify recently used tasks are present in the run task quick-open |
👍 |
verify if clearing recently used tasks removes recently used tasks from the quick-open | 👍 |
verify if configure tasks works |
👍 |
verify if run last task works |
👍 |
verify if show running tasks works |
👍 |
.vscode/tasks.json has content assist |
👍 |
able to define and run tasks from the .vscode/tasks.json (might be an error on my part, to be confirmed) |
\ |
multi-root works | 👍 |
- In current Theia, the task extension is responsible for reading, writing, and watching `tasks.json` files. With this change, the task extension does not access `tasks.json` files directly, and leaves the work to the preference extension. - resolves #5013 Signed-off-by: Liang Huang <[email protected]>
@vince-fugnitto thank you for the review, really apprecited ! I tested the scenario where task configs are defined in |
b477487
to
6ec8347
Compare
I confirmed that it also works for me to define tasks under |
yep i believe what you described was from Anton's code:
|
writing, and watching
tasks.json
files. With this change, the taskextension does not access
tasks.json
files directly, and leaves thework to the preference extension.
How to test
There are no changes in terms of functionalities. Therefore, to verify this change, we would need to go through the use cases that are already supported by Theia, and check if they are still properly functional. Those use cases include but not limit to:
As a Theia user I am able to
tasks.json
tasks.json
Terminal
->Configure Tasks ...
)tasks.json
tasks.json