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

Hover actions debug command will run instead of build #179

Closed
Tired-Fox opened this issue Jan 22, 2024 · 0 comments · Fixed by #180
Closed

Hover actions debug command will run instead of build #179

Tired-Fox opened this issue Jan 22, 2024 · 0 comments · Fixed by #180
Labels
bug Something isn't working

Comments

@Tired-Fox
Copy link
Contributor

Neovim version (nvim -v)

v0.9.4

Operating system/version

Window 10 22H2

Output of :checkhealth rustaceanvim

rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 0.3.1774-standalone (21b06c1be 2023-12-15)
- OK Cargo: found 
- OK rustc: found 
- OK debug adapter: found codelldb 

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

How to reproduce the issue

1. Open a rust file with the plugin loaded
2. Run `:RustLsp hover actions`
3. Select `debug`

Expected behaviour

For the binary to be compiled and for dap to be run.

Actual behaviour

cargo run is executed instead of cargo build this results in No compilation artifacts found error.

The sanitize_command_for_debugging is supposed to replace run with build, but this never occurs. When I added some debugging and logs I found that the sanitize method gets the full table of { cargoArgs={}, cargoExtraArgs={}, executableArgs={}, workspaceRoot='...'} instead of just the cargoArgs list inside the table. The error was found in rust.lua line 33

The minimal config used to reproduce this issue.

-- Minimal nvim config with lazy
-- Assumes a directory in $NVIM_DATA_MINIMAL
-- Start with
--
-- export NVIM_DATA_MINIMAL=$(mktemp -d)
-- export NVIM_APP_NAME="nvim-ht-minimal"
-- nvim -u minimal.lua
--
-- Then exit out of neovim and start again.

-- Ignore default config
local config_path = vim.fn.stdpath('config')
vim.opt.rtp:remove(config_path)

-- Ignore default plugins
local data_path = vim.fn.stdpath('data')
local pack_path = data_path .. '/site'
vim.opt.packpath:remove(pack_path)

-- bootstrap lazy.nvim
data_path = assert(os.getenv('NVIM_DATA_MINIMAL'), '$NVIM_DATA_MINIMAL environment variable not set!')
local lazypath = data_path .. '/lazy/lazy.nvim'
local uv = vim.uv
  ---@diagnostic disable-next-line: deprecated
  or vim.loop
if not uv.fs_stat(lazypath) then
  vim.fn.system {
    'git',
    'clone',
    '--filter=blob:none',
    'git@github.com:folke/lazy.nvim.git',
    '--branch=stable',
    lazypath,
  }
end
vim.opt.rtp:prepend(lazypath)

local lazy = require('lazy')

lazy.setup({
  {
    'mrcjkb/rustaceanvim',
    version = '^3',
    init = function()
      -- Configure rustaceanvim here
      vim.g.rustaceanvim = {}
    end,
    ft = { 'rust' },
  },
  -- Add any other plugins needed to reproduce the issue.
  -- see https://github.com/folke/lazy.nvim#-lazynvim for details.
}, { root = data_path, state = data_path .. '/lazy-state.json', lockfile = data_path .. '/lazy-lock.json' })
@Tired-Fox Tired-Fox added the bug Something isn't working label Jan 22, 2024
@Tired-Fox Tired-Fox changed the title Hover actions debug command will run instead of debugging Hover actions debug command will run instead of build Jan 22, 2024
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.

1 participant