Skip to content

Find existing PM UI windows by editor type - #7568

Merged
zivkan merged 1 commit into
devfrom
dev-zivkan-avoid-lazy-docview
Jul 17, 2026
Merged

zivkan merged 1 commit into
devfrom
dev-zivkan-avoid-lazy-docview

Conversation

@zivkan

@zivkan zivkan commented Jul 16, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14995

Description

The existing code was enumerating all open windows, getting the doc view, and then checking if the type is NuGet's own PM UI view model. However, when the tab's docview is not yet loaded, it forces it to load, needlessly and violating the intent of lazy loaded tabs.

This switches to a different API where VS's UI shell already has an API to get the window for a specific document path of a specific editor type. So, by using this API and passing NuGet's editor GUID, NuGet no longer needs to enumerate the windows at all.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests no behavior change, just a refactoring/perf improvement. I did some manual testing, and Apex tests also test PM UI.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@zivkan
zivkan requested a review from a team as a code owner July 16, 2026 10:13
@zivkan
zivkan requested review from martinrrm and nkolev92 July 16, 2026 10:13

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume you've confirmed both of these work through testing.

Seems fine to me.

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.

Don't cause VS tabs to load when opening PM UI

4 participants