locked
Tooltip with QuickInfoSession with a UserControl instead of a String RRS feed

  • Question

  • I'm trying to add a tooltip to this extension with the following functionality: When you hover the mouse over a keyword, eg, the instruction bsf, a tooltip appears with buttons in it (that start Z3 to prove what the bit values are of registers). Thus, instead of adding a string to quickInfoContent, I add a UserControl; see code below: 

    internal sealed class QuickInfoSource : IQuickInfoSource { private readonly ITextBuffer _sourceBuffer; public AsmQuickInfoSource(ITextBuffer buffer) { this._sourceBuffer = buffer; } public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan) { var snapshot = this._sourceBuffer.CurrentSnapshot; var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(snapshot); applicableToSpan = snapshot.CreateTrackingSpan(new SnapshotSpan(triggerPoint, triggerPoint), SpanTrackingMode.EdgeInclusive); quickInfoContent.Add(new BugWindow()); } }

    In the following picture you can see the tooltip with the buttons eg. Determine CX.


    I've asked this question before, for more details see here and here, but no answer.

    Question: This code worked 80% of the time in VS 2017 15.6, in 20% of the time when you would click a button, the QuickInfoSession would be dismissed prematurely. In VS 2017 15.7 the QuickInfoSession would be dismissed almost always prematurely. How to get a button working in quickInfoContent in 15.7.

    I'm trying to make a great and free extension to turn VS into the best assembly editor. If you do not know how answer this please consider one of the developers on the VS team, they may be in for some AI theorem proving and assembly.

    See this Github repo with the code: here

    Regards HJ




    Thursday, June 7, 2018 3:14 PM