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

Rails support #25

Open
duduribeiro opened this issue Oct 25, 2022 · 1 comment
Open

Rails support #25

duduribeiro opened this issue Oct 25, 2022 · 1 comment

Comments

@duduribeiro
Copy link

Hey folks 👋

I've created a dap adapter / config that I could run a rails debugging flow but I don't know the best idea to integrate with nvim-dap-ruby

basically I did this:

  dap.adapters.ruby = {
    type = 'server';
    port = "1234";
    command = '/path/to/rails/app/bin/rdbg';
    args = {"--open", "--port", "1234", "--"};
    -- useBundler = true;
  }
  --
  dap.configurations.ruby = {
    {
      type = 'ruby';
      request = 'launch';
      name = 'ruby debug: start rails';
      command = 'bin/rails s';
      useBundler = true;
    },
  }

With this config I could run the debugger BUT I needed to manually start the process on another terminal with rdbg --command --open --stop-at-load --port 1234 -- bin/rails s.

Any tips on how can I configure my adapter / configuration to execute this for me? 😄

Gravacao.de.Tela.2022-10-25.as.18.23.15.mov

this is the video of it working. one annoying stuff that I noted is that when I start the debug process, it looses the syntax highlights and IDK why.

Do u think it is feasible to run dap support for rails with debug gem like I tried to made?

@hahuang65
Copy link

hahuang65 commented Mar 28, 2023

I was able to get this to work by adding the following to dap.configurations.ruby:

      {
        type = "ruby",
        name = "debug rails server",
        bundle = "bundle",
        request = "attach",
        command = "rails",
        script = "server",
        port = 38698,
        server = "127.0.0.1",
        options = {
          source_filetype = "ruby",
        },
        localfs = true,
        waiting = 1000,
      },

However, the issue is, the server continues to run after the debugging session ends, resulting in a need to kill that server in order to start a new debug session (which happens fairly frequently, as you can't seem to add more breakpoints once you start).

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

No branches or pull requests

2 participants