Documentation
¶
Overview ¶
Package rust is the Rust language pack (SPEC §8.1, §10.15, §10.34): Rust. The grammars and language configurations are in assets/, copied by scripts/update-assets.sh; the licenses are in third_party/ and NOTICE. Since step 24b.2 the pack also runs rust-analyzer: the server is found, started and shown by extensions/internal/langserver (the path setting rust-analyzer.server.path, PATH, ~/.cargo/bin, the status item, the notification for a missing server), the settings of rust-analyzer's VS Code extension that change the server are registered (ra-settings.json, written by scripts/update-rust-analyzer-settings.sh) and sent to it, and the pack adds the commands Expand macro recursively at caret and View Syntax Tree (the result in a read-only tab), Locate parent module, Open Cargo.toml, Join lines, Find matching brace, Reload workspace and Restart server, the Run lenses (which run through the Tasks extension) and rust-analyzer's own status (experimental/serverStatus) in the status item. Since step 25.9 the pack also adds the Rust targets of cargo to the debuggers gdb and lldb-dap, which the C and C++ pack owns, and builds a program before it is debugged (debug.go). Since step 26.7 the pack is also the Testing provider of Rust (testctl.go, testexec.go, testlibtest.go, testsrc.go; SPEC §10.32): the controller "cargo" finds the tests with `cargo test -- --list`, runs them with `cargo test` and reads libtest's output, and debugs them with gdb or lldb-dap.
Index ¶
Constants ¶
const ( // ID is the id of the extension, and ServerID the id of the language server rust-analyzer in its manifest. ID = "emetos.rust" ServerID = "rust-analyzer" // PathSetting holds the path of the rust-analyzer program (the name VS Code's extension gives it). PathSetting = "rust-analyzer.server.path" // TraceSetting traces the traffic with the server (the name VS Code's extension gives it). TraceSetting = "rust-analyzer.trace.server" // SettingPrefix starts the key of every setting of rust-analyzer. SettingPrefix = "rust-analyzer." )
The ids of the extension.
const ( // ExpandMacroCommand shows the expansion of the macro at the cursor in a read-only tab. ExpandMacroCommand = "rust-analyzer.expandMacro" // ViewSyntaxTreeCommand shows the syntax tree of the file (or the selection) in a read-only tab. ViewSyntaxTreeCommand = "rust-analyzer.viewSyntaxTree" // ParentModuleCommand goes to the module that declares the one of the file. ParentModuleCommand = "rust-analyzer.parentModule" // OpenCargoTomlCommand opens the Cargo.toml of the package of the file. OpenCargoTomlCommand = "rust-analyzer.openCargoToml" // JoinLinesCommand joins the lines of the selections the way rust-analyzer does (it removes the braces and semicolons a join leaves). JoinLinesCommand = "rust-analyzer.joinLines" // MatchingBraceCommand moves the cursor to the bracket that matches the one at it. MatchingBraceCommand = "rust-analyzer.matchingBrace" // ReloadWorkspaceCommand makes rust-analyzer read the Cargo workspace again. ReloadWorkspaceCommand = "rust-analyzer.reloadWorkspace" // RestartServerCommand restarts rust-analyzer. RestartServerCommand = "rust-analyzer.restartServer" )
The commands of the pack, with the ids of rust-analyzer's VS Code extension.
const ( // TestControllerID is the id of the controller and TestControllerLabel its name. TestControllerID = "cargo" TestControllerLabel = "Cargo" // RunnablesExtraArgsSetting holds the arguments added to the cargo of a run (rust-analyzer's setting of that name). RunnablesExtraArgsSetting = "rust-analyzer.runnables.extraArgs" )
The names of the controller and of its two run profiles.
const ContentScheme = "rust-analyzer"
ContentScheme is the scheme of the read-only documents the pack provides (the expansion of a macro, the syntax tree).
const RunTaskCommand = "emetos.tasks.run"
RunTaskCommand is the command of the Tasks extension that runs a command line.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.