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

Java​Script Completions

by pichillilorenzo ST2/ST3 Top 100

JavaScript Completions for sublime text. It helps you to write your scripts more quickly with hints and completions.

Details

Installs

  • Total 178K
  • Win 109K
  • OS X 40K
  • Linux 30K
Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4
Windows 27 264 298 173 151 243 264 283 263 284 191 153 214 257 267 287 188 116 109 176 208 234 250 213 131 196 192 242 215 252 238 148 163 232 258 258 279 258 173 216 273 259 259 265 206 158
OS X 8 79 67 42 61 80 106 82 73 69 45 62 85 89 89 93 67 40 59 70 62 77 49 66 42 58 56 77 81 106 85 47 64 93 96 93 87 118 92 86 167 63 62 83 31 45
Linux 8 36 56 37 43 50 48 53 55 53 41 34 56 46 64 55 49 30 35 49 49 41 52 52 33 37 44 51 48 67 55 48 37 62 63 74 61 47 52 49 51 46 48 45 41 44

Readme

Source
raw.​githubusercontent.​com

JavaScript Completions

JavaScript Completions for sublime text

It helps you to write your scripts more quickly with hints and completions.

jQuery and NativeScript completions disabled by default! You can enable them on Preferences -> Package Settings -> JavaScript Completions.

Some features could use npm!

In Windows you must install it! Download it from https://nodejs.org.

To OSX and Linux, it will be downloaded automatically with nodejs.

Features list: - “Find JavaScript Description” Feature - “On Hover Description” Feature - “Evaluate JavaScript” Feature - “Can I use?” Feature - “JSDoc” Feature - Context menu options

Usage

To try it, just write.

Examples:

example #1 of JavaScript Completions

example #2 of JavaScript Completions

description-Name_of_function/property/method shows to you the explanation of the function/property/method and its syntax.

Information about the description of function/property/method has been taken on this sites:

ENABLE or DISABLE completions

You can ENABLE or DISABLE completions! Just go to Preferences -> Package Settings -> JavaScript Completions

“Find JavaScript Description” Feature

Supported only by Sublime Text 3

key-map of this feature disabled by default!

You can check the description of function/property/method by selecting the word (or, in case, it will take the first word near the blinking cursor) you want find. “right-click” on your mouse and click on “Find JavaScript Description”.

It will show a popup with the list of possible descriptions or, in some case, the direct description.

In case, you can also use “key-map”! Just go to Preferences -> Package Settings -> JavaScript Completions and enable it.

“On Hover Description” Feature

Supported only by Sublime Text 3, Build >= 3124

Just put the cursor over a name of a function, property or constructor and it will appear a little popup with all matching found from the /sublime-completions list enabled.

  • F = function
  • P = property
  • C = constructor

Example:

example #1 On Hover Description Feature

“Evaluate JavaScript” Feature

Supported only by Sublime Text 3

This feature uses node.js (v6.6.0) executable.

You can change the node version on Preferences -> Package Settings -> Evaluate JavaScript settings

It will download automaticaly the binary for your OS.

A message will appear on the “status bar” of Sublime Text.

context menu option of this feature disabled by default!

key-map of this feature disabled by default!

You can evaluate the entire text selection or the current line! If you select a text region and evaluate it, in the gutter of the editor will appear 2 white dots. The first white dot represents the start of the region and the second white dot represents the end of the region. You can eventually modify the region and, without reselect the same region, you can evaluate it again! If you want hide this 2 dots, there is an entry on the context menu “Evaluate JavaScript”.

When you evaluate code, this plugin will prepend "use strict"; automaticaly!

There are two main mode to evaluate code: - eval - print

To enable this feature on context menu, go to Preferences -> Package Settings -> Evaluate JavaScript and enable it.

In case, you can also use “key-map”! Just go to Preferences -> Package Settings -> Evaluate JavaScript and enable it.

“Can I use?” Feature

Supported only by Sublime Text 3, Build >= 3124

This feature uses “can i use” json data from this repository, that contains raw data from the http://caniuse.com support tables.

Thanks to @Fyrd.

You can use this feature in HTML, CSS and JavaScript context!

Just put the cursor on the word you want to check, “right-click” -> "Can I use?" and it will appear an input panel with all items that have a name matching with the word.

You can use key-map: ctrl+alt+w. You can also change it. Just go to Preferences -> Package Settings -> JavaScript Completions Tools -> Key Bindings - User.

After selecting an item from the list, it will appear a popup with all information from the http://caniuse.com support tables.

You can also use the menu JavaScript Completions Tools on the top and select Search on "Can I use" list to search what you want.

Example :

example #1 Can I use? Feature

example #2 Can I use? Feature

example #3 Can I use? Feature

“JSDoc” Feature

Supported only by Sublime Text 3

Requires npm

This feature uses https://github.com/jsdoc3/jsdoc to generate API documentation.

You can find it under "JavaScript Completions Tools" menu -> JSDoc.

There are 2 main menu items: - Generate Documentation - Add jsdoc-settings.json to the current project folder

These items can be used only with a project folder opened.

"Generate Documentation" uses the jsdoc command line to generate documentation.

It uses jsdoc-settings.json file for configuration or, alternately, it will use default configuration.

The options (with default values) availables are:

{
  "jsdoc_conf_file": "conf.json",
  "destination_folder": "out",
  "display_symbols_access_property": "all",
  "search_within_subdirectories": false,
  "encoding_when_reading_all_source_files": "utf-8",
  "template_path": "",
  "tutorials_path": "",
  "include_symbols_marked_with_the_private_tag": false,
  "pedantic_mode": false,
  "query_string_to_parse_and_store_in_global_variable": ""
}

"Add jsdoc-settings.json to the current project folder" will add a jsdoc-settings.json file with default values to the current project folder.

How to use JSDoc: http://usejsdoc.org/

Context menu options

Context menu options: - Surround With - Delete Surrounded - Create Class from object literal - Sort array - Split string lines to variable

Surround With

You MUST first select text to “enable” these options.

You can surround code with: - if statement - if else statement (this works only if you selected 2 regions, see example) - while statement - do while statement - for statement - try catch statement - try catch finally statement - Multi-line comment - Single-line comment

This option works also on multiple selections at once.

Delete Surrounded

Options are: - Delete multi-line comment - Delete single-line comment - Strip quoted string

This option works also on multiple selections at once.

Create Class from object literal

This option create a JavaScript Class from an object literal (Constructor with all setter and getter for each field).

You can set default values or use the string "required" to say that a field hasn't a default value.

To work properly, you MUST declare a variable and assign an object literal to it, like this example:

var Person = {
  name: "required",
  surname: "required",
  email: "",
  age: 18
}

This option works also on multiple selections at once.

Sort array

Just put the cursor between brackets and will appear a menu with these options: - Sort array ASC ( compare function: function(x,y){return x-y;} ) - Sort array DESC ( compare function: function(x,y){return y-x;} ) - Sort array alphabetically ASC - Sort array alphabetically DESC

This option works also on multiple selections at once.

Examples of usage:

example #1 Other Context menu option

example #2 Other Context menu option

Split string lines to variable

Just put the cursor between a string with multiple lines and this option will appear in the context menu.

It will split the string and for each line will be concatenated to a variable named “str”.

This option works also on multiple selections at once.

Example:

example #1 Split string lines to variable

MIT License