LunarVim/starter.lvim

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

sahina opened this issue · 0 comments

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