VSCode HarmonyOS ArkTS plugin for personal use using volar.js
ArkTS VSCode extension developed based on Volar. It seems that there is no support for VSCode until now that fills the gap!
Naily's ArkTS Support
ArkTS VSCode extension developed based on Volar. 🌹 It seems that there is no support for VSCode until now, and the existing ArkTS extensions are very rudimentary, so I decided to write my own.
🖊️ Complete JSON Schema support. JSON support for the following files, Schema:
build-profile.json5
Module-level/project-level configurationoh-package.json5
Module-level/project-level configurationmodule.json5
Module-level/project-level configurationcode-linter.json5
Module-level/project-level configurationresources/element/
Configure the kv value under all equal amountscolor.json
main_pages.json5
🪐 Perfect ArkTS syntax highlighting, completion, Little to no support for diagnostics, PR welcome
✨ Support source code jumping, note that it is limited to the internal source code of ArkTS for the time being, and import/export is not supported yet, please welcome PR
Installation
Marketplace Installation: https://marketplace.visualstudio.com/items?itemName=NailyZero.vscode-naily-ets
Or just search for it in VSCode.ArkTS Support
ArkTS source code is redirected
ArkTS source code redirection needs to be dependent, so you need to install it in your HarmonyOS project.@arkts/declarationsnpm@arkts/declarations
npm install @arkts/declarations
Then, in the root directory of your HarmonyOS project, create a file, or modify an existing one, adding the following:tsconfig.jsontsconfig.json
{
"extends": "@arkts/declarations/dist/tsconfig.base.json"
}
Inherit this config and then, restart your VSCode!! Be sure to restart your VSCode for it to work! The final effect of the code hint is shown in the following figure:
There are also corresponding prompts when importing modules (provided that you configure them correctly according to the requirements above). The principle of importing modules is very simple, just scan the official ArkTS API, and then generate a series of alias, you just need to inherit 😋tsconfig.jsoncompilerOptions.paths
It's no problem to click in, and you can jump normally. However, there are many places that can't be jumped, such as the one behind the Block Statement, as shown below, which is not yet jumpable, this is very, very complicated to do, and you need to wait for the community to discuss, welcome to leave your thoughts 😌 in the issue.
Tips
You can click here and there will be corresponding tips:.
This is also a temporary helpless move, remember to put the chain call behind after writing, otherwise it will not conform to the 😂 ArkTS syntax
other
⚠️Note: At the moment the package is based on the latest, so if the HarmonyOS version is lower, there may be some issues, PR is welcome.API 13API 13