Skip to content

doc: update intellij plugin doc #471

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 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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 check that `kcl` and `kcl-language-server` are installed and have been added to your PATH:
In 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
In 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 Jetbrains Plugins Marketplace .
- **Step 3.** Reopen IntelliJ IDEA and create a KCL file and begin your KCL tour!

> 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 many coding assistance based on Language Server Protocol.

![intellij](/img/docs/tools/Ide/intellij/kcl-lsp.png)
- **Highlight:** Syntax and semantic highlight
- **Completion:** Completion for keywords, variable name, attributes and more
- **Goto definition:** Goto definition of schema, variable, schema attribute, and import pkg
- **Structure:** Main definition(schema def) and variables in KCL file
- **Hover:** Identifier information (type and schema documentation)
- **Diagnostics:** Warnings and errors in KCL file
- **Code Action:** Quick fix for some errors
- **InlayHint:** Hint for variable type, function and schema args

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 in developing.

For macOS and Linux:
## Dependencies

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

For Windows:
The minimun 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 isn't working as you expect, please contact us with [community](https://kcl-lang.io/docs/community/intro/support) 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](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.

## License

Apache License 2.0
2 changes: 1 addition & 1 deletion docs/tools/Ide/vs-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ We recommend that you use the latest version of KCL, but the minimum required ve

## Known Issues

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

## Ask for help

Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,6 @@ See [here](/docs/tools/Ide/neovim) to config the KCL language server and enable

#### IntelliJ IDEA

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

![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)与我们联系和寻求帮助。

## 参与贡献

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

## 许可

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

## 已知问题

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

## 寻求帮助

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/vs-code)了解更多。

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