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

fix: use vscode.open to open file #1297

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

scnwwu
Copy link
Member

@scnwwu scnwwu commented Nov 26, 2024

Summary
Fix #1289
Need to use vscode.open to open file with correct UI instead of always opening with the default code editor.
It looks like the reason using vscode.openWith was to set preview to false. In my opinion we should not always set preview to false. It's possible that the file was in preview mode before closing, in which case it doesn't make sense to re-open with preview: false. The tab closing is noticeable to end user. We even ask user to save or not save the file before closing. So I think it's OK to re-open with preview mode, same as if user close and re-open.

Testing
Test case in #1289

@scnwwu scnwwu requested a review from scottdover November 26, 2024 06:09
@scnwwu scnwwu added this to the 1.13.0 milestone Nov 26, 2024
@scottdover
Copy link
Contributor

I switched to using openWith in my latest changes because renaming a folder requires closing all files within the folder (for sas server, where the uris change as part of renaming). This change would effectively make it such that we close N files (where N > 1) but only re-open 1 file (unless preview mode is disabled)

@scnwwu
Copy link
Member Author

scnwwu commented Nov 27, 2024

I switched to using openWith in my latest changes because renaming a folder requires closing all files within the folder (for sas server, where the uris change as part of renaming). This change would effectively make it such that we close N files (where N > 1) but only re-open 1 file (unless preview mode is disabled)

Hi @scottdover, I tried with this PR, it successfully re-opened all closed files. When calling vscode.open the second time, the first opened tab was made non-preview automatically. Would you double check?

@scottdover
Copy link
Contributor

You're right 🤔 . I was pretty certain I tested re-opening multiple files after renaming the folder and it didn't work with preview mode...must've been something else causing my issue. Thanks for taking care of this :)

@ShermanWang0324
Copy link
Collaborator

Tested the rename sas notebook file with unsaved sas code, re-render will successful as expected.
fixed

@ShermanWang0324 ShermanWang0324 added testing-complete Complete the pull requests testing and removed testing Test the pull requests labels Dec 9, 2024
@scnwwu scnwwu merged commit 9ff3caa into sassoftware:main Dec 9, 2024
2 checks passed
@scnwwu scnwwu deleted the p-vscodeopen branch December 9, 2024 08:55
@ShermanWang0324 ShermanWang0324 added ready for release Code pushed, but not released in VS code marketplace yet and removed testing-complete Complete the pull requests testing labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for release Code pushed, but not released in VS code marketplace yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The format of the notebook file is not correct after doing renaming action
4 participants