dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.04k stars 4.03k forks source link

ArgumentNullException in C# Interactive #36572

Closed yyjdelete closed 2 weeks ago

yyjdelete commented 5 years ago

Version Used: Microsoft (R) Visual C# Interactive Compiler version 3.2.0-beta2-19303-01 () VS2019 16.2.0 Preview 2.0

Steps to Reproduce:

  1. Open C# Interactive in VS2019
  2. Press the below code: new int[0] { }
  3. Press an Enter after the ]

Expected Behavior: No Error happen

Actual Behavior: Gold bar with the below stacktrace(only show once before restart)

System.ArgumentNullException: Value cannot be null. Parameter name: point

 at Microsoft.VisualStudio.Text.Projection.Implementation.BufferGraph.CheckedMapUpToBuffer(SnapshotPoint point, PointTrackingMode trackingMode, Predicate`1 match, PositionAffinity affinity)
 at Microsoft.VisualStudio.Text.Projection.Implementation.BufferGraph.MapUpToBuffer(SnapshotPoint point, PointTrackingMode trackingMode, PositionAffinity affinity, ITextBuffer targetBuffer)
 at Microsoft.VisualStudio.Text.Projection.Implementation.BufferGraph.MapUpToSnapshot(SnapshotPoint position, PointTrackingMode trackingMode, PositionAffinity affinity, ITextSnapshot targetSnapshot)
 at Microsoft.CodeAnalysis.Editor.Implementation.Formatting.Indentation.AbstractSmartTokenFormatterCommandHandler.CanHandleOurselves(ITextView view, ITextBuffer subjectBuffer)
 at Microsoft.CodeAnalysis.Editor.Implementation.Formatting.Indentation.AbstractSmartTokenFormatterCommandHandler.ExecuteCommandWorker(ReturnKeyCommandArgs args, CancellationToken cancellationToken)
 at Microsoft.CodeAnalysis.Editor.Implementation.Formatting.Indentation.AbstractSmartTokenFormatterCommandHandler.ExecuteCommand(ReturnKeyCommandArgs args, Action nextHandler, CommandExecutionContext context)
 at Microsoft.VisualStudio.Commanding.CommandHandlerExtensions.ExecuteCommand[T](ICommandHandler commandHandler, T args, Action nextCommandHandler, CommandExecutionContext executionContext)
 at Microsoft.VisualStudio.UI.Text.Commanding.Implementation.EditorCommandHandlerService.<>c__DisplayClass13_1`1.<Execute>b__1()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call, Predicate`1 exceptionFilter)
  --- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
jinujoseph commented 5 years ago

cc @tmat

tmat commented 5 years ago

I can repro in VS2017 as well, so seems like a bug that has been there for a while.

CyrusNajmabadi commented 2 weeks ago

Closing out due to lack of prism hits.