Skip to content

Commit

Permalink
Merge pull request #471 from He1pa/update_ide_install_doc
Browse files Browse the repository at this point in the history
doc: update intellij plugin doc
  • Loading branch information
Peefy authored Sep 18, 2024
2 parents 1f98eb9 + 7bfa0cf commit b5afe5e
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 64 deletions.
65 changes: 43 additions & 22 deletions docs/tools/Ide/intellij.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,59 @@ sidebar_position: 3

# IntelliJ IDEA

We provide two IntelliJ KCL plugins:
## Quick Start

- IntelliJ KCL: The basic version of the KCL plugin provides syntax highlighting and keyword completion. It is compatible with multiple versions of IntelliJ IDE.
- IntelliJ KCL LSP: This plugin is implemented based on the [Language Server Protocol(LSP)](https://code.visualstudio.com/api/language-extensions/language-server-extension-guide) and offers additional features such as diagnostics, completion, and hovering. However, due to certain limitations, it can only be used with specific versions.
- **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:

> The integration with the Language Server Protocol is created as an extension to the paid IntelliJ-based IDEs. Therefore, plugins using Language Server integration are not available in Community releases of JetBrains products and Android Studio from Google.
> Starting with the 2023.2 release cycle, the LSP API is publicly available as part of the IntelliJ Platform in the following IDEs: IntelliJ IDEA Ultimate, WebStorm, PhpStorm, PyCharm Professional, DataSpell, RubyMine, CLion, Aqua, DataGrip, GoLand, Rider, and RustRover.
```bash
which kcl
which kcl-language-server
```

## IntelliJ KCL
On Windows:

The basic version of the KCL plugin can be directly downloaded and used from the IntelliJ Plugin Marketplace. It provides syntax highlighting and keyword completion.
![intellij](/img/docs/tools/Ide/intellij/kcl.png)
```bash
where kcl
where kcl-language-server
```

## IntelliJ KCL LSP
- **Step 2.** Install the [KCL plugin](https://plugins.jetbrains.com/plugin/23378-kcl) from the Jetbrains Plugins Marketplace.
- **Step 3.** Reopen IntelliJ IDEA, create a KCL file, and begin your KCL journey!

> Please note that the LSP version of the plugin may not be available in all versions of IntelliJ IDE.
> [https://plugins.jetbrains.com/docs/intellij/language-server-protocol.html#supported-ides]
## Features

IntelliJ KCL LSP also can be downloaded from the plugin marketplace
This extension provides comprehensive coding assistance based on the Language Server Protocol.

![intellij](/img/docs/tools/Ide/intellij/kcl-lsp.png)
- **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

Additionally, you need to install the [kcl-language-server](https://www.kcl-lang.io/docs/user_docs/getting-started/install#install-language-server) and verify that the `kcl-language-server` command is in your PATH. Here are the steps for different operating systems:
Other useful features such as diagnostics and testing are under development.

For macOS and Linux:
## Dependencies

```bash
which kcl-language-server
```
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.

For Windows:
The minimum required version for IntelliJ IDEA is 2022.1.

```bash
where kcl-language-server
```
## 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 VS Code. 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
30 changes: 15 additions & 15 deletions docs/tools/Ide/vs-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@ sidebar_position: 1

## Quick Start

- **Step 1.** [Install KCL](https://kcl-lang.io/docs/user_docs/getting-started/install) on your system. Please check that `kcl` and `kcl-language-server` are installed and have been added to your PATH:
In MacOs and Linux:
- **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
```

In Windows:
On Windows:

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

- **Step 2.** Install the [KCL extension](https://marketplace.visualstudio.com/items?itemName=kcl.kcl-vscode-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!
- **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:

- **Syntax Highlight:**
- **Highlighting:**
![Highlight](/img/docs/tools/Ide/vs-code/Highlight.png)
- **Goto Definition:** Goto definition of schema, variable, schema attribute, map key and import pkg.
- **Goto Definition:** Navigate to the definition of schema, variables, schema attributes, and imported packages
![Goto Definition](/img/docs/tools/Ide/vs-code/GotoDef.gif)
- **Completion:** Completion for keywords, dot(`.`), variables and schema attribute.
- **Completion:** Completion for keywords, variable names, attributes, and more
![Completion](/img/docs/tools/Ide/vs-code/Completion.gif)
- **Outline:** Main definition(schema def) and variables in KCL file.
- **Outline:** View the main definition (schema definition) and variables in KCL files
![Outline](/img/docs/tools/Ide/vs-code/Outline.gif)
- **Hover:** Identifier information (type, function signature and documents).
- **Hover:** View identifier information (type and schema documentation)
![Hover](/img/docs/tools/Ide/vs-code/Hover.gif)
- **Diagnostics:** Warnings and errors in KCL file.
- **Diagnostics:** Detect warnings and errors in KCL files
![Diagnostics](/img/docs/tools/Ide/vs-code/Diagnostics.gif)

> Tips: You can enhance the effect of diagnostics by installing another extension: [Error Lens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens).
Expand All @@ -47,26 +47,26 @@ This extension provides some coding assistance, including the following features
![Format](/img/docs/tools/Ide/vs-code/Format.gif)
- **Quick fix:** Quick fix some diagnostics
![Qucik Fix](/img/docs/tools/Ide/vs-code/QuickFix.gif)
- **Inlay hint:** Inlay hint displays variable type and other semantic information
- **Inlay hint:** Display hints for variable type, functions, and schema arguments
![Inlay Hint](/img/docs/tools/Ide/vs-code/Inlayhint.png)

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.
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](https://github.com/kcl-lang/kcl/issues/524).
See [here](https://github.com/kcl-lang/kcl/issues).

## Ask for help

If the extension isn't working as you expect, please contact us with [community](https://kcl-lang.io/docs/community/intro/support) 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 working actively on improving the KCL development on VS Code. All kinds of contributions are welcomed. You can refer to our [contribution guide](https://kcl-lang.io/docs/community/contribute). It introduces how to build and run the extension locally, and describes the process of sending a contribution.
We are actively working to enhance KCL development on VS Code. 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

Expand Down
6 changes: 3 additions & 3 deletions docs/user_docs/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,18 @@ scoop install kcl-lang/kcl-lsp

#### VS Code

The KCL Extension extension provides some coding assistance, e.g., highlight, goto definition, completion, hover, outline, and diagnostics. You can go [here](/docs/tools/Ide/vs-code) for more information about the installation.
The KCL Extension provides comprehensive coding assistance, offering features such as highlighting, go-to definition, completion, hover, outline, and diagnostics. For more information about the installation, please visit [here](/docs/tools/Ide/vs-code)

![Completion](/img/docs/tools/Ide/vs-code/Completion.gif)

#### NeoVim

See [here](/docs/tools/Ide/neovim) to config the KCL language server and enable it.
To configure the KCL language server and enable it, please refer to [here](/docs/tools/Ide/neovim)

![kcl.nvim](/img/docs/tools/Ide/neovim/overview.png)

#### IntelliJ IDEA

We provide two IntelliJ KCL plugins and you can go [here](/docs/tools/Ide/intellij) for more information about the installation.
We offer IntelliJ KCL plugins. For detailed information about the installation, please visit [here](/docs/tools/Ide/intellij)

![intellij](/img/docs/tools/Ide/intellij/overview.png)
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,59 @@ sidebar_position: 3

# IntelliJ IDEA

我们提供了两个版本的 IntelliJ KCL 插件
## 快速开始

- IntelliJ KCL: 基础版本的 KCL 插件提供了语法高亮和补全的基础能力,可以在更多版本使用。
- **1.** [安装 KCL](https://kcl-lang.io/docs/user_docs/getting-started/install) 并检查 `kcl``kcl-language-server` 命令在您的 PATH 中:
在 MacOs 和 Linux中:

- IntelliJ KCL LSP: 基于 [LSP(Language Server Protocol)](https://code.visualstudio.com/api/language-extensions/language-server-extension-guide) 实现的 KCL 插件提供了更多功能,如错误提示,智能补全,悬停等功能。但因为一些[原因](https://plugins.jetbrains.com/docs/intellij/language-server-protocol.html#supported-ides),只能在特定版本中使用。
```bash
which kcl
which kcl-language-server
```

> 与 Language Server Protocol 的集成是作为基于 IntelliJ 的付费 IDE 的扩展而创建的。 因此,使用 LSP 集成的插件在 JetBrains 产品和 Google 的 Android Studio 的社区版本中不可用。
> 从 2023.2 发布周期开始,LSP API 作为 IntelliJ 平台的一部分在以下 IDE 中公开提供:IntelliJ IDEA Ultimate、WebStorm、PhpStorm、PyCharm Professional、DataSpell、RubyMine、CLion、Aqua、DataGrip、GoLand、Rider 和 RustRover.
在 Windows 中:

## IntelliJ KCL
```bash
where kcl
where kcl-language-server
```

基础版本的 KCL 插件可以直接在 IntelliJ 的插件市场下载使用。基础版本提供了语法高亮和关键字补全的能力
![intellij](/img/docs/tools/Ide/intellij/kcl.png)
- **2.** 安装 [IntelliJ IDEA KCL 插件](https://plugins.jetbrains.com/plugin/23378-kcl).
- **3.** 重新打开 IntelliJ IDEA 并创建一个 KCL 文件验证 IDE 插件功能

## IntelliJ KCL KCL
## Features

基于 LSP 版本的插件可以从插件市场下载
此插件基于 LSP 提供了许多编码帮助,包括以下功能:

![intellij](/img/docs/tools/Ide/intellij/kcl-lsp.png)
- **高亮:** 语法和语义高亮
- **补全:** 关键字,变量名,属性等补全
- **跳转:** schema 定义,变量,schema 属性等跳转
- **大纲:** 显示 KCL 文件中的 schema 和 变量定义
- **悬停:** Identifier 信息 (type 和 schema 文档)
- **诊断:** KCL 文件中的警告和错误信息
- **快速修复:** 对一些错误进行快速修复
- **内联提示:** 变量类型,函数和 schema 参数等提示

除此之外,您还需要[安装 kcl-language-server](https://www.kcl-lang.io/docs/user_docs/getting-started/install#install-language-server) 并检查 `kcl-language-server` 命令在您的 PATH 中:
在 MacOs 和 Linux中:
其他一些有用的功能,如代码重构和智能感知等正在开发中。

```bash
which kcl-language-server
```
## 最小依赖

在 Windows 中:
我们建议您使用最新版本的 KCL,但此扩展所需的 KCL 最低版本为 v0.4.6。如果您使用的是更早期版本,则此扩展可能无法正常工作。

```bash
where kcl-language-server
```
IntelliJ IDEA 的最低版本为 2022.1

注意,LSP 版本的插件不一定在所有版本的 IntelliJ IDE 中可以使用。
## 已知问题

[详见](https://github.com/kcl-lang/kcl/issues)

## 寻求帮助

如果扩展没有如您所期望的那样工作,请通过[社区](https://kcl-lang.io/docs/community/intro/support)与我们联系和寻求帮助。

## 参与贡献

目前我们正在积极改进 KCL IDE 插件体验,欢迎参考[贡献指南](https://kcl-lang.io/docs/community/contribute) 一起共建!

## 许可

Apache License 2.0
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ sidebar_position: 1

## 已知问题

[详见](https://github.com/kcl-lang/kcl/issues/524)
[详见](https://github.com/kcl-lang/kcl/issues)

## 寻求帮助

如果扩展没有如您所期望的那样工作,请通过[社区](https://kcl-lang.io/docs/community/intro/support)与我们联系和寻求帮助。

## 参与贡献

目前 VS Code KCL 插件处于早期版本,我们正在积极改进 VS Code KCL 插件体验,欢迎参考[贡献指南](https://kcl-lang.io/docs/community/contribute) 一起共建!
目前我们正在积极改进 KCL IDE 插件体验,欢迎参考[贡献指南](https://kcl-lang.io/docs/community/contribute) 一起共建!

## 许可

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,6 @@ KCL 为 VS Code 本地版本提供了插件支持,并提供了高亮、自动

#### IntelliJ IDEA

我们提供了两个版本的 Intellij 插件。您可以[点击这里](/docs/tools/Ide/vs-code)了解更多。
KCL 为 IntelliJ IDEA 提供了插件支持。您可以[点击这里](/docs/tools/Ide/intellij)了解更多。

![intellij](/img/docs/tools/Ide/intellij/overview.png)

0 comments on commit b5afe5e

Please sign in to comment.