1.3 Fuel工具链 (The Fuel Toolchain)

The Fuel toolchain consists of several components.

Fuel 工具链由几个组件组成。

Forc (forc)

The "Fuel Orchestrator" Forcarrow-up-right is our equivalent of Rust's Cargoarrow-up-right. It is the primary entry point for creating, building, testing, and deploying Sway projects.

“Fuel Orchestrator”Forcarrow-up-right 相当于 Rust 的Cargoarrow-up-right.它是创建、构建、测试和部署 Sway 项目的主要入口点。

Sway语言服务(forc-lsp)-Sway Language Server (forc-lsp)

The Sway Language Server forc-lsp is provided to expose features to IDEs. Installation instructionsarrow-up-right.

提供 Sway 语言服务器forc-lsp 以向 IDE 公开功能。您可查看 安装说明arrow-up-right

Currently, only Visual Studio Code is supported through a pluginarrow-up-right. Vim support is forthcoming, though syntax highlighting is providedarrow-up-right.

目前,仅通过插件支持 Visual Studio Codearrow-up-right。 Vim 支持即将推出,不过目前也 提供了语法高亮显示arrow-up-right

Note: There is no need to manually run forc-lsp (the plugin will automatically start it), however both forc and forc-lsp must be in your $PATH. To check if forc is in your $PATH, type forc --help in your terminal.

注意:无需手动运行forc-lsp(插件会自动启动),但是forcforc-lsp 都必须在您的$PATH 中。要检查 forc 是否在您的 $PATH 中,请在终端中键入 forc --help

Sway 格式化程序(forc-fmt) - Sway Formatter (forc-fmt)

A canonical formatter is provided with forc-fmt. Installation instructionsarrow-up-right. It can be run manually with

forc-fmt 提供了规范的格式化程序。您可查看 安装说明arrow-up-right。它可以用以下命令手动运行

The Visual Studio Code pluginarrow-up-right will automatically format Sway files with forc-fmt on save, though you might have to explicitly set the Sway plugin as the default formatter, like this:

Visual Studio Code 插件arrow-up-right 将在保存时,自动使用 forc-fmt 格式化 Sway 文件,尽管您可能必须明确用以下方式将 Sway 插件设置为默认的格式化程序:

Fuel核心-Fuel Core (fuel-core)

An implementation of the Fuel protocol, Fuel Corearrow-up-right, is provided together with the Sway toolchain to form the Fuel toolchain. The Rust SDKarrow-up-right will automatically start and stop an instance of the node during tests, so there is no need to manually run a node unless using Forc directly without the SDK.

Fuel 协议的实现 Fuel Corearrow-up-rightSway 工具链 一起提,进而形成 Fuel 工具链Rust SDKarrow-up-right 会在测试期间自动启动和停止节点实例,因此无需手动运行节点,除非在没有 SDK 的情况下直接使用 Forc .

Last updated