Visual Studio Code
Quick Start
Step 1. Install KCL on your system. Please check that
kcl
andkcl-language-server
are installed and have been added to your PATH: In MacOs and Linux:which kcl
which kcl-language-serverIn Windows:
where kcl
where kcl-language-serverStep 2. Install the KCL extension for Visual Studio Code. This extension requires the VS Code 1.50+.
Step 3. Reopen VS Code and create a KCL file and begin your KCL tour!
Features
This extension provides some coding assistance, including the following features:
- Syntax Highlight:
- Goto Definition: Goto definition of schema, variable, schema attribute, map key and import pkg.
- Completion: Completion for keywords, dot(
.
), variables and schema attribute. - Outline: Main definition(schema def) and variables in KCL file.
- Hover: Identifier information (type, function signature and documents).
- Diagnostics: Warnings and errors in KCL file.
Tips: You can enhance the effect of diagnostics by installing another extension: Error Lens.
- Format: Format a KCL file or snippet code
- Quick fix: Quick fix some diagnostics
Other useful features such as refactoring and testing are in development.
Dependencies
We recommend that you use the latest version of KCL, but the minimum required version for this extension is 0.4.6. If you are using an earlier version, the extension may not work properly.
Known Issues
See here.
Ask for help
If the extension isn't working as you expect, please contact us with community for help.
Contributing
We are working actively on improving the KCL development on VS Code. All kinds of contributions are welcomed. You can refer to our contribution guide. It introduces how to build and run the extension locally, and describes the process of sending a contribution.
License
Apache License 2.0