ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Adds option to use ST 3 new tooltips #61

Closed subhaze closed 9 years ago

subhaze commented 9 years ago

Adds tooltip support for ST 3, if a URL or doc is available, it shows that as well.

As of right now this will only work on the very latest ST 3 dev build (3070)

screenshot 2015-02-17 11 33 38

screenshot 2015-02-17 11 33 58

marijnh commented 9 years ago

Can we feature-detect tooltip support by checking whether show_popup exists in view, and make that the default if supported?

subhaze commented 9 years ago

@marijnh Sure, I'll update the patch in a bit.

lukasbob commented 9 years ago

Played around with this and it looks great! Might need better handling of long URLs, though. These cause the content to expand so it overflows the 600px width of the tooltip, obscuring some of the content. The screenshot below shows this:

image

marijnh commented 9 years ago

I wasn't able to test this myself yet, since I don't have a Sublime Text key, but the code looks good, and I've merged it. I made a small change in 1afc929. Please verify that that also works on ST3.

subhaze commented 9 years ago

@lukasbob OS X has the ability to scroll to the overflow, however, I've seen reports to the ST developer where it's not possible on other platforms. Future updates to ST 3 should resolve this.

@marijnh I've added a comment to that code change.