Visual Studio Code
Quick Start
Step 1. Install KCL on your system. Please ensure that
kcl
andkcl-language-server
are installed and added to your PATH: On MacOS and Linux:which kcl
which kcl-language-serverOn 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, create a KCL file, and begin your KCL journey!
Features
This extension provides some coding assistance, including the following features:
- Highlighting:
- Goto Definition: Navigate to the definition of schema, variables, schema attributes, and imported packages
- Completion: Completion for keywords, variable names, attributes, and more
- Outline: View the main definition (schema definition) and variables in KCL files
- Hover: View identifier information (type and schema documentation)
- Diagnostics: Detect warnings and errors in KCL files
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
- Inlay hint: Display hints for variable type, functions, and schema arguments
Other useful features such as refactoring and testing are in development.
Dependencies
We recommend using 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 does not behave as expected, please reach out to us through the community for assistance.
Contributing
We are actively working to enhance KCL development on VS Code. We welcome all types of contributions. You can consult our contribution guide, which explains how to build and run the extension locally and describes the contribution process.
License
Apache License 2.0