Code Auto-Completion¶
Code auto-completion helps developers work faster and more comfortably with code, offering possible code completion options, variable names, functions, and other hints.
Below are the steps to configure code auto-completion for MotorXP-AFM Scripting API.
Configuration¶
- 
Download the file types_MotorXP-AFM.d.ts and save it in your scripts folder. The extension .d.tsis aTypeScript Declaration File, which contains only type definitions and interfaces, and does not compile toJS. It helps theIDEunderstand the structure of theAPI.
- 
At the beginning of each script add a special comment directive: /// <reference path="./pathToFile/types_MotorXP-AFM.d.ts" />.
- 
Utilize an IDEand editor that supports auto-completion (IntelliSensethrough.d.ts).
Supported IDEs¶
| IDE / Editor | Supports .d.ts | Comment | 
|---|---|---|
| Visual Studio Code | ✅ Complete | Best IntelliSense, auto-completion, JSDoc, and navigation support | 
| WebStorm / IntelliJ IDEA | ✅ Complete | Support through TypeScript Server | 
| Vim + TSServer | ⚠️ Limited | Requires plugins: vim-js-ts,coc.nvimand others. | 
| Atom + ide-typescript | ⚠️ Limited | Requires package installations. | 
| Sublime Text + TypeScript Plugin | ⚠️ Limited | Available through third-party plugins | 
Tip
When writing scripts, we recommend using a text editor Visual Studio Code.