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

Custom editors cannot be opened when a single-folder workspace has Been Extended To A Multi-Folder Workspace #98603

Open
hediet opened this issue May 26, 2020 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug custom-editors Custom editor API (webview based editors) help wanted Issues identified as good community contribution opportunities webview Webview issues
Milestone

Comments

@hediet
Copy link
Member

hediet commented May 26, 2020

  • VSCode Version: 1.45.1 / Insiders 2020-05-26T15:51:05.752Z
  • OS Version: Windows 10 / Mac

Steps to Reproduce:

  1. Check out Cat Customs Sample
  2. Install the extension
  3. Copy the exampleFiles folder to exampleFiles2
  4. Open a new VS Code Instance with exampleFiles as root folder
  5. (Custom Editor works as intended)
  6. Add exampleFiles2 to the workspace.
  7. Open example.cscratch in exampleFile2 folder.
  8. It crashes.

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

You can see this happening with my draw.io extension too:
hediet/vscode-drawio#61

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug webview Webview issues labels Jun 2, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Jun 2, 2020

This is a known issue with webviews in general. Converting a single folder to a workspace causes the extension host to restart, which causes any webviews to become detached from the extension that is running them

@mjbvz mjbvz added this to the Backlog milestone Jun 2, 2020
@hediet
Copy link
Member Author

hediet commented Jun 2, 2020

Thanks for the reply ;) This also happens for webviews that are opened after the host has been restarted! If this is hard to fix, it would be cool if it could be made more obvious that this is a bug of vscode, not the extension (cause it looks very much like a problem of the extension - for both users and developers of extensions).

@roblourens
Copy link
Member

Not knowing much about the webview api, is it possible for the extension to reattach to the webview? Or will it just be left open and the user can, for example, manually copy their unsaved changes out of it then close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug custom-editors Custom editor API (webview based editors) help wanted Issues identified as good community contribution opportunities webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants