-
Notifications
You must be signed in to change notification settings - Fork 8
Autocompletion in editors and IDEs
Here, information regarding the usage of the type definitions for autocompletion in editors and IDEs is listed:
- Copy the
types
folder as well as the.jsconfig
file into your plugin's folder (e.g.com.xd.sample
) - 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)
- Follow the editor-specific instructions matching you editor or IDE of choice below:
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.
(tested in version 1.25.1)
Since Visual Studio Code supports the .jsconfig
file, autocompletion should already be working.
(tested in version 2018.2)
To get autocompletion to work in WebStorm, you need to complete the following additional steps:
- Mark the
types
-folder as Resource Root (right-clicktypes
=>Mark Directory as
=>Resource Root
) - To disable all the HTML-DOM completion (basically all the things you don't need for XD plugins), open the
Preferences
, go toLanguages and Frameworks
=>JavaScript
=>Libraries
and uncheck all checkboxes (i.e. in most casesHTML
) and clickApply
Now, everything should be ready and the autocompletion features should be working.
"Everything should be made as simple as possible, but not simpler." – Albert Einstein