Viladoman / CompileScore

Tools for profiling and visualizing C++ build times.
MIT License
460 stars 19 forks source link

Extension crashes after changing a solution configuration #49

Open neversleeping opened 1 year ago

neversleeping commented 1 year ago

I'm using VS2022. Extension version: 1.8.4. When I'm opening a solution extension crashes with error in ActivityLog:

SetSite failed for package [CompileScorePackage]Source: 'Microsoft.VisualStudio.Text.Data' Description: Specified argument was out of the range of valid values. Parameter name: length System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: length at Microsoft.VisualStudio.Text.Span..ctor(Int32 start, Int32 length) at CompileScore.ScoreGlyphTagger.RefreshTags() at CompileScore.Notify.Invoke() at CompileScore.CompilerData.TryNotifyDataChanged() at CompileScore.CompilerData.OnSolutionSettingsChanged() at CompileScore.CompilerData.OnEditorModeChanged() at CompileScore.Notify.Invoke() at CompileScore.EditorContext.SetMode(EditorMode input) at CompileScore.EditorContext.CheckAlreadyOpenedContext() at CompileScore.CompileScorePackage.<InitializeAsync>d3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Shell.AsyncPackage.<>cDisplayClass21_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)

At first, I thought that I was due to deleting a platform but crash acts very strangely and now I have no idea why can it be. I'm creating a new empty solution - it works. But when I'm starting to add file or change number of configurations/platforms, it can start crashing.

Viladoman commented 1 year ago

Oh wow! It looks like there is something odd going on with the Visual studio glyph tagger refreshing its tags. I will have a look and see if I can reproduce it myself following the same steps.

Does it crash when adding the new file? or after adding the new file and then closing and starting again Visual Studio?

As a temporary fix, does it still happen if you disable all the in-text helpers from CompileScore?

Tools->Options --> Compile Score -> Display -> Text Highlight ----- Disabled