ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Tool​Tip-Helper

by dooble ST2/ST3

Sublime Tooltip

Details

Installs

  • Total 1K
  • Win 813
  • OS X 234
  • Linux 220
Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7
Windows 0 0 1 0 0 0 0 2 2 1 0 1 1 0 3 0 4 0 0 0 0 3 0 0 2 0 0 0 2 1 0 2 0 0 0 1 1 0 1 1 0 0 2 0 1 1
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1
Linux 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 1 0 0 1

Readme

Source
raw.​githubusercontent.​com

ToolTip-Helper

Author: Idan Avitan

Credit to: Dooble

This plugin shows tooltip under the cursor or on mouse hover when on function name in sublime text 3. Works on every language (include custom languages).

Features

  • Comes with documentation for HTML, CSS and Sublime API (Python).
  • Write your own documentation above function definition.
  • Define more than one documentation file to the same language scope.
  • Tooltip window change his color accord to the current theme in sublime.
  • Determine the order of the attributes in tooltip window.
  • Control on settings like: window size, timeout, debug mode.
  • Go to documentation definition.
  • Go to documentation website.
  • CSS control from the settings file.

Built-in Doc

Dynamic Doc

How does it work?

There are two ways to create documentation: Built-in files & Dynamic doc.

For Built-in files:

  • Make sure you have in packages ToolTipHelper\db folder.
  • Create languageName.sublime-tooltip (JSON file) in this folder.
  • Declare on this file in settings with his scope name

Once you create languageName.sublime-tooltip and declare on him, the tooltip knows to search for documentation and take the data from there and shows popup window. This file contain every attribute name that you want show up in the tooltip window. For example attributes names for function can be: method name, parameters, description and return value.

NOTE: JSON file needs to be clean from some characters that can cause him to error. You can use this site to check if your file is valid.

Here is example of sublime API documentation:

Some important things about file format:

For Dynamic doc:

  • Choose a function.
  • Write doc tag streight above the function.
  • Add some attributes between the tag when each key and value separated by a colon.

Note: in case we have more than one documentation for function name, a quick panel will open with list of results. Each result show with row number and name of the file, when chosing result the tooltip window get opened. You can run the tooltip again and the last result you pick up will be highlighted.

Setup

Make sure you have Package Control before continue (you can still download ZIP of the project from GitHub if you don't want to install package control, but its not recommended).

To add the ToolTip Helper Package to Sublime, you first need to add a new repository to your package manager. To do so, while in sublime, open the Command Palette. To open the palette, press ctrl+shift+p (Win, Linux) or cmd+shift+p (OS X). There, you should search “Add Repository”:

After that, you need paste this link: https://github.com/doobleweb/ToolTip-Helper.git and press enter.

Once the repository added you need to install the package. To do so open again palette (ctrl+shift+p) and search “Install Package” and press enter.

NOTE: It is recommended to re-open sublime text after the installation finished.

Make sure you have folder named ToolTip-Helper\db in packages (Preferences>>Browse packages). This folder must contain languageName.sublime-tooltip files. See also default settings file ToolTipHelper.sublime-settings. You can find this file in ToolTip-Helper folder or go to the menu Preferences>>tooltip helper>>settings - default.

As you can see this file contain array of documentaiton files for each language. Every item must include scope and file_name like in the img.

  • Scope - the scope name must be valid otherwise it won’t work. If you don’t know how write a valid scope you can see the scopes.txt file in git project or press ctrl+alt+shift+p in sublime text (you see the scope name in the status bar).
  • File Name - include the languageName.sublime-tooltip file name. This array of files is the way of the tooltip to know if search this files in “ToolTipHelper\db” folder.
  • Link - you can write link to documentation site for another information (The link is optional).

NOTE: There are two places you can put links: in the settings file or\and in the json file as “link” attribute. The tooltip will choose the most “inner” link if there is one.

To override the default settings You can open file in packages\user\ToolTipHelper.sublime-settings or go to the menu Preferences>>tooltip helper>>settings - user.

Enter data via user interface

If you create languageName.sublime-tooltip in the db folder and you want shortcut to declare him, use this way.

To run this command you have 3 ways: - Open the palette, press ctrl+shift+p and choose 'Tooltip helper insert data to settings'. - Preferences>>tooltip helper>>enter data. - Ctrl+7.

In case you dont want give a link, just press on enter.

Currently, the plugin works with F1 or command pallete. If you want to change it, go to Preferences>>key bindings-user.

Future Goals:

  • Go To Documentation in built-in files.