1.3 Fuel工具链 (The Fuel Toolchain)
The Fuel toolchain consists of several components.
Fuel 工具链由几个组件组成。
Forc (forc
)
forc
)The "Fuel Orchestrator" Forc is our equivalent of Rust's Cargo. It is the primary entry point for creating, building, testing, and deploying Sway projects.
“Fuel Orchestrator”Forc 相当于 Rust 的Cargo.它是创建、构建、测试和部署 Sway 项目的主要入口点。
Sway语言服务(forc-lsp
)-Sway Language Server (forc-lsp
)
forc-lsp
)-Sway Language Server (forc-lsp
)The Sway Language Server forc-lsp
is provided to expose features to IDEs. Installation instructions.
提供 Sway 语言服务器forc-lsp
以向 IDE 公开功能。您可查看 安装说明。
Currently, only Visual Studio Code is supported through a plugin. Vim support is forthcoming, though syntax highlighting is provided.
目前,仅通过插件支持 Visual Studio Code。 Vim 支持即将推出,不过目前也 提供了语法高亮显示。
Note: There is no need to manually run
forc-lsp
(the plugin will automatically start it), however bothforc
andforc-lsp
must be in your$PATH
. To check ifforc
is in your$PATH
, typeforc --help
in your terminal.注意:无需手动运行
forc-lsp
(插件会自动启动),但是forc
和forc-lsp
都必须在您的$PATH
中。要检查forc
是否在您的$PATH
中,请在终端中键入forc --help
。
Sway 格式化程序(forc-fmt
) - Sway Formatter (forc-fmt
)
forc-fmt
) - Sway Formatter (forc-fmt
)A canonical formatter is provided with forc-fmt
. Installation instructions. It can be run manually with
forc-fmt
提供了规范的格式化程序。您可查看 安装说明。它可以用以下命令手动运行
The Visual Studio Code plugin 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 插件 将在保存时,自动使用 forc-fmt
格式化 Sway 文件,尽管您可能必须明确用以下方式将 Sway 插件设置为默认的格式化程序:
Fuel核心-Fuel Core (fuel-core
)
fuel-core
)An implementation of the Fuel protocol, Fuel Core, is provided together with the Sway toolchain to form the Fuel toolchain. The Rust SDK 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 Core 与 Sway 工具链 一起提,进而形成 Fuel 工具链。 Rust SDK 会在测试期间自动启动和停止节点实例,因此无需手动运行节点,除非在没有 SDK 的情况下直接使用 Forc .
Last updated