Fix VisualStudioActiveDocumentTracker to handle frames without text b…#58049
Fix VisualStudioActiveDocumentTracker to handle frames without text b…#58049mavasani merged 2 commits intodotnet:mainfrom
Conversation
…uffer There are cases where we get multiple `IVsSelectionEvents.OnElementValueChanged` callbacks for the same frame, some of which do not have `__VSFPROPID.VSFPROPID_DocData` leading to null text buffer. This leads to `TryGetActiveDocument` to return null even when we have an active frame.
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioActiveDocumentTracker.cs
Show resolved
Hide resolved
| } | ||
| else if (existingFrame.TextBuffer == null) | ||
| { | ||
| // If no text buffer is associated with existing frame, remove the existing frame and add the new one. |
There was a problem hiding this comment.
Is this because there's some more async buffer creation now, and we're just looking for a text buffer too early?
There was a problem hiding this comment.
I am honestly not sure, but we do get multiple callbacks where sometimes getting the DocData property succeeds and sometimes it doesn't. If you'd like, I can create a separate issue for someone more familiar with this space (probably you?) to debug through this.
There was a problem hiding this comment.
OK to merge this, but I'd say reach out to the extensibility discussion internal list and see what they have to say.
|
@jasonmalinowski Any further feedback? |
|
@dotnet/roslyn-infrastructure Is |
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
…uffer
There are cases where we get multiple
IVsSelectionEvents.OnElementValueChangedcallbacks for the same frame, some of which do not have__VSFPROPID.VSFPROPID_DocDataleading to null text buffer. This leads toTryGetActiveDocumentto return null even when we have an active frame. We now handle this case and ensure we swap a visible frame without text buffer when possible.Related fix done last month: #57206