Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Editing F# files is throwing an exception #281

Open
BlueBayliss opened this issue Dec 2, 2019 · 5 comments
Open

Error: Editing F# files is throwing an exception #281

BlueBayliss opened this issue Dec 2, 2019 · 5 comments
Labels

Comments

@BlueBayliss
Copy link

Versions

  • 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:

  1. Open an F# solution using *.fs files
  2. Edit one of the *.fs files
  3. Exception is usually thrown within the first few key presses
  4. After dismissing the gold bar the plugin appears to continue working fine
  5. 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)

ActivityLog.txt

Additional context

This seems related to issue #83

@BlueBayliss BlueBayliss added the bug label Dec 2, 2019
@laurentkempe
Copy link
Owner

Thanks for reporting this @BlueBayliss I will have a look as soon as possible!

@laurentkempe laurentkempe pinned this issue Dec 3, 2019
@BlueBayliss
Copy link
Author

Thank you for looking into this.
I did forget to mention one thing: The log above was from pushing the space bar once. Although the plugin seems to work fine after dismissing the gold bar error, the log continues to fill up with those 2 errors repeating when I'm actually working on something.

@BlueBayliss
Copy link
Author

While playing with the settings I found that disabling CodeLens for F# stops the error from happening.

@laurentkempe
Copy link
Owner

While playing with the settings I found that disabling CodeLens for F# stops the error from happening.

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

@laurentkempe
Copy link
Owner

Hey @sharwell any clue why this line would fail in case of F#? I reproduced the issue with a simple F# console app!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants