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

NullReferenceException on VS2017 15.6.0 #231

Closed
MarkSky opened this issue Mar 7, 2018 · 11 comments
Closed

NullReferenceException on VS2017 15.6.0 #231

MarkSky opened this issue Mar 7, 2018 · 11 comments
Assignees
Labels
Milestone

Comments

@MarkSky
Copy link

MarkSky commented Mar 7, 2018

Viasfora version: 3.8.157
VS 2017 Community version: 15.6.0

After updating VS2017 version to 15.6.0, when I typed in SCSS file, I got erros:

<entry>
    <record>2058</record>
    <time>2018/03/07 08:19:41.231</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.NullReferenceException: &#x4E26;&#x672A;&#x5C07;&#x7269;&#x4EF6;&#x53C3;&#x8003;&#x8A2D;&#x5B9A;&#x70BA;&#x7269;&#x4EF6;&#x7684;&#x57F7;&#x884C;&#x500B;&#x9AD4;&#x3002;&#x000D;&#x000A;   &#x65BC; Winterdom.Viasfora.Util.ToolTipWindow.TipTextViewModel.GetNearestPointInVisualSnapshot(SnapshotPoint editBufferPoint, ITextSnapshot targetVisualSnapshot, PointTrackingMode trackingMode)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.DoCompleteLayout(SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportHeight, Double&amp; referenceLine, Double&amp; distanceAboveReferenceLine, Double&amp; distanceBelowReferenceLine, Nullable`1 cancel)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.InnerPerformLayout(SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportWidth, Double effectiveViewportHeight, Boolean preserveViewportTop, Nullable`1 cancel)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot, SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportWidth, Double effectiveViewportHeight, Boolean preserveViewportTop, Nullable`1 cancel)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.AdvanceSnapshot(TextSnapshotChangedEventArgs e)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.AdvanceSnapshotOnUIThread(TextSnapshotChangedEventArgs e)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.OnVisualBufferChanged(Object sender, TextContentChangedEventArgs e)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
  </entry>
  <entry>
    <record>2059</record>
    <time>2018/03/07 08:19:41.240</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.NullReferenceException: &#x4E26;&#x672A;&#x5C07;&#x7269;&#x4EF6;&#x53C3;&#x8003;&#x8A2D;&#x5B9A;&#x70BA;&#x7269;&#x4EF6;&#x7684;&#x57F7;&#x884C;&#x500B;&#x9AD4;&#x3002;&#x000D;&#x000A;   &#x65BC; Winterdom.Viasfora.Util.ToolTipWindow.TipTextViewModel.GetNearestPointInVisualSnapshot(SnapshotPoint editBufferPoint, ITextSnapshot targetVisualSnapshot, PointTrackingMode trackingMode)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.OnClassificationChanged(Object sender, ClassificationChangedEventArgs e)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierAggregator.OnBatchedTagsChanged(Object sender, BatchedTagsChangedEventArgs e)&#x000D;&#x000A;   &#x65BC; Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
  </entry>
@tomasr
Copy link
Owner

tomasr commented Mar 7, 2018

Thanks for reporting, I'll try to take a look tonight!

@tomasr tomasr changed the title Editor or Editor Extension Error NullReferenceException on VS2017 15.6.0 Mar 8, 2018
@tomasr tomasr self-assigned this Mar 8, 2018
@tomasr tomasr added the bug label Mar 8, 2018
@tomasr tomasr added this to the v3.9 milestone Mar 8, 2018
@tomasr
Copy link
Owner

tomasr commented Mar 9, 2018

I haven't been able to reproduce this yet. It only happened for me the first time I launched VS, and now I can't seem to trigger it while under the debugger.

However, I did notice that the rainbow tooltip doesn't get properly updated. After it appears once (correctly), putting the mouse on top of a different brace causes the same (and now wrong) tooltip window to appear.

So far, I've tracked this to the IQuickInfoSession.Dismissed event not firing at all under 15.6, so the tooltip window doesn't get properly destroyed.

@tomasr
Copy link
Owner

tomasr commented Mar 10, 2018

I've added a workaround for the IQuickInfoSession.Dismissed issue. I have not been able to fully reproduce the original exception, but I suspect both are related.

Can either of your @MarkSky or @fdncred try the latest developer build and let me know if you still see the NullReferenceException happening?

@fdncred
Copy link

fdncred commented Mar 12, 2018

@tomasr Sure, I'll install it but where do I find the latest developer build?

@tomasr
Copy link
Owner

tomasr commented Mar 12, 2018

Sorry, @fdncred, you can find them here: https://ci.appveyor.com/project/tomasr/viasfora/build/artifacts

@fdncred
Copy link

fdncred commented Mar 12, 2018

@tomasr, Got it and installed it. So far, so good. I'll let you know if it pukes.

@fdncred
Copy link

fdncred commented Mar 14, 2018

@tomasr, I've seen the error twice now and both time it happened upon closing a solution. This is the latest error from my activity log.

System.NullReferenceException: Object reference not set to an instance of an  object. at
Winterdom.Viasfora.Util.ToolTipWindow.TipTextViewModel.GetNearestPointInVisualSnapshot(SnapshotPoint  editBufferPoint, ITextSnapshot targetVisualSnapshot, PointTrackingMode  trackingMode) at
Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.OnClassificationChanged(Object  sender, ClassificationChangedEventArgs e) at
Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierAggregator.OnBatchedTagsChanged(Object  sender, BatchedTagsChangedEventArgs e) at
Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object  sender, EventHandler`1 eventHandlers, TArgs args)
--

@tomasr
Copy link
Owner

tomasr commented Mar 14, 2018

Thanks! I'll investigate further tonight. I presume the fact that something is getting stuck in memory, probably caused by IQuickInfoSession.Dismissed not getting fired, so the tooltip window is not getting cleaned up before the solution unloads. I'll see what I can do about it.

tomasr added a commit that referenced this issue Mar 15, 2018
@tomasr
Copy link
Owner

tomasr commented Mar 15, 2018

OK, so made a few more changes which I think should fix that exception as well. Can you download the new build, @fdncred and give it another whirl? Thanks for all the help!

@fdncred
Copy link

fdncred commented Mar 15, 2018

@tomasr, installing now. Will let you know how it goes.

@tomasr
Copy link
Owner

tomasr commented Mar 19, 2018

Closing as I can't repro anymore. If it comes up again, feel free to add additional info as necessary and I'll reopen.

@tomasr tomasr closed this as completed Mar 19, 2018
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

3 participants