Error: Editing F# files is throwing an exception
See original GitHub issueVersions
- Git Diff Margin version: 3.10.1.191
- Visual Studio version: VS Professional 2019 v16.3.10
What happened
When editing an F# file I always get the gold exception bar saying “An exception of type ArgumentException has been encountered. This may be caused by an extension. [Open log file]”
Steps to Reproduce
Steps to reproduce the behavior:
- Open an F# solution using *.fs files
- Edit one of the *.fs files
- Exception is usually thrown within the first few key presses
- After dismissing the gold bar the plugin appears to continue working fine
- Disabling GitDiffMargin and restarting Visual Studio causes the issue to go away
Log extracts
System.ArgumentException: The specified SnapshotPoint or SnapshotSpan is on a different ITextSnapshot than this SnapshotSpan. at Microsoft.VisualStudio.Text.SnapshotSpan.EnsureSnapshot(ITextSnapshot requestedSnapshot) at Microsoft.VisualStudio.Text.SnapshotSpan.IntersectsWith(SnapshotSpan snapshotSpan) at GitDiffMargin.EditorDiffMargin.UpdateNormalDiffDimensions(DiffViewModel diffViewModel, HunkRangeInfo hunkRangeInfo) at GitDiffMargin.EditorDiffMargin.UpdateDiffDimensions(DiffViewModel diffViewModel, HunkRangeInfo hunkRangeInfo) at GitDiffMargin.ViewModel.DiffViewModel.UpdateDimensions() at GitDiffMargin.ViewModel.EditorDiffViewModel.UpdateDimensions() at GitDiffMargin.ViewModel.DiffMarginViewModelBase.RefreshDiffViewModelPositions() at GitDiffMargin.DiffMarginBase.OnLayoutChanged(Object sender, TextViewLayoutChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args) — End of stack trace from previous location where exception was thrown — at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
System.ArgumentException: The supplied SnapshotPoint is on an incorrect snapshot. Parameter name: bufferPosition at Microsoft.VisualStudio.Text.OverviewMargin.Implementation.DefaultScrollMap.TranslatePosition(SnapshotPoint bufferPosition) at Microsoft.VisualStudio.Text.OverviewMargin.Implementation.DefaultScrollMap.GetCoordinateAtBufferPosition(SnapshotPoint bufferPosition) at Microsoft.VisualStudio.Text.OverviewMargin.Implementation.SideBySideScrollMap.GetCoordinateAtBufferPosition(SnapshotPoint bufferPosition) at Microsoft.VisualStudio.Text.OverviewMargin.Implementation.ScrollMapWrapper.GetCoordinateAtBufferPosition(SnapshotPoint bufferPosition) at GitDiffMargin.ScrollDiffMargin.UpdateDiffDimensions(DiffViewModel diffViewModel, HunkRangeInfo hunkRangeInfo) at GitDiffMargin.ViewModel.DiffViewModel.UpdateDimensions() at GitDiffMargin.ViewModel.DiffMarginViewModelBase.RefreshDiffViewModelPositions() at GitDiffMargin.DiffMarginBase.OnLayoutChanged(Object sender, TextViewLayoutChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args) — End of stack trace from previous location where exception was thrown — at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Additional context
This seems related to issue #83
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks for the great bug report 👍 I can reproduce the issue and without your hint about CodeLens I think I wouldn’t have found it! I am on it now
While playing with the settings I found that disabling CodeLens for F# stops the error from happening.