-
Notifications
You must be signed in to change notification settings - Fork 59
Added feature to check for unsaved files in a folder upon deletion. #1559
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
base: main
Are you sure you want to change the base?
Conversation
…nsion into kibpat_VSExt_1136
…code-sas-extension into kibpat_VSExt_1136
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: ae98ac4 I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 774bc8e I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 4b8f211 Signed-off-by: Kishan Patel <[email protected]>
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 877ec93 I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 1bf8187 Signed-off-by: Kishan Patel <[email protected]>
…nsion into kibpat_VSExt_1136
…code-sas-extension into kibpat_VSExt_1136
Added fixes. Put the logic into the UI and Service layer. Children are found recursively for the folder and added to a set. Open files are then referenced into the set to see if they are within it. If the file is dirty and in the children set, a popup will appear. Overall, time complexity boils down to O(N + M) I believe where N is the number of files within a root directory and M being the number of files being open in the window. |
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 5ef4032 I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 3195f1d I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 9166f84 Signed-off-by: Kishan Patel <[email protected]>
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.
@kpatl1, for your nested folder question, if you dump your uriToParentMap
, you'll see that the Uri format in key and value are different.
I've added suggestions that will make it work
Co-authored-by: Wei Wu <[email protected]>
Co-authored-by: Wei Wu <[email protected]>
Co-authored-by: Wei Wu <[email protected]>
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 5da1aa5 Signed-off-by: Kishan Patel <[email protected]>
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.
please do NOT change this file when no dependencies changed
@@ -523,5 +540,4 @@ class ContentNavigator implements SubscriptionProvider { | |||
} | |||
} | |||
} | |||
|
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.
unnecessary change
? Messages.FolderDeletionError | ||
: Messages.FileDeletionError, | ||
); | ||
if (resource.contextValue.includes("delete")) { |
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.
looks like a bad merge. This line was deleted by
https://github.com/sassoftware/vscode-sas-extension/pull/1557/files#diff-67d022ea7fd74e7337764a8ef0bd8aaf9c4aada502744fdd38facc2f4f3e9372L109
Summary
I have added a function that checks if there are unsaved files within a folder. If so, it will open a modal asking if the user wants to actually delete the folder. On deletion it will then move to recycle bin.
Testing
How did you test this change?
I followed the steps to recreate the feature request by joining a viya server, making a new folder with two unsaved files, and then try to delete the folder. After deleting it, I got the message if I truly did want to and then I had the option to continue or cancel. On continuation, the folder then moved to recycle bin.
Fixes #1136