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

Dispose explorer view welcome correctly #11312

Merged
merged 2 commits into from
Jun 20, 2022

Conversation

msujew
Copy link
Member

@msujew msujew commented Jun 20, 2022

What it does

Closes #11283

As we call registerViewWelcome each time we recreate the FileNavigatorWidget, we need to clean up the disposable that we create, once the widget is disposed.

Also localizes the view welcome text.

How to test

  1. Close your workspace
  2. Close the file explorer (using the Close context menu entry)
  3. Open the file explorer
  4. Assert that only a single view welcome entry is displayed

Review checklist

Reminder for reviewers

@msujew msujew added navigator issues related to the navigator/explorer tree issues related to the tree (ex: tree widget) labels Jun 20, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes work well for me 👍

However, instead of adjusting the caller, should we not update the registration of view welcome so we do not register duplicate content? (I don't see a reason as to why we would want duplicates). I also believe vscode uses a Set for this reason.

@msujew msujew force-pushed the msujew/dispose-file-navigator-welcome branch from 321152d to 48e277b Compare June 20, 2022 12:29
@msujew
Copy link
Member Author

msujew commented Jun 20, 2022

@vince-fugnitto Thanks for the quick review. I agree, registering multiple elements with the same content should be prevented. I've created a commit for that.

But we should dispose of the created view welcome here anyway, since it creates entries in the viewClauseContexts, which should be deleted when the widget is disposed.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I confirm that it fixes the issue reported in #11283. The only difference in behavior is that vscode does not only check for content as duplicates but I think it should be fine.

@msujew msujew merged commit cf5cdf0 into master Jun 20, 2022
@msujew msujew deleted the msujew/dispose-file-navigator-welcome branch June 20, 2022 20:21
@github-actions github-actions bot added this to the 1.27.0 milestone Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
navigator issues related to the navigator/explorer tree issues related to the tree (ex: tree widget)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

too much viewWelcomeNodes
2 participants