Save edited buffers before running a task#48861
Save edited buffers before running a task#48861SomeoneToIgnore merged 2 commits intozed-industries:mainfrom
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @abenea on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
We require contributors to sign our Contributor License Agreement, and we don't have @abenea on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
save_before_task_run setting (fixes #10251).save_before_task_run setting
f4513e4 to
0cd2519
Compare
0cd2519 to
d989cca
Compare
d989cca to
5a912b7
Compare
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thank you, after a few tweaks this should be a nice way to add the functionality in general.
5a912b7 to
91f66bb
Compare
91f66bb to
c333a61
Compare
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Great to see entities not moved into tasks now, we're almost there.
To add to the settings discussion, let's add the "save the current file" when making the rest of the changes.
It makes sense to have the "save all" by default for now, and work on the "global template" to override global task defaults later.
c333a61 to
ef428dc
Compare
save_before_task_run setting
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Great, thank you!
All that's left are style nits and one extra doc entry and we're good to merge.
Introduces a new task field for configuring which buffers are saved. For now, this defaults to saving all buffers, but in the future we could have a global task template to configure this setting for dynamically created tasks. Needed for zed-industries#10251. Release Notes: - Edited buffers are now saved before running a task. This can be configured with the new "save" field in `tasks.json`.
ef428dc to
5634a12
Compare
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thank you so much!
9a4dad2 to
8daf2b3
Compare
Save edited buffers before running a task Introduces a new task field for configuring which buffers are saved. For now, this defaults to saving all buffers, but in the future we could have a global task template to configure this setting for dynamically created tasks. Needed for zed-industries#10251. Release Notes: - Edited buffers are now saved before running a task. This can be configured with the new "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Save edited buffers before running a task Introduces a new task field for configuring which buffers are saved. For now, this defaults to saving all buffers, but in the future we could have a global task template to configure this setting for dynamically created tasks. Needed for zed-industries#10251. Release Notes: - Edited buffers are now saved before running a task. This can be configured with the new "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Save edited buffers before running a task Introduces a new task field for configuring which buffers are saved. For now, this defaults to saving all buffers, but in the future we could have a global task template to configure this setting for dynamically created tasks. Needed for zed-industries#10251. Release Notes: - Edited buffers are now saved before running a task. This can be configured with the new "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
|
I don't think saving all buffers is a reasonable default, see #52926. |
|
Indeed, seems that we cannot use the "save a single file" mode either and have to fall back to the "save nothing" mode until the global task template configuration is implemented? |
This is what I observed when testing the Python tasks:
So defaulting to "save the current file" is significantly less breaking of a change, but there is still an edge case. |
Yes, well noted, so this implementation is not really ready to be the default in any of the saving options it seems. For now, let's keep the "nothing saved" default then, thank you. |
I put up a quick PR for this, but I haven't built and tested because I don't have a local dev environment set up. |
|
Thank you, I've tested that on my machine and it works (had implemented the same fix essentially). I've also tried to set up a branch with a forward fix where we skip non-worktree-related files, but got stuck at writing the test — maybe someone else later can take a stab at it. |
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #52926 Follow-up to #48861 cc @SomeoneToIgnore Release Notes: - Edited buffers are no longer saved by default before running a task, but you can still configure this using the "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #52926 Follow-up to #48861 cc @SomeoneToIgnore Release Notes: - Edited buffers are no longer saved by default before running a task, but you can still configure this using the "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #52926 Follow-up to #48861 cc @SomeoneToIgnore Release Notes: - Edited buffers are no longer saved by default before running a task, but you can still configure this using the "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
…k to preview) (#52990) Cherry-pick of #52976 to preview ---- Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #52926 Follow-up to #48861 cc @SomeoneToIgnore Release Notes: - Edited buffers are no longer saved by default before running a task, but you can still configure this using the "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com> Co-authored-by: Justin Su <injustsu@gmail.com> Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #52926 Follow-up to #48861 cc @SomeoneToIgnore Release Notes: - Edited buffers are no longer saved by default before running a task, but you can still configure this using the "save" field in `tasks.json`. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Save edited buffers before running a task
Introduces a new task field for configuring which buffers are saved. For now, this defaults to saving all buffers, but in the future we could have a global task template to configure this setting for dynamically created tasks.
Closes #10251.
Release Notes:
tasks.json.