question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Editing F# files is throwing an exception

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
laurentkempecommented, Dec 8, 2019

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

1reaction
BlueBaylisscommented, Dec 3, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

fstream EOF unexpectedly throwing exception - c++
I want exceptions thrown if the file can't be opened, but I don't want exceptions thrown on EOF. fstreams seem to give you...
Read more >
Editor scripts in Editor folder(s) are throwing missing ...
I attempted to make a test build of a framework I've been working on for a month now, and I was slapped in...
Read more >
error handling - Result object vs throwing exceptions
A module may indicate that an error occurred with a special return value or it throws an exception because an error was not...
Read more >
Creating and Throwing Exceptions
Learn about creating and throwing exceptions. Exceptions are used to indicate that an error has occurred while running a program.
Read more >
FileFormatException Class (System.IO)
The exception that is thrown when an input file or a data stream that is supposed to conform to a certain file format...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found