Mobile development kit extension for Visual Studio Code
To assist Mobile Development Kit (MDK) application developers throughout the development lifecycle:
Introduce a new MDK language to assist MDK metadata JSON editing, e.g. action, page or service.
Introduce a new MDK debugger to enable MDK rule JavaScript debugging.
Features
The common VSCode language features and debugger ability will be available once this extension is enabled in your VSCode environment.
MDK metadata JSON editing assistant
Based on a comprehensive MDK schema definition
Supports application node detection within the workspace
Supports auto-completion, validation, navigation, etc.
MDK rule JavaScript coding assistant
Based on a predefined IClientAPI typing definition
Supports JSDoc snippets for rule argument description
Supports IClientAPI's auto-completion, validation, navigation, etc.
MDK application bundling
Integrate MDK metadata bundling process into VSCode build task.
Generate VSCode specific bundle.js with source map information.
MDK rule JavaScript debugging
Supports redirecting of code-line from bundle.js to corresponding rule.js with source map support
Supports set breakpoints in rule.js directly
MDK object creating
Supports create MDK object in Command Palette.
Supports create MDK object in context menu.
Checking no longer used MDK files in a specific MDK project
Supports check unused MDK files in Command Palette.
Supports metadata, rules and extensions.
Prerequisites
For pure editing or coding:
VSCode version higher than 1.24.0
For debugging:
XCode: It is used to find the corresponding iOS simulator.
Android Studio: It is used to find the corresponding Android emulator.
NativeScript CLI (version higher than 3.4.1): It is used to trigger the tns command to launch an MDK application.
npm install -g nativescript
The tns project for MDK branded client app: It is used to host the MDK application and support tns launch.
Node.js (version in v8.11.2 or higher): It is used to run the background bundle task.
Chrome: It is used to communicate with NativeScript CLI debugger.
Note: All the requirements aim to enable the MDK branded client app to run. So no need to setup separately when there is a runnable MDK client app already.
How to use
Launch VSCode with the MDK extension enabled.
Open an MDK metadata application folder or a git repository folder containing MDK applications.
Multiple applications within one workspace folder are supported.
There is no restriction for the Application.app in the workspace root folder.
Open any metadata json file or rule js file.
The common language features are available while editing or coding, e.g. auto-completion, validation, navigation, etc.
An auto-bundle task will be triggered once the MDK file is saved with no validation errors.
The new bundle.js file will be generated in a temporary working folder and can be used in the debugging process mentioned below.
You can also trigger the bundle task manually via the menu: Terminal > Run Build Task... .
Switch to the Debug perspective or open .vscode/launch.json
Click Add Configuration... and choose MDK: launch on iOS or MDK: launch on Android.
Specify the launch property appRoot with the tns source project path, e.g. ~/git/SAM/sdk/AssetManager or specify the user setting mdk.debugAppRoot for all the debug launch configurations by default.
Enable or Disable breakpoints within the rule.js files.
Click Start Debugging (the green triangle button) to start the debugging process.
Click stop (the red rectangle button) to stop the debugging process.
To configure the MDK tools version in VSCode dynamically:
Click View > Command Palette... .
Select MDK: Update MDK Tools .
The default target option is latest . You can also specify other available version.