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

Don't save all "dirty editors" when a task is executed #94285

Closed
robertrossmann opened this issue Apr 2, 2020 · 5 comments · Fixed by #94466
Closed

Don't save all "dirty editors" when a task is executed #94285

robertrossmann opened this issue Apr 2, 2020 · 5 comments · Fixed by #94466
Assignees
Labels
feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities on-testplan tasks Task system issues
Milestone

Comments

@robertrossmann
Copy link
Contributor

The Problem

When I have multiple editors with changes open and I invoke a task (like the default build/test task) all editors are automatically saved before the task is executed. Sometimes this causes my test run to fail because the other files are not yet ready to be tested, they are still a work in progress. Other times I simply want to compile my current file to see if it actually compiles against the rest of the project, only to discover that my other pending changes have been saved to disk as well and they now break the compilation for a myriad of reasons (syntax errors, unfinished implementations etc.).

This forces me to either painfully stash away the unwanted changes and run the task again or keep "flying blind" until I make the codebase fully functional again.

The solution

I would love to have some control over that autosave-on-task-run functionality. I was unable to find anything relevant in Settings or task definitions.

Option 1

Ask me each time I run a task with other "dirty" editors to either save them or run as-is.

Option 2

Add a configuration option/checkbox to specify ahead of time whether to save any dirty editors before task runs or to simply run them straight away.

Option 3

Allow a task definition to control this mechanism through a flag (via tasks.json).

I think I like the option 1 and option 2 the most.
Thank you for considering this! ❤️

@vscodebot
Copy link

vscodebot bot commented Apr 2, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@alexr00 alexr00 added feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities tasks Task system issues labels Apr 2, 2020
@alexr00 alexr00 added this to the Backlog milestone Apr 2, 2020
@alexr00
Copy link
Member

alexr00 commented Apr 2, 2020

I would accept a pull request that adds a setting for this. Code pointers:
Where the setting would need to be checked

return this.editorService.saveAll().then(() => { // make sure all dirty editors are saved

Examples where the setting would need to be defined
configurationRegistry.registerConfiguration({
id: 'task',

@swiz115
Copy link
Contributor

swiz115 commented Apr 2, 2020

I would like to take a look at resolving this

@robertrossmann
Copy link
Contributor Author

It just occurred to me that perhaps the best UX to address this problem would be a multiple-choice setting where the user can specify which of the proposed actions should be taken when a task is run with dirty editors open. The options would be

  • save all and run
  • run without saving
  • prompt each time

Would that also be fair game for a PR? 🤔

@cumbreras
Copy link
Contributor

cumbreras commented Apr 5, 2020

Hey, I've taken the liberty of opening a PR adding the specs that @robertrossmann suggested, hopefully, makes sense.

Helping OSS on quarantine is the way to go!

@alexr00 alexr00 modified the milestones: Backlog, April 2020 Apr 6, 2020
alexr00 added a commit that referenced this issue Apr 23, 2020
fixes #94285

Co-authored-by: Alex Ross <alros@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities on-testplan tasks Task system issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants