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

Opening a Custom Editor Removes All Text Editors with Same File Open in Other Columns #124134

Closed
andreamah opened this issue May 18, 2021 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-editor-resolver Issues resolving the editor inputs
Milestone

Comments

@andreamah
Copy link
Contributor

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.57 - insiders
  • OS Version: Windows

Related to #84520

Steps to Reproduce:

  1. Open the same file in two columns.
  2. Open one of them in custom editor.
  3. The column containing the text editor should disappear suddenly, I believe that expected behavior is that it stays open.
@andreamah andreamah added bug Issue identified by VS Code Team member as probable bug custom-editors Custom editor API (webview based editors) labels May 18, 2021
@andreamah andreamah self-assigned this May 18, 2021
@lramos15
Copy link
Member

@andreamah This depends on what custom editor. Some custom editors specifically state that they do not support multiple documents per resource and therefore we must close it to respect the extension authors choice.

@andreamah
Copy link
Contributor Author

@andreamah This depends on what custom editor. Some custom editors specifically state that they do not support multiple documents per resource and therefore we must close it to respect the extension authors choice.

I see. I noticed that this happens with the markdown static preview and hex editor. As for the static preview, I notice that is it possible to have it open in two different columns and toggle between the modes in both sides. Not too sure if it is expected to do this, though.

@lramos15
Copy link
Member

The hex editor cannot be opened more than once for the same resource. I don't think that the static preview has this same limitation

@andreamah
Copy link
Contributor Author

I think that it is disposed here: https://github.com/microsoft/vscode/blob/main/src/vs/workbench/services/editor/browser/editorOverrideService.ts#L137
Not too sure why it's also disposing of the editor that isn't active, though.

@lramos15
Copy link
Member

That dispose is because we return an entirely new input to be opened. I don't think that's the issue, but does removing it fix the problem?

@andreamah
Copy link
Contributor Author

Removing it fixes the problem, but I'm sure that doing that causes other things to go wrong?

@lramos15 lramos15 added workbench-editor-resolver Issues resolving the editor inputs and removed custom-editors Custom editor API (webview based editors) labels May 18, 2021
@lramos15 lramos15 added this to the May 2021 milestone May 18, 2021
@lramos15
Copy link
Member

\closedWith a069768

@JacksonKearl JacksonKearl added the verified Verification succeeded label Jun 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-editor-resolver Issues resolving the editor inputs
Projects
None yet
Development

No branches or pull requests

4 participants
@lramos15 @JacksonKearl @andreamah and others