Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Package: Is it possible to show tooltips on text line markers?

Implementing "squiggle" text line markers in JSLint.NET was quite straight forward as can be seen here:

squiggles

However, despite implementing IVsTextMarkerClient with the GetTipText method, tooltips are never shown. The GetTipText method is never even invoked when the mouse hovers over the marker.

If I switch to a glyph type (for example MARKERTYPE.MARKER_SHORTCUT), tooltips show just fine in the margin:

glyph

Is there some trick to getting tooltips to show on the body of an inline text marker?

Implementation source code is available here in the SetMarker method:

https://jslintnet.codeplex.com/SourceControl/changeset/view/f27a513c14bbfbf787ddb66485ae6c4404dc8352#source/JSLintNet.VS2012/JSLintErrorTask.cs

like image 388
Qube Avatar asked Dec 05 '25 10:12

Qube


1 Answers

It turns out that the answer (to "is it possible?") is no when using the old IVsTextMarkerClient and IVsTextLines implementations.

It can be achieved by implementing the newer ITag / ITagger / ITaggerProvider interfaces instead. My current prototype looks like this:

squiggle with tips

Source code available here:

https://jslintnet.codeplex.com/SourceControl/changeset/view/077d348a1fdf819ce13ceb984bae8000ce76a63d#source/JSLintNet.VS2012/Errors/JSLintTagger.cs

Hope it helps someone else!

like image 158
Qube Avatar answered Dec 07 '25 14:12

Qube



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!