Skip to content

E5108: Error executing lua [string ":lua"]:1: attempt to call global '_CARGO_TEST' (a nil value)  #44

Open
@sahina

Description

@sahina

When I execute Cargo test shortcut here

lvim.builtin.which_key.mappings["R"] = {
  name = "Rust",
  r = { "<cmd>RustRunnables<Cr>", "Runnables" },
  t = { "<cmd>lua _CARGO_TEST()<cr>", "Cargo Test" },
  m = { "<cmd>RustExpandMacro<Cr>", "Expand Macro" },
  c = { "<cmd>RustOpenCargo<Cr>", "Open Cargo" },
  p = { "<cmd>RustParentModule<Cr>", "Parent Module" },
  d = { "<cmd>RustDebuggables<Cr>", "Debuggables" },
  v = { "<cmd>RustViewCrateGraph<Cr>", "View Crate Graph" },
  R = {
    "<cmd>lua require('rust-tools/workspace_refresh')._reload_workspace_from_cargo_toml()<Cr>",
    "Reload Workspace",
  },
  o = { "<cmd>RustOpenExternalDocs<Cr>", "Open External Docs" },
} 

I see this error below:

E5108: Error executing lua [string ":lua"]:1: attempt to call global '_CARGO_TEST' (a nil value)                                                                                              
stack traceback:                                                                                                                                                                              
        [string ":lua"]:1: in main chunk                                                                                                                                                      
Press ENTER or type command to continue    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions