Skip to content

Feature request: Window synchronization #159

@sboulema

Description

@sboulema

CodeNav window doesn't stay up-to-date with the selected editor window. It only updates once the user does some sort of input into the editor window.

Image

Implementation details:

VS.Events.WindowEvents.ActiveFrameChanged += WindowEvents_ActiveFrameChanged;

---

private async Task WindowChangedEvent(ActiveFrameChangeEventArgs obj)
{
    if (obj.OldFrame == obj.NewFrame)
    {
        return;
    }

    var documentView = await obj.NewFrame.GetDocumentViewAsync();

    var filePath = documentView?.Document?.FilePath;

    ...

https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.interop.ivswindowframeevents?view=visualstudiosdk-2022

https://github.com/VsixCommunity/Community.VisualStudio.Toolkit/blob/master/src%2Ftoolkit%2FCommunity.VisualStudio.Toolkit.Shared%2FWindows%2FWindowEvents.cs#L20

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions