spectacles / CodeComplice

CodeIntel for Sublime Text 2 / 3
Other
167 stars 18 forks source link

Add support for HTML popups #29

Closed rmccue closed 9 years ago

rmccue commented 9 years ago

:sparkles: :fireworks:

This adds support for the new HTML-style popups (as per #18). I'm not sure if you want to change the default here, so I haven't included that in this patch, but happy to do so.

The approach here is based partially on Tern (marijnh/tern_for_sublime#61), as well as shamelessly stealing @jbrooksuk's CSS from Intellitip (with credit in the README). Screenshots below.

Default styling: screenshot 2015-03-12 11 49 11

Dark theme: screenshot 2015-03-12 11 49 58

Light theme: screenshot 2015-03-12 11 50 22

Happy to further improve this as needed!

One thing in particular is that it loads in the CSS file every time it renders the tooltip. I haven't noticed any issues with this so far, due to the multithreading, but it could potentially be improved. This does have the advantage that you can live-edit your CSS though.

:shipit:

rmccue commented 9 years ago

Sidenote: What I'd like to do here actually is remove the preference altogether and only use the HTML approach instead. This would let us do a bit nicer parsing with the stuff we get back from CodeIntel, and would likely clean up the code a bit.

What I'd like to do down the track is add phpDoc parsing (and similar for other languages, as needed) with the ability to jump-to-definition straight from the popup, along with better styling on the prototype itself. These aren't really possible right now, since the text generator has to generate text suitable for the status line as well.

This is all stuff I'll add in separate PRs when I get to them though. :)

spectacles commented 9 years ago

props for the effort. I'll just merge this and hopefully you will get some feedback!

jbrooksuk commented 9 years ago

:+1: nice!

rmccue commented 9 years ago

@spectacles Any thoughts here regarding coupling the display a little more closely so we can get better views? I can structure it so it's still possible to use the other styles if you'd prefer, but either way will mean rewriting a bit of code.

spectacles commented 9 years ago

Since this tooltip is not available for everybody, it's a necessity to keep support for the old tooltips! Also your solution doesn't offer a possibility to auto-insert function arguments on TAB, a feature that has been requested a lot in the past.

rmccue commented 9 years ago

Since this tooltip is not available for everybody, it's a necessity to keep support for the old tooltips!

Thought so, I'll see what I can come up with :)

Also your solution doesn't offer a possibility to auto-insert function arguments on TAB, a feature that has been requested a lot in the past.

Yeah, that's on my todo list as well. :)