Skip to content

doc: update intellij plugin doc #365

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 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
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
36 changes: 34 additions & 2 deletions docs/tools/Ide/intellij.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ sidebar_position: 3

# IntelliJ IDEA

- IntelliJ KCL Extension: [https://github.com/kcl-lang/intellij-kcl](https://github.com/kcl-lang/intellij-kcl)
We provide two IntelliJ KCL plugins:

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

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

## IntelliJ KCL

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)

## IntelliJ KCL LSP

> 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]

IntelliJ KCL LSP also can be downloaded from the plugin marketplace

![intellij](/img/docs/tools/Ide/intellij/kcl-lsp.png)

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:

For macOS and Linux:

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

For Windows:

```bash
where kcl-language-server
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@ sidebar_position: 3

# IntelliJ IDEA

- IntelliJ KCL 插件: [https://github.com/kcl-lang/intellij-kcl](https://github.com/kcl-lang/intellij-kcl)
我们提供了两个版本的 IntelliJ KCL 插件

![intellij](/img/docs/tools/Ide/intellij/overview.png)
- IntelliJ KCL: 基础版本的 KCL 插件提供了语法高亮和补全的基础能力,可以在更多版本使用。

- 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),只能在特定版本中使用。

> 与 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.

## IntelliJ KCL

基础版本的 KCL 插件可以直接在 IntelliJ 的插件市场下载使用。基础版本提供了语法高亮和关键字补全的能力
![intellij](/img/docs/tools/Ide/intellij/kcl.png)

## IntelliJ KCL KCL

基于 LSP 版本的插件可以从插件市场下载

![intellij](/img/docs/tools/Ide/intellij/kcl-lsp.png)

除此之外,您还需要[安装 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 中:

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

注意,LSP 版本的插件不一定在所有版本的 IntelliJ IDE 中可以使用。
Binary file added static/img/docs/tools/Ide/intellij/kcl-lsp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/docs/tools/Ide/intellij/kcl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading