none
Snippets stopped working

    Question

  • Every now and then, when trying insert a snippet, I get a message box pop up saying the operation could not be completed, and the snippet isn't inserted.

    It just happened again now, and the activity log shows the following error...

    System.OverflowException: Arithmetic operation resulted in an overflow. at Microsoft.VisualStudio.Editor.Implementation.Snippet.ExpansionFilter.GetClientData(IVsTextLineMarkerEx srpMarkerEx, ExpansionMarkerInfo& pInfo) at Microsoft.VisualStudio.Editor.Implementation.Snippet.ExpansionFilter.SetFieldSelection(Int32 pos, Boolean fUnselect, Boolean fChangeCaretPos) at Microsoft.VisualStudio.Editor.Implementation.Snippet.ExpansionFilter.SelectField(Int32 pos, Boolean fChangeCaretPos) at Microsoft.VisualStudio.Editor.Implementation.Snippet.ExpansionFilter.OnCaretChange() at Microsoft.VisualStudio.Editor.Implementation.Snippet.VsExpansionShim.OnCaretChange() at Microsoft.VisualStudio.Editor.Implementation.TextDocData.OnCaretChange() at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.Caret_PositionChanged(Object sender, CaretPositionChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)

    The Source column shows "Editor or Editor Extension"

    Doesn't seem to make any difference which snippet I'm trying to insert.

    Any ideas how I find out what caused the problem? Please don't suggest any testing as this is intermittent and life is just too short to try disabling extensions and waiting to see if the problem reoccurs. It hasn't happened for over a week now, so trying to isolate any one extension (if indeed it is an extension that's causing the problem) would be too painful for words!

    Thanks for any help you can give


    • Edited by Mr Yossu Thursday, January 12, 2017 4:31 PM
    Thursday, January 12, 2017 4:29 PM

Answers

  • Hello,

    Just started my machine for the week, and they are working fine, so it doesn't look lik it was anything to do with the cache, unless that is cleared automatically.

    Thanks for the reply. I'll keep an eye on it and see if it happens again.

    • Marked as answer by Mr Yossu Monday, January 16, 2017 3:05 PM
    Sunday, January 15, 2017 2:17 PM

All replies

  • Hi Mr Yossu,

    You might try the following suggestions which works for the similar issues caused by Intellisense:

     Delete Users\{yourusername}\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache.

    Or

     run devenv.exe /resetuserdata

    Then reopen VS after doing these above.

    Do you use VS 2015 update3 ?  As I tried the snippets in my side which works fine, could you please tell what kind of snippet you inserted? I’ll try it in my side if it’s possible.  

    If you’ve installed any extensions, you could give us the names and I will install them in my machine and test it.

     

    Best regards,

    Fletcher

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 13, 2017 9:12 AM
  • Hello,

    Just started my machine for the week, and they are working fine, so it doesn't look lik it was anything to do with the cache, unless that is cleared automatically.

    Thanks for the reply. I'll keep an eye on it and see if it happens again.

    • Marked as answer by Mr Yossu Monday, January 16, 2017 3:05 PM
    Sunday, January 15, 2017 2:17 PM
  • HiMr Yossu,

    Thanks for your friendly response.

    >>System.OverflowException: Arithmetic operation resulted in an overflow...

    >>Just started my machine for the week, and they are working fine.

    I met this kind of error which was related to the VS settings, solution/project file(.suo or .xxproj) or the web configuration file, but it is hard for me to make sure that what the real reason is in your VS Environment and it works well now.

    We often reset the VS settings, and then create a new blank solution, copy all projects files to the new blank solution, clean and build the project, check it again.

    In addition, as your said that it works well now, If possible, would you please mark your reply as the temporary answer? So we could also close this case for you. Of course, if it has this issue again, please feel free to unmark it, it will re-open this case. You can share the latest information here, I will follow up it in time. Thank you for your support and co-operation.

    Any VS IDE usage issue, welcome to this forum:)

    Sincerely,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 16, 2017 2:19 AM
    Moderator