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

fix: update nvim-dap-ruby strategy config #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cpb
Copy link

@cpb cpb commented Aug 17, 2024

Why?

I get an error message:

Config needs the request property which must be one of attach or launch

out-of-the-box.mov

What?

  1. References nvim-dap-ruby's base ruby adapter configurations to resolve the above error message by adding request = "attach", to the return of get_strategy_config
  2. Suppresses exit code 1 notices from nvim-dap-ruby by configuring error_on_failure = false
  3. Copies the localfs = true, and waiting = 1000 configuration to match the nvim-dap-ruby's base run configuration

Demo

  1. Setting a breakpoint
  2. Running neotest with dap strategy
  3. nvim-dap-ui pops up
  4. Continue from the break point
  5. Observe test failure
neotest-rspec-dap-strategy-demo.mov

Possible with the following Lazy configuration:

return {
  {
    "nvim-neotest/neotest",
    dependencies = {
      {
        "cpb/neotest-rspec",
        branch = "cpb/update-dap-strategy",
      },
      "nvim-neotest/nvim-nio",
      "nvim-lua/plenary.nvim",
      "antoinemadec/FixCursorHold.nvim",
      "nvim-treesitter/nvim-treesitter",
    },
    config = function()
      require("neotest").setup({
        adapters = {
          require("neotest-rspec")({
            rspec_cmd = function()
              return vim.tbl_flatten({
                "bundle",
                "exec",
                "rdbg",
                "--nonstop",
                "-c",
                "--",
                "rspec",
              })
            end,
          }),
        },
      })
    end,
  },
}

@cpb cpb marked this pull request as ready for review August 17, 2024 20:25
@elken
Copy link
Contributor

elken commented Aug 18, 2024

Do we want to add documentation to clarify the configuration options for getting debug to run?

@smarquez1
Copy link

smarquez1 commented Sep 19, 2024

@elken I think it's a good idea!

@olimorris
Copy link
Owner

Hi All. Apologies for missing this first time around. Does this require any additional updates to work? Can't say I use nvim-dap-ruby these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants