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

Save All command blindly modifies all open files #13923

Closed
KR155E opened this issue Jul 14, 2024 · 3 comments · Fixed by #13942
Closed

Save All command blindly modifies all open files #13923

KR155E opened this issue Jul 14, 2024 · 3 comments · Fixed by #13942
Assignees
Milestone

Comments

@KR155E
Copy link
Contributor

KR155E commented Jul 14, 2024

Bug Description:

The "core.saveAll" command saves all open files to disk, despite them not having been changed, changing the "last modified" timestamp. In our case, this is unnecessarily causing the GCC compiler to pick these files up again in its next run.

I guess the correct behavior would be to check for each file's isDirty flag and refrain from touching it if the isDirty flag is false.

Steps to Reproduce:

  1. Open any file and aside to it, the Properties view
  2. Note the "Last modified" timestamp in the Properties view
  3. Run the command "File: Save All"
  4. Check the "Last modified" timestamp again in the Properties view (make sure to switch to another file and back to update the view first, it won't update automatically)

Additional Information

  • Operating System: Observed on OSX & Linux
  • Theia Version: 1.51.0
@JonasHelming
Copy link
Contributor

Hi, thank you for the report. I can confirm the behavior you described. As you already describe the solution, are you interested in a contribution?

@KR155E
Copy link
Contributor Author

KR155E commented Jul 22, 2024

Sure! Here's the PR: #13942

@martin-fleck-at
Copy link
Contributor

martin-fleck-at commented Jul 22, 2024

Thank you @KR155E for catching that! I'll have a look at your PR within the next few hours.

Out of curiosity, I had a look at how VS Code behaves and, interestingly, the 'Save' operation always seems to write the file and update the modified date whereas the 'Save All' operation only collects the modified editors. So aligning here is definitely a good idea.

@sgraband sgraband added this to the 1.52.0 milestone Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants