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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 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?

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.

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