Open KirillOsenkov opened 3 months ago
@CyrusNajmabadi should be an easy fix
@KirillOsenkov def feel free to contribute :D
@CyrusNajmabadi here you go: https://github.com/dotnet/roslyn/pull/74645
Oops, this was closed by accident. The PR is still outstanding.
ArgumentException: The specified SnapshotPoint is on a different ITextSnapshot than this SnapshotPoint.
https://github.com/dotnet/roslyn/blob/52e29db514078c9f1bcf6d4c01a106d69f95d63b/src/EditorFeatures/Core/Organizing/OrganizeDocumentCommandHandler.cs#L128
This is because this code grabs the
caretPoint
from thesubjectBuffer
, which is C#, but then callstextView.GetTextElementSpan(caretPoint.Value)
which expects a point in the top (projection) buffer.It needs to also grab a caretPoint from the top buffer, and use that for the indicatorFactory, because that expects a span on the top (projection) buffer, not the subject buffer.