Configure custom dap events? #1259
Replies: 2 comments 5 replies
-
It's possible to listen to any
Make sure to add the plugin-id key, and it must be a function: local dap = require("dap")
dap.listeners.before["event_probe-rs-rtt-channel-config"]["my-plugin"] = function(session, body)
end |
Beta Was this translation helpful? Give feedback.
-
I think I managed to get it as far as I could. There might be nicer solutions to get it enabled, and potential stuff like a down channel is not easily achievable, but so far it works. Will provide a config for the wiki soon. |
Beta Was this translation helpful? Give feedback.
-
I started configuring probe-rs for nvim-dap. This is a tool for embedded rust development.
I managed to get it running. But there is one feature I couldn't make use of yet and I don't know whether it's achievable at the moment.
probe-rs allows to configure rtt to provide some debug messages, prints etc. Since rtt is not available in dap, they use dap events to make the messages available over dap for their vscode plugin.
I had a look at the docs for nvim-dap and the event listener. To my understanding those are predefined events. Would it be possible to listen to other events and print them to the dap output or spawn an output terminal?
I looked in the dap.log and found the following:
the dap.listerners contain
in before and after.
Edit:
I managed to listen to the events and write out contents of the events. Writing (or logging?) them into the repl terminal would be nicer.
The biggest issue is that the event "event_probe-rs-rtt-channel-config" expects a dap response. If no response is send the debugger will not sent consecutive events for the rtt data. I opened a feature request to create dap respnses from listeners.
Beta Was this translation helpful? Give feedback.
All reactions