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

onDidCloseTextDocument for preview pane has significant delay #13623

Closed
anthonydresser opened this issue Oct 12, 2016 · 1 comment
Closed

onDidCloseTextDocument for preview pane has significant delay #13623

anthonydresser opened this issue Oct 12, 2016 · 1 comment
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@anthonydresser
Copy link
Contributor

anthonydresser commented Oct 12, 2016

  • VSCode Version: 1.6.0
  • OS Version: Mac 10.11.6

The onDidCloseTextDocument event seems to not fire for minutes after the closing of a preview pane, where as it works perfectly for normal text documents. Last time I tried, I timed it at taking 2 minutes and 30 seconds to fire after closing a preview pane. In my application I am dependent on this to clean up data that was being held for the preview pane.

Is this a bug? or is there a different way to detect when a preview pane specifically is closed to clean up data (a handler specific for content providers maybe)?

Repro located at https://github.com/anthonydresser/vscodeRedirectTest

Steps to Reproduce:

  1. Open a document and use the Test Redirect command to open a preview pane
  2. Put a breakpoint on the ondidclose handler in the testProvider
  3. Close the preview pane
@jrieken
Copy link
Member

jrieken commented Oct 13, 2016

That is intentional - for virtual document we run a cleanup every 3 minutes. If we don't find it to be shown in any editor anymore we dispose the model.

So, the event will come but it is a document close event, not a preview pane closed event (which we track in #6941).

@jrieken jrieken closed this as completed Oct 13, 2016
@jrieken jrieken added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Oct 13, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants