haacked / Encourage

A bit of encouragment added to Visual Studio
75 stars 32 forks source link

What's the right way to do this? #1

Closed haacked closed 10 years ago

haacked commented 10 years ago

Hey @jaredpar, I hope you don't mind another VS question. I'm trying to write a stupid silly extension that will show a tool tip wherever the cursor is when you save your document.

Seems pretty simple, eh?

I thought I'd try to leverage the QuickInfo stuff because it provides the right tooltip behavior. But I can't seem to trigger it programmatically on save. Also, it seems intrinsically tied to mouse hover.

Am I going about this totally wrong? Got any suggestions for how I should be doing this?

jaredpar commented 10 years ago

Don't mind at all. Let me take a look.

jaredpar commented 10 years ago

Quick Info is pretty much tied to mouse hover. It sounds like you want the tool tip to display immediately in which case Signature Help is a better option. I created a demo branch that converted your sample to use signature help in place of quick info

https://github.com/Haacked/Encourage/tree/demo-signature-help

I'm in a bit of a time crunch so this was done in a pretty sloppy fashion. Given more time I would have done proper rename of times to SignatureHelp vs. QuickInfo. But as is it serves as a nice demo.

Although I think you may want to consider a text adornment here instead of signature help. Text adornments allow you to just basically throw up a WPF control anywhere on the screen at pretty much any time you want. It seems like this is closer to the experience you want here. This for example is how I draw the block caret in VsVim

https://github.com/jaredpar/VsVim/tree/master/Src/VimWpf/Implementation/BlockCaret

haacked commented 10 years ago

BTW, I want change the license to MIT. May I have your contribution under that license?

jaredpar commented 10 years ago

That's definitely fine.