From d37ae73ca66a7e008fd81541e3e285b330067e2b Mon Sep 17 00:00:00 2001 From: peefy Date: Fri, 24 Nov 2023 15:05:05 +0800 Subject: [PATCH] docs: add kcl language server install guide Signed-off-by: peefy --- docs/user_docs/getting-started/install.md | 73 +++++++++++++++-- .../user_docs/getting-started/install.md | 81 ++++++++++++++++--- .../user_docs/getting-started/install.md | 77 ++++++++++++++++-- .../user_docs/getting-started/install.md | 73 +++++++++++++++-- 4 files changed, 278 insertions(+), 26 deletions(-) diff --git a/docs/user_docs/getting-started/install.md b/docs/user_docs/getting-started/install.md index 13b24511..5bfb56c9 100644 --- a/docs/user_docs/getting-started/install.md +++ b/docs/user_docs/getting-started/install.md @@ -28,7 +28,7 @@ $env:PATH += ";{install-location};" #### MacOS -Install or upgrade the latest darwin KCL to /usr/local/kclvm/bin +Install or upgrade the latest darwin KCL to /usr/local/bin ```bash curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash @@ -36,7 +36,7 @@ curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash #### Linux -Install or upgrade the latest linux KCL to /usr/local/kclvm/bin +Install or upgrade the latest linux KCL to /usr/local/bin ```bash wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash @@ -119,19 +119,82 @@ If you are unable to successfully install and run KCL, you can refer to [here](/ ## 2. Install KCL IDE Extension -### VS Code +### Install Language Server + +Before we enable the IDE extension, first we install the KCL Language Server binary and add it to the PATH. + +#### MacOS + +Install or upgrade the latest darwin KCL language server to /usr/local/bin + +```bash +curl -fsSL https://kcl-lang.io/script/install-kcl-lsp.sh | /bin/bash +``` + +#### Linux + +Install or upgrade the latest linux KCL language server to /usr/local/bin + +```bash +wget -q https://kcl-lang.io/script/install-kcl-lsp.sh -O - | /bin/bash +``` + +#### Windows + +Install or upgrade the latest windows KCL language server to $Env:SystemDrive\kclvm\bin and add this directory to User PATH environment variable. + +```bash +powershell -Command "iwr -useb https://kcl-lang.io/script/install-kcl-lsp.ps1 | iex" +``` + +#### Homebrew (MacOS) + +- Install + +```bash +# Install the latest version +brew install kcl-lang/tap/kcl-lsp@0.7.0 + +# Specify a version +brew install kcl-lang/tap/kcl-lsp@x.y.z +``` + +- Upgrade + +```bash +brew upgrade kcl-lang/tap/kcl-lsp +``` + +- Uninstall + +```bash +brew uninstall kcl-lang/tap/kcl-lsp +``` + +#### Scoop (Windows) + +Install [Scoop](https://scoop.sh/) first, then add this bucket and install `kcl-language-server` by running: + +```bash +scoop bucket add kcl-lang https://github.com/kcl-lang/scoop-bucket.git +scoop install kcl-lang/kcl-lsp +``` + +### Install KCL Extensions for IDE + +#### 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. ![Completion](/img/docs/tools/Ide/vs-code/Completion.gif) -### NeoVim +#### NeoVim See [here](https://github.com/kcl-lang/kcl.nvim) to config the KCL language server and enable it. ![kcl.nvim](/img/docs/tools/Ide/neovim/overview.png) -### IntelliJ IDEA +#### IntelliJ IDEA Download the distribution from [here](https://github.com/kcl-lang/intellij-kcl/releases) and in IntelliJ IDEA, click Preference -> plugins -> install Plugin from Disk... -> select kcl-idea-plugin zip -> restart IDE. This plugin requires the IntelliJ IDEA 2020.2+ diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/getting-started/install.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/getting-started/install.md index 4c0d31b0..e26180c1 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/getting-started/install.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/getting-started/install.md @@ -8,7 +8,7 @@ sidebar_position: 2 ### 二进制下载 -KCL 的每个版本都包含各种操作系统和体系结构。这些二进制版本可以从 [Github](https://github.com/kcl-lang/kcl/releases/) 或者 [Gitee](https://gitee.com/kusionstack/kcl/releases) 手动下载并安装,下载完成后将 `{install-location}/kclvm/bin` 添加到环境变量 PATH 中。 +KCL 的每个版本都包含各种操作系统和体系结构。这些二进制版本可以从 [Github](https://github.com/kcl-lang/cli/releases/) 或者 [Gitee](https://gitee.com/kusionstack/kcl/releases) 手动下载并安装,下载完成后将 `{install-location}/kclvm/bin` 添加到环境变量 PATH 中。 > ⚠️ 如果您不能成功访问 Github, 也可以访问 Gitee 获得二进制进行安装 @@ -28,7 +28,7 @@ $env:PATH += ";{install-location};" #### MacOS -将 KCL darwin 最新版本安装到 /usr/local/kclvm/bin +将 KCL darwin 最新版本安装到 /usr/local/bin ```bash curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash @@ -36,7 +36,7 @@ curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash #### Linux -将 KCL linux 最新版本安装到 /usr/local/kclvm/bin +将 KCL linux 最新版本安装到 /usr/local/bin ```bash wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash @@ -47,10 +47,10 @@ wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash 将 KCL windows 最新版本安装到 $Env:SystemDrive\kclvm\bin,并将该目录添加到用户 PATH 环境变量中。 ```bash -powershell -Command "iwr -useb https://kcl-lang.io/script/install.ps1 | iex" +powershell -Command "iwr -useb https://kcl-lang.io/script/install-cli.ps1 | iex" ``` -### Homebrew (MacOS) +#### Homebrew (MacOS) - 安装最新版本 @@ -74,7 +74,7 @@ brew upgrade kcl-lang/tap/kcl brew uninstall kcl-lang/tap/kcl ``` -### Scoop (Windows) +#### Scoop (Windows) 首先安装 [Scoop](https://scoop.sh/), 然后通过如下命令安装 `kcl`: @@ -119,19 +119,82 @@ kcl --help ## 2. 安装 KCL IDE 插件 -### VS Code +### 安装语言服务器 + +在我们启用 IDE 插件之前,首先我们安装 KCL Language Server 二进制并添加到 PATH 中。 + +#### MacOS + +将 KCL language server darwin 最新版本安装到 /usr/local/bin + +```bash +curl -fsSL https://kcl-lang.io/script/install-kcl-lsp.sh | /bin/bash +``` + +#### Linux + +将 KCL language server linux 最新版本安装到 /usr/local/bin + +```bash +wget -q https://kcl-lang.io/script/install-kcl-lsp.sh -O - | /bin/bash +``` + +#### Windows + +将 KCL language server windows 最新版本安装到 $Env:SystemDrive\kclvm\bin,并将该目录添加到用户 PATH 环境变量中。 + +```bash +powershell -Command "iwr -useb https://kcl-lang.io/script/install-kcl-lsp.ps1 | iex" +``` + +### Homebrew (MacOS) + +- 安装最新版本 + +```bash +# 安装最新版本 +brew install kcl-lang/tap/kcl-lsp@0.7.0 + +# 安装固定版本 +brew install kcl-lang/tap/kcl-lsp@x.y.z +``` + +- 升级 + +```bash +brew upgrade kcl-lang/tap/kcl-lsp +``` + +- 卸载 + +```bash +brew uninstall kcl-lang/tap/kcl-lsp +``` + +### Scoop (Windows) + +首先安装 [Scoop](https://scoop.sh/), 然后通过如下命令安装 `kcl-language-server` 二进制: + +```bash +scoop bucket add kcl-lang https://github.com/kcl-lang/scoop-bucket.git +scoop install kcl-lang/kcl-lsp +``` + +### 安装 IDE 插件客户端 + +#### VS Code KCL 为 VS Code 本地版本提供了插件支持,并提供了高亮、自动补全、跳转、悬停、大纲等功能。您可以[点击这里](/docs/tools/Ide/vs-code)进行安装。 ![Completion](/img/docs/tools/Ide/vs-code/Completion.gif) -### NeoVim +#### NeoVim 参见[此处](https://github.com/kcl-lang/kcl.nvim)配置 KCL 语言服务器并启用它。 ![kcl.nvim](/img/docs/tools/Ide/neovim/overview.png) -### IntelliJ IDEA +#### IntelliJ IDEA 从[这里](https://github.com/kcl-lang/intellij-kcl/releases)下载发行版,在 IntelliJ IDEA 中,点击 Preference -> plugins -> install Plugin from Disk... -> 选择 kcl-idea-plugin zip -> 重启 IDE。此插件需要 IntelliJ IDEA 2020.2+ diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7.0/user_docs/getting-started/install.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7.0/user_docs/getting-started/install.md index 4c0d31b0..9ce194eb 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7.0/user_docs/getting-started/install.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.7.0/user_docs/getting-started/install.md @@ -8,7 +8,7 @@ sidebar_position: 2 ### 二进制下载 -KCL 的每个版本都包含各种操作系统和体系结构。这些二进制版本可以从 [Github](https://github.com/kcl-lang/kcl/releases/) 或者 [Gitee](https://gitee.com/kusionstack/kcl/releases) 手动下载并安装,下载完成后将 `{install-location}/kclvm/bin` 添加到环境变量 PATH 中。 +KCL 的每个版本都包含各种操作系统和体系结构。这些二进制版本可以从 [Github](https://github.com/kcl-lang/cli/releases/) 或者 [Gitee](https://gitee.com/kusionstack/kcl/releases) 手动下载并安装,下载完成后将 `{install-location}/kclvm/bin` 添加到环境变量 PATH 中。 > ⚠️ 如果您不能成功访问 Github, 也可以访问 Gitee 获得二进制进行安装 @@ -28,7 +28,7 @@ $env:PATH += ";{install-location};" #### MacOS -将 KCL darwin 最新版本安装到 /usr/local/kclvm/bin +将 KCL darwin 最新版本安装到 /usr/local/bin ```bash curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash @@ -36,7 +36,7 @@ curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash #### Linux -将 KCL linux 最新版本安装到 /usr/local/kclvm/bin +将 KCL linux 最新版本安装到 /usr/local/bin ```bash wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash @@ -47,7 +47,7 @@ wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash 将 KCL windows 最新版本安装到 $Env:SystemDrive\kclvm\bin,并将该目录添加到用户 PATH 环境变量中。 ```bash -powershell -Command "iwr -useb https://kcl-lang.io/script/install.ps1 | iex" +powershell -Command "iwr -useb https://kcl-lang.io/script/install-cli.ps1 | iex" ``` ### Homebrew (MacOS) @@ -119,19 +119,82 @@ kcl --help ## 2. 安装 KCL IDE 插件 -### VS Code +### 安装语言服务器 + +在我们启用 IDE 插件之前,首先我们安装 KCL Language Server 二进制并添加到 PATH 中。 + +#### MacOS + +将 KCL language server darwin 最新版本安装到 /usr/local/bin + +```bash +curl -fsSL https://kcl-lang.io/script/install-kcl-lsp.sh | /bin/bash +``` + +#### Linux + +将 KCL language server linux 最新版本安装到 /usr/local/bin + +```bash +wget -q https://kcl-lang.io/script/install-kcl-lsp.sh -O - | /bin/bash +``` + +#### Windows + +将 KCL language server windows 最新版本安装到 $Env:SystemDrive\kclvm\bin,并将该目录添加到用户 PATH 环境变量中。 + +```bash +powershell -Command "iwr -useb https://kcl-lang.io/script/install-kcl-lsp.ps1 | iex" +``` + +#### Homebrew (MacOS) + +- 安装最新版本 + +```bash +# 安装最新版本 +brew install kcl-lang/tap/kcl-lsp@0.7.0 + +# 安装固定版本 +brew install kcl-lang/tap/kcl-lsp@x.y.z +``` + +- 升级 + +```bash +brew upgrade kcl-lang/tap/kcl-lsp +``` + +- 卸载 + +```bash +brew uninstall kcl-lang/tap/kcl-lsp +``` + +#### Scoop (Windows) + +首先安装 [Scoop](https://scoop.sh/), 然后通过如下命令安装 `kcl-language-server` 二进制: + +```bash +scoop bucket add kcl-lang https://github.com/kcl-lang/scoop-bucket.git +scoop install kcl-lang/kcl-lsp +``` + +### 安装 IDE 插件客户端 + +#### VS Code KCL 为 VS Code 本地版本提供了插件支持,并提供了高亮、自动补全、跳转、悬停、大纲等功能。您可以[点击这里](/docs/tools/Ide/vs-code)进行安装。 ![Completion](/img/docs/tools/Ide/vs-code/Completion.gif) -### NeoVim +#### NeoVim 参见[此处](https://github.com/kcl-lang/kcl.nvim)配置 KCL 语言服务器并启用它。 ![kcl.nvim](/img/docs/tools/Ide/neovim/overview.png) -### IntelliJ IDEA +#### IntelliJ IDEA 从[这里](https://github.com/kcl-lang/intellij-kcl/releases)下载发行版,在 IntelliJ IDEA 中,点击 Preference -> plugins -> install Plugin from Disk... -> 选择 kcl-idea-plugin zip -> 重启 IDE。此插件需要 IntelliJ IDEA 2020.2+ diff --git a/versioned_docs/version-0.7.0/user_docs/getting-started/install.md b/versioned_docs/version-0.7.0/user_docs/getting-started/install.md index 13b24511..5bfb56c9 100644 --- a/versioned_docs/version-0.7.0/user_docs/getting-started/install.md +++ b/versioned_docs/version-0.7.0/user_docs/getting-started/install.md @@ -28,7 +28,7 @@ $env:PATH += ";{install-location};" #### MacOS -Install or upgrade the latest darwin KCL to /usr/local/kclvm/bin +Install or upgrade the latest darwin KCL to /usr/local/bin ```bash curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash @@ -36,7 +36,7 @@ curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash #### Linux -Install or upgrade the latest linux KCL to /usr/local/kclvm/bin +Install or upgrade the latest linux KCL to /usr/local/bin ```bash wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash @@ -119,19 +119,82 @@ If you are unable to successfully install and run KCL, you can refer to [here](/ ## 2. Install KCL IDE Extension -### VS Code +### Install Language Server + +Before we enable the IDE extension, first we install the KCL Language Server binary and add it to the PATH. + +#### MacOS + +Install or upgrade the latest darwin KCL language server to /usr/local/bin + +```bash +curl -fsSL https://kcl-lang.io/script/install-kcl-lsp.sh | /bin/bash +``` + +#### Linux + +Install or upgrade the latest linux KCL language server to /usr/local/bin + +```bash +wget -q https://kcl-lang.io/script/install-kcl-lsp.sh -O - | /bin/bash +``` + +#### Windows + +Install or upgrade the latest windows KCL language server to $Env:SystemDrive\kclvm\bin and add this directory to User PATH environment variable. + +```bash +powershell -Command "iwr -useb https://kcl-lang.io/script/install-kcl-lsp.ps1 | iex" +``` + +#### Homebrew (MacOS) + +- Install + +```bash +# Install the latest version +brew install kcl-lang/tap/kcl-lsp@0.7.0 + +# Specify a version +brew install kcl-lang/tap/kcl-lsp@x.y.z +``` + +- Upgrade + +```bash +brew upgrade kcl-lang/tap/kcl-lsp +``` + +- Uninstall + +```bash +brew uninstall kcl-lang/tap/kcl-lsp +``` + +#### Scoop (Windows) + +Install [Scoop](https://scoop.sh/) first, then add this bucket and install `kcl-language-server` by running: + +```bash +scoop bucket add kcl-lang https://github.com/kcl-lang/scoop-bucket.git +scoop install kcl-lang/kcl-lsp +``` + +### Install KCL Extensions for IDE + +#### 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. ![Completion](/img/docs/tools/Ide/vs-code/Completion.gif) -### NeoVim +#### NeoVim See [here](https://github.com/kcl-lang/kcl.nvim) to config the KCL language server and enable it. ![kcl.nvim](/img/docs/tools/Ide/neovim/overview.png) -### IntelliJ IDEA +#### IntelliJ IDEA Download the distribution from [here](https://github.com/kcl-lang/intellij-kcl/releases) and in IntelliJ IDEA, click Preference -> plugins -> install Plugin from Disk... -> select kcl-idea-plugin zip -> restart IDE. This plugin requires the IntelliJ IDEA 2020.2+