Skip to content

feat: add Helix IDE configuration instructions #511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions docs/tools/Ide/helix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
sidebar_position: 4
---

# Helix

## Quick Start

- **Step 1.** [Install KCL](https://kcl-lang.io/docs/user_docs/getting-started/install) on your system. Please ensure that `kcl` and `kcl-language-server` are installed and added to your PATH:
On MacOS and Linux:

```bash
which kcl
which kcl-language-server
```

On Windows:

```bash
where kcl
where kcl-language-server
```

- **Step 2.** Amend your Helix `languages.toml` file:
```toml
[[language]]
name = "kcl"
scope = "source.k"
file-types = ["kcl", { glob = "*.k" } ]
roots = ["kcl.mod", "kcl.yaml"]
language-servers = ["kcl-lsp"]

[language-server.kcl-lsp]
command = "kcl-language-server"
```
- **Step 3.** Reopen Helix, create a KCL file, and begin your KCL journey!

## Features

This extension provides comprehensive coding assistance based on the Language Server Protocol.

<!-- - **Highlighting:** Syntax and semantic highlighting -->
- **Code Completion:** Completion for keywords, variable names, attributes, and more
<!-- - **Goto definition:** Navigate to the definition of schema, variables, schema attributes, and imported packages -->
- **Structure:** 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
- **Code Action:** Quick fix for some errors
- **InlayHint:** Display hints for variable type, functions, and schema arguments
- **Format:** Format a KCL file or snippet code

Other useful features such as diagnostics and testing are under development.

## Dependencies

We recommend using the latest version of KCL.

## Known Issues

See [here](https://github.com/kcl-lang/kcl/issues).

## Ask for help

If the extension does not behave as expected, please reach out to us through the [community](https://kcl-lang.io/docs/community/intro/support) for assistance.

## Contributing

We are actively working to enhance KCL development on Helix. We welcome all types of contributions. You can consult our [contribution guide](https://kcl-lang.io/docs/community/contribute), which explains how to build and run the extension locally and describes the contribution process.

## License

Apache License 2.0
1 change: 1 addition & 0 deletions docs/tools/Ide/index.md
Original file line number Diff line number Diff line change
@@ -5,3 +5,4 @@ We have provided three simple kinds of extensions for KCL. You can get more help
- IntelliJ Extension: https://github.com/kcl-lang/intellij-kcl
- VSCode Extension: https://github.com/kcl-lang/vscode-kcl
- NeoVim Extension: https://github.com/kcl-lang/kcl.nvim
- Helix Editor: https://github.com/helix-editor/helix