Skip to content

Lua error executing Debug from RustLsp hover actions #32

@naxgrp-jfulton

Description

@naxgrp-jfulton

Neovim version (nvim -v)

v0.9.4

Operating system/version

MacOS Ventura

Output of :checkhealth rustaceanvim

Ok

How to reproduce the issue

cargo new --bin hello-world
mkdir -p /tmp/minimal/
NVIM_DATA_MINIMAL="/tmp/minimal" NVIM_APP_NAME="nvim-minimal" nvim -u minimal.lua
:edit src/main.rs
lll
:RustLsp hover actions
<C-w><C-w>
jj<cr>

Expected behaviour

Do some debugging

Actual behaviour

Compiling a debug build for debugging. This might take some time...
E5108: Error executing lua: .../data/nvim/lazy/rustaceanvim/lua/rustaceanvim/compat.lua:23: attempt to index local 'opts' (a ni
l value)
stack traceback:
        .../data/nvim/lazy/rustaceanvim/lua/rustaceanvim/compat.lua:23: in function 'system'
        ...bug/data/nvim/lazy/rustaceanvim/lua/rustaceanvim/dap.lua:63: in function 'get_rustc_commit_hash'
        ...bug/data/nvim/lazy/rustaceanvim/lua/rustaceanvim/dap.lua:95: in function 'generate_source_map'
        ...bug/data/nvim/lazy/rustaceanvim/lua/rustaceanvim/dap.lua:111: in function 'start'
        ...vims/debug/data/nvim/lazy/rustaceanvim/ftplugin/rust.lua:31: in function 'fn'
        ...vim/lazy/rustaceanvim/lua/rustaceanvim/hover_actions.lua:20: in function 'execute_rust_analyzer_command'
        ...vim/lazy/rustaceanvim/lua/rustaceanvim/hover_actions.lua:38: in function 'run_command'
        ...vim/lazy/rustaceanvim/lua/rustaceanvim/hover_actions.lua:120: in function <...vim/lazy/rustaceanvim/lua/rustaceanvim
/hover_actions.lua:119>

The minimal config used to reproduce this issue.

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup{
    {
    'mrcjkb/rustaceanvim',
    "mfussenegger/nvim-dap",
    version = '^3',
    init = function()
      -- Configure rustaceanvim here
      vim.g.rustaceanvim = {}
    end,
    ft = { 'rust' },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions