Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua error executing Debug from RustLsp hover actions #32

Closed
naxgrp-jfulton opened this issue Oct 31, 2023 · 1 comment · Fixed by #33
Closed

Lua error executing Debug from RustLsp hover actions #32

naxgrp-jfulton opened this issue Oct 31, 2023 · 1 comment · Fixed by #33
Labels
bug Something isn't working

Comments

@naxgrp-jfulton
Copy link

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' },
  },
}
@naxgrp-jfulton naxgrp-jfulton added the bug Something isn't working label Oct 31, 2023
@mrcjkb
Copy link
Owner

mrcjkb commented Oct 31, 2023

Hey 👋

Thanks for the detailed report.
I'll release the fix in a few hours, when I'm on my laptop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants