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

preferences: Support 'Close On File Delete' preference #8731

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

DucNgn
Copy link
Contributor

@DucNgn DucNgn commented Nov 6, 2020

What it does

Fixes #8730

  • Changes deletedSuffix to (deleted).
  • Adds new preference workbench.editor.closeOnFileDelete (false by default) to control whether the editor should be closed if other processes deleted or renamed the file.

How to test

  • Start the application and open a file (ex: readme.md).
  • Delete the file on the filesystem.

Observe:
Note: Regardless of the setting, dirty editors should not be closed when other processes deleted or renamed the file.

  • If closeOnFileDelete is true => the editor is closed.
  • If closeOnFileDelete is false => the editor is kept alive with the change in the title (readme.md (deleted))
    image

Review checklist

Reminder for reviewers

Signed-off-by: Duc Nguyen [email protected]

Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, can you add a test case for this new behavior?

@DucNgn DucNgn force-pushed the dn/stopWidgetsClose branch 4 times, most recently from 1ae042b to 7939174 Compare November 18, 2020 17:11
@DucNgn DucNgn marked this pull request as ready for review November 18, 2020 17:21
@DucNgn DucNgn force-pushed the dn/stopWidgetsClose branch from 7939174 to e768066 Compare November 18, 2020 17:32
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM code wise.

+ Add new preference `workbench.editor.closeOnFileDelete` to control
whether the editor should be closed if another process deleted or renamed the file.
+ Change deletedSuffix to ` (deleted)`.

Signed-off-by: Duc Nguyen <[email protected]>
@DucNgn DucNgn force-pushed the dn/stopWidgetsClose branch from e768066 to 62fa8af Compare December 1, 2020 15:49
@paul-marechal paul-marechal merged commit 9a8cdab into eclipse-theia:master Dec 1, 2020
@DucNgn DucNgn deleted the dn/stopWidgetsClose branch December 1, 2020 17:02
@paul-marechal paul-marechal added this to the 1.9.0 milestone Dec 1, 2020
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 this pull request may close these issues.

editor: support 'close on file delete' preference
2 participants