rcarriga / nvim-dap-ui

A UI for nvim-dap
MIT License
2.57k stars 93 forks source link

Seeing one too many `dap>` REPL prompts on each evaluation #308

Closed Olical closed 9 months ago

Olical commented 9 months ago

Hi there! Thank you for the amazing work you've put into this plugin. It's inspired me to work on clojure-dap, a backend for my language of choice, Clojure.

I've just got to the point where I have evaluations working in the REPL but I've noticed that I see one too many dap> prompts on each evaluation. Is this known or expected?

image

Here's the DAP logs that show the request going out, my system RECVing the message and SENDing (my logging adds these verb marked lines through stderr logging) a response. I don't see any duplicates here but as you can see from the screenshot I do see duplicate prompts.

[ DEBUG ] 2023-11-28T18:14:12Z+0000 ] ...ical/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1580 ]    "request"   {
  arguments = {
    context = "repl",
    expression = "20"
  },
  command = "evaluate",
  seq = 18,
  type = "request"
}
[ ERROR ] 2023-11-28T18:14:12Z+0000 ] ...ical/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1334 ]    "stderr"    {
  args = {},
  command = "/home/olical/repos/Olical/clojure-dap/script/run",
  options = {
    initialize_timeout_sec = 20,
    source_filetype = "clojure"
  },
  type = "executable"
}   '2023-11-28T18:14:12.167Z - TRACE [clojure-dap.server:105] - RECV {:arguments {:expression "20", :context "repl"}, :command "evaluate", :type "request", :seq 18}\n'
[ ERROR ] 2023-11-28T18:14:12Z+0000 ] ...ical/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1334 ]    "stderr"    {
  args = {},
  command = "/home/olical/repos/Olical/clojure-dap/script/run",
  options = {
    initialize_timeout_sec = 20,
    source_filetype = "clojure"
  },
  type = "executable"
}   '2023-11-28T18:14:12.177Z - TRACE [clojure-dap.server:88] - SEND {:type "response", :command "evaluate", :seq 20, :request_seq 18, :success true, :body {:variablesReference 0, :result "20"}}\n'
[ DEBUG ] 2023-11-28T18:14:12Z+0000 ] ...ical/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:935 ] 2   {
  body = {
    result = "20",
    variablesReference = 0
  },
  command = "evaluate",
  request_seq = 18,
  seq = 20,
  success = true,
  type = "response"
}

I don't have another language set up to test with right now, if you have one to hand maybe you can check if you can reproduce it? If you can then we know it's a DAP UI thing, if not then I guess there's something I'm doing on the backend that's weird or different. I'm following the spec closely and running everything through their JSON schema so I hope not!

Thanks a lot!

rcarriga commented 9 months ago

I've never seen this before so not sure what the issue is. The REPL is actually all nvim-dap, nvim-dap-ui just controls the window so you'd be better opening an issue there if you can't figure it out :smile:

Olical commented 9 months ago

Thanks for getting back to me! I'll go raise an issue there, will close this one for now.