Skip to content

Autocompletion in editors and IDEs

Pablo Klaschka edited this page Aug 9, 2018 · 4 revisions

Here, information regarding the usage of the type definitions for autocompletion in editors and IDEs is listed:

First steps

  1. Copy the types folder as well as the jsconfig.json file into your plugin's folder (e.g. com.xd.sample)
  2. Take a look at the sample.js file and copy the JSDoc section
/**
  * @param {Selection} selection
  */

and paste it in front of your functions to get autocompletion for the selection (passed as an argument to this function)

  1. Follow the editor-specific instructions matching you editor or IDE of choice below:

Editor-/ IDE-specific instructions

Please note: Since these Typescript definitions are still under development, we didn't have time to test them with a lot of editors and IDEs. If you find a way to use them with an editor (or IDE) not listed below, please feel free to open an issue explaining how to use them with this editor so we can incorporate the instructions here.

Visual Studio Code

(tested in version 1.25.1)

Since Visual Studio Code supports the jsconfig.json file, autocompletion should already be working.

Jetbrains WebStorm

(tested in version 2018.2)

To get autocompletion to work in WebStorm, you need to complete the following additional steps:

  1. Mark the types-folder as Resource Root (right-click types => Mark Directory as => Resource Root)
  2. To make sure the HTML-DOM completion is active (which is relevant since the Development Build #4 introducing UI functionality), open the Preferences, go to Languages and Frameworks => JavaScript => Libraries and uncheck all checkboxes except HTML and click Apply.

Now, everything should be ready and the autocompletion features should be working.

Clone this wiki locally