jay-babu / mason-nvim-dap.nvim

GNU Affero General Public License v3.0
551 stars 39 forks source link

How can I config RUST configuration with mason-dap #92

Closed duanyuluo closed 1 year ago

duanyuluo commented 1 year ago

HI, I have a problem of config rust dap. I want to add my configuration for launching and use mason-dap's default adapter config(you known rust adapter config is complex...).

FYI: 1) I leave codelldb in ensure_installed due to mason-dap map the rust filetype to codelldb and config codelldb adapter. 2) I can debug correctly these rust cargo projects without these new configuration. So I think rust-tool and codelldb debug server is OK.

error is: Failed to run config for rust-tools.nvim

...l/share/nvim/lazy/mason.nvim/lua/mason-registry/init.lua:80: Cannot find package "codelldb".

stacktrace:

lua code are below...

{
    "jay-babu/mason-nvim-dap.nvim",
    require("mason-nvim-dap").setup {
      automatic_setup = true,
      ensure_installed = {
        "python",
        "codelldb",
      },
      handlers = {
        function(config)
          -- all sources with no handler get passed here
          -- Keep original functionality
          require("mason-nvim-dap").default_setup(config)
        end,
        codelldb = function(config)
          config.configurations = {
            {
              name = "LLDB: Launch(codellde.log ENABLED)",
              type = "codelldb",
              request = "launch",
              program = function()
                return vim.fn.input(">>Path to executable: ", vim.fn.getcwd() .. "/target/debug/", "file")
              end,
              cwd = "${workspaceFolder}",
              stopOnEntry = true,
              args = {
                -- https://github.com/vadimcn/codelldb/wiki/LLDB-Logging
                -- initCommands = { "log enable gdb-remote default", "log enable lldb default" },
              },
            },
          }
          require("mason-nvim-dap").default_setup(config) -- don't forget this!
        end,
      },
    },
  },
}
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

Je12emy commented 1 year ago

bump

AddictArts commented 7 months ago

Hopefully you found this https://github.com/mrcjkb/rustaceanvim