diff --git a/blog/2024-09-18-kcl-0.10.0-release/index.md b/blog/2024-09-18-kcl-0.10.0-release/index.md index b6f391b7..fc7b58e7 100644 --- a/blog/2024-09-18-kcl-0.10.0-release/index.md +++ b/blog/2024-09-18-kcl-0.10.0-release/index.md @@ -156,9 +156,7 @@ For JSON Schema containing AllOf validation fields: "minimum": 0 } }, - "required": [ - "name" - ] + "required": ["name"] } ``` @@ -221,7 +219,7 @@ kcl mod add cc --git https://github.com/kcl-lang/flask-demo-kcl-manifests.git -- - The package management tool fixes the missing default dependencies in the kcl.mod. - The package management tool fixes the calculation error of the vendor path, which causes the third-party library to be re-downloaded. - The package management tool fixes the failure to push the OCI registry with the https protocol. -- The package management tool fixes the compilation failure when compiling multiple *.k files. +- The package management tool fixes the compilation failure when compiling multiple \*.k files. - The package management added more test cases. - The package management tool fixed the circular dependency issue caused by adding the git subpackage multiple times as a dependency. - The package management tool fixed the missing dependencies path when use the `kcl mod metadata` command. @@ -300,7 +298,7 @@ a = file.current() After compiling, you can get the following result: ```kcl -a: /Users/xxx/xxx/main.k +a: /Users/xxx/xxx/main.k ``` - KCL added some built-in APIs parameters to support the encoding parameter. diff --git a/docs/tools/Ide/intellij.md b/docs/tools/Ide/intellij.md index ec16b46f..1b529bb5 100644 --- a/docs/tools/Ide/intellij.md +++ b/docs/tools/Ide/intellij.md @@ -6,7 +6,7 @@ sidebar_position: 3 ## 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: +- **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 diff --git a/docs/tools/Ide/vs-code.md b/docs/tools/Ide/vs-code.md index 8a0bed24..6ce4ffba 100644 --- a/docs/tools/Ide/vs-code.md +++ b/docs/tools/Ide/vs-code.md @@ -6,7 +6,7 @@ sidebar_position: 1 ## 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: +- **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 diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2024-09-18-kcl-0.10.0-release/index.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2024-09-18-kcl-0.10.0-release/index.md index 35a65476..5fc504bb 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-blog/2024-09-18-kcl-0.10.0-release/index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2024-09-18-kcl-0.10.0-release/index.md @@ -1,5 +1,5 @@ --- -slug: 2024-07-05-kcl-0.10.0-release +slug: 2024-09-18-kcl-0.10.0-release title: KCL v0.10.0 重磅发布 - 更稳定流畅的工具链和 IDE 体验,全新的 KCL Playground ! authors: name: KCL Team @@ -91,7 +91,7 @@ schema Deployment: - 修复 as 关键字在外部包存在时类型转换的错误 - 修复在 lambda 函数中 config 到 schema 的类型检查错误 - 优化函数参数调用/返回值 Dict 转 Schema 类型推导和检查,可以省略 Schema 名称简化配置书写 -- 赋值语句支持形如 _config["key"] = "value" 或 _config.key = "value"的语法对配置进行原地修改 +- 赋值语句支持形如 \_config["key"] = "value" 或 \_config.key = "value"的语法对配置进行原地修改 - 优化配置合并运算符的类型检查,可以在编译时发现更多类型错误 - 修复了 built-in API datetime 中日期格式的问题。 - 修复了 Schema 配置合并参数解析错误的问题。 @@ -156,9 +156,7 @@ PASS: 1/1 "minimum": 0 } }, - "required": [ - "name" - ] + "required": ["name"] } ``` @@ -224,7 +222,7 @@ kcl mod add cc --git https://github.com/kcl-lang/flask-demo-kcl-manifests.git -- - 包管理工具修复了多次添加 git 子包作为依赖时导致的循环依赖问题。 - 包管理工具修复了 metadata 中三方库依赖路径丢失的问题。 - 包管理工具 Add, Update 命令预载了 MVS 版本管理算法,通过环境变量 SupportMVS=true 控制开启。 -- 包管理工具修复了编译多个 *.k 文件失败的 bug。 +- 包管理工具修复了编译多个 \*.k 文件失败的 bug。 - 包管理工具新增部分测试用例。 - KCL tree-sitter 新增 sequence operations, selector 支持。 - KCL tree-sitter 优化了部分语法规则,添加了更多测试用例。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/intellij.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/intellij.md index 45e1b943..a3602853 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/intellij.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/intellij.md @@ -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 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/vs-code.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/vs-code.md index ef1a39f7..b2521c25 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/vs-code.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/tools/Ide/vs-code.md @@ -58,7 +58,7 @@ sidebar_position: 1 ## 已知问题 -[详见](https://github.com/kcl-lang/kcl/issues/524) +[详见](https://github.com/kcl-lang/kcl/issues) ## 寻求帮助 @@ -66,7 +66,7 @@ sidebar_position: 1 ## 参与贡献 -目前 VS Code KCL 插件处于早期版本,我们正在积极改进 VS Code KCL 插件体验,欢迎参考[贡献指南](https://kcl-lang.io/docs/community/contribute) 一起共建! +目前我们正在积极改进 KCL IDE 插件体验,欢迎参考[贡献指南](https://kcl-lang.io/docs/community/contribute) 一起共建! ## 许可 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/getting-started/install.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/getting-started/install.md index f2b12ace..26e87166 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/getting-started/install.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/user_docs/getting-started/install.md @@ -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) diff --git a/versioned_docs/version-0.10/tools/Ide/intellij.md b/versioned_docs/version-0.10/tools/Ide/intellij.md index 51f1825a..1b529bb5 100644 --- a/versioned_docs/version-0.10/tools/Ide/intellij.md +++ b/versioned_docs/version-0.10/tools/Ide/intellij.md @@ -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 diff --git a/versioned_docs/version-0.10/tools/Ide/vs-code.md b/versioned_docs/version-0.10/tools/Ide/vs-code.md index e9717391..6ce4ffba 100644 --- a/versioned_docs/version-0.10/tools/Ide/vs-code.md +++ b/versioned_docs/version-0.10/tools/Ide/vs-code.md @@ -6,15 +6,15 @@ 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 @@ -22,23 +22,23 @@ sidebar_position: 1 ``` - **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). @@ -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 diff --git a/versioned_docs/version-0.10/user_docs/getting-started/install.md b/versioned_docs/version-0.10/user_docs/getting-started/install.md index a10a44c1..ebd31235 100644 --- a/versioned_docs/version-0.10/user_docs/getting-started/install.md +++ b/versioned_docs/version-0.10/user_docs/getting-started/install.md @@ -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)