Skip to main content
Version: 0.10

Visual Studio Code

Quick Start

  • Step 1. Install KCL on your system. Please ensure that kcl and kcl-language-server are installed and added to your PATH: On MacOS and Linux:

    which kcl
    which kcl-language-server

    On Windows:

    where kcl
    where kcl-language-server
  • Step 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:Highlight
  • Goto Definition: Navigate to the definition of schema, variables, schema attributes, and imported packages Goto Definition
  • Completion: Completion for keywords, variable names, attributes, and more Completion
  • Outline: View the main definition (schema definition) and variables in KCL files Outline
  • Hover: View identifier information (type and schema documentation) Hover
  • Diagnostics: Detect warnings and errors in KCL files Diagnostics

Tips: You can enhance the effect of diagnostics by installing another extension: Error Lens.

  • Format: Format a KCL file or snippet code Format
  • Quick fix: Quick fix some diagnostics Qucik Fix
  • Inlay hint: Display hints for variable type, functions, and schema arguments Inlay Hint

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