[ZeroBrane Studio] Re: Change the tooltip formatting via interpreter? How to distribute interpreter & api?

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: "zerobrane@xxxxxxxxxxxxx" <zerobrane@xxxxxxxxxxxxx>
  • Date: Fri, 17 Oct 2014 12:40:58 -0700

Hi Jan,

> Sorry if that comes across a bit harsh, but IMO the quality of the tooltips 
> (which is "meh") is in stark contrast to the quality of the rest of ZBS 
> (which is "hooray!"). We plan to use ZBS as our "official" IDE for devs and 
> modders once the game is released as we love the feature set. But especially 
> for modders, we would really love to have a more capable tooltip.

I agree, I'd prefer that as well, but in this case I have to deal with
the limitations of the components I'm using.

One option you may consider is to have a separate "documentation"
panel that uses the editor component to display the API documentation.
In this case you'd have full control over the content and the
formatting. I'd need to add a method (for example, onEditorCallTip),
which would give you the token that calltip is generated for and the
auto-complete text itself; you'd then show it in the "documentation"
panel (and suppress the "default" tooltip). It gets a bit trickier for
tooltips shown for expressions during debugging and things like that,
but I think the current implementation is find for those cases.

Another option is to provide only some documentation in the IDE and
have more complete documentation available online and then reference
it using context menu as is done in Show Lua Reference plugin
(https://github.com/pkulchenko/ZeroBranePackage/blob/master/showluareference.lua)
or in more general Show Reference plugin
(https://github.com/pkulchenko/ZeroBranePackage/blob/master/showreference.lua).

> That sounds good. Is the folder structure inside ~/.zbstudio/ the same as in 
> the "normal" program folder, so the api has to go to ".zbstudio/api/lua", 
> etc.?

No; you'd package both the interpreter and the api descriptions into
one plugin, which you'd then put into ~/.zbstudio/packages/ folder.
You'll find examples on the plugin documentation page I referenced
earlier. Here is the plugin for Urho3d, which does something very
similar: https://github.com/pkulchenko/ZeroBranePackage/blob/master/urho3d.lua

Paul.

Other related posts: