{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions…
- User
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Dev-CompileRun", "cargo": { "args": [""] }, // task for the
beforeDevCommandif used, must be configured in.vscode/tasks.json"preLaunchTask": "ui:dev" }, { "type": "lldb", "request": "launch", "name": "Release-CompileBinary", "cargo": { "args": [""] }, // task for thebeforeBuildCommandif used, must be configured in.vscode/tasks.json"preLaunchTask": "ui:build" }, { "type": "lldb", "request": "launch", "name": "Linux-CrossCompileBinary", "cargo": { "args": [""] }, "preLaunchTask": "ui:build-windows-arch" } ] } * Executing task: CodeLLDB: cargoRunning
cargo --message-format=json... error: no such command: ``Did you mean `b`? View all installed commands with `cargo --list` Find a package to install `` with `cargo search cargo-`Error: Cargo invocation failed. at t.Cargo.getCargoArtifacts (/home/caua/.vscode-insiders/extensions/vadimcn.vscode-lldb-1.10.0/extension.js:1:14943) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.open (/home/caua/.vscode-insiders/extensions/vadimcn.vscode-lldb-1.10.0/extension.js:1:13253) Caused by: Error: exit code: 101. at ChildProcess. (/home/caua/.vscode-insiders/extensions/vadimcn.vscode-lldb-1.10.0/extension.js:1:16610) at ChildProcess.emit (node:events:519:28) at maybeClose (node:internal/child_process:1105:16) at ChildProcess._handle.onexit (node:internal/child_process:305:5)
- The terminal process failed to launch (exit code: 1).
- Terminal will be reused by tasks, press any key to close it.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "ui:dev",
"type": "shell",
//
devkeeps running in the background // ideally you should also configure aproblemMatcher// see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson "isBackground": true, // change this to yourbeforeDevCommand: "command": "cargo tauri", "args": ["dev"] }, { "label": "ui:build", "type": "shell", // change this to yourbeforeBuildCommand: "command": "NO_STRIP=true cargo tauri", "args": ["build"] }, { "label": "ui:build-windows-arch", "type": "shell", "command": "cargo tauri", "args": ["build --runner cargo-xwin --target x86_64-pc-windows-msvc"] } ] }
- Assistant
It looks like you're encountering an error because your
cargocommand is being invoked with an empty string as a subcommand, which is causing thecargotool to fail. The error message indicates thatcargodoesn't recognize an empty command:error: no such command: ``This is happening because in your
launch.json, you're specifying an empty string in theargsarray for yourcargoconfiguration:"cargo": { "args": [""] }When you include an empty string in the
argsarray, it translates tocargo "" --message-format=json, which is not a valid command.cargoexpects a subcommand likebuild,run,test, etc.Here's how you can fix the issue:
-
Remove or Correct the Empty
argsArrays inlaunch.json:In your
launch.json, for each configuration under"configurations", remove theargsarray if you don't need to pass any arguments, or specify the correct subcommand you wantcargoto execute. For example:{ "type": "lldb", "request": "launch", "name": "Dev-CompileRun", "cargo": { "args": ["build"] }, "preLaunchTask": "ui:dev" },Or, if you don't need to pass any arguments to
cargo, simply remove theargskey:{ "type": "lldb", "request": "launch", "name": "Dev-CompileRun", "cargo": {}, "preLaunchTask": "ui:dev" }, -
Specify the Correct Command in
tasks.json(if needed):In your
tasks.json, ensure that theargsarray correctly separates each argument. For example, in yourui:build-windows-archtask, you should split the arguments:{ "label": "ui:build-windows-arch", "type": "shell", "command": "cargo tauri", "args": [ "build", "--runner", "cargo-xwin", "--target", "x86_64-pc-windows-msvc" ] }This ensures that each argument is correctly passed to the command.
-
Check Your
preLaunchTaskDefinitions:Make sure that the tasks referenced in
"preLaunchTask"are correctly defined in yourtasks.jsonand that they execute successfully. These tasks should build your project before launching the debugger. -
Ensure LLDB Configuration is Correct:
If you want LLDB to debug a binary produced by
cargo, you might need to specify theprogrampath and thecwd. Here's an example:{ "type": "lldb", "request": "launch", "name": "Dev-CompileRun", "program": "${workspaceFolder}/target/debug/your_executable_name", "args": [], "cwd": "${workspaceFolder}", "preLaunchTask": "ui:dev" },Replace
your_executable_namewith the actual name of your binary.
Explanation:
- The empty string
""in theargsarray is causingcargoto interpret it as an empty subcommand. cargorequires a valid subcommand to execute (likebuild,run,test, etc.).- By removing the empty string or specifying the correct subcommand, you ensure that
cargois invoked correctly.
Additional Tips:
- When specifying arguments in arrays (like
args), ensure that each argument is a separate element in the array. - Always check the documentation of the tools and extensions you're using. In this case, the CodeLLDB extension documentation provides guidance on how to configure
cargobuilds.
Example of Corrected
launch.json:{ "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Dev-CompileRun", "cargo": { "args": ["build"] }, "preLaunchTask": "ui:dev" }, { "type": "lldb", "request": "launch", "name": "Release-CompileBinary", "cargo": { "args": ["build", "--release"] }, "preLaunchTask": "ui:build" }, { "type": "lldb", "request": "launch", "name": "Linux-CrossCompileBinary", "cargo": { "args": [ "build", "--target", "x86_64-pc-windows-msvc" ] }, "preLaunchTask": "ui:build-windows-arch" } ] }Summary:
- Remove empty strings from
argsarrays inlaunch.json. - Ensure
cargois invoked with valid subcommands. - Correctly specify
argsin bothlaunch.jsonandtasks.json. - Review your configurations and adjust them according to the documentation.
By making these changes, you should be able to resolve the error and successfully run your tasks and debug your application.
-