Save nvim-dap breakpoints with session
#402
Replies: 4 comments 2 replies
|
That's pretty cool @laoumh. This could be a good addition to the wiki, and we could mention it in a new "advanced hooks usage" section in the README as well |
|
@rmagatti ok, I'll make a wiki addition. Any naming suggestion for the top page, like "Recipes" or "Command Hooks"? |
|
Hello @rmagatti! It seems the workflow for Wikis is a little different, I can't directly open a PR to it. And, right now, it seems the Wiki isn't open for external editing. From the Docs:
There is a convoluted suggestion to recreate the Wiki in my own fork, make the changes and submit the link, but you would have to merge the changes yourself. So, would you like to open the Wiki for community editing or for yourself to merge the addition? |
|
We now support saving extra data along with a session and have a recipe for saving DAP breakpoints in the readme |
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone!
I just wrote a little module to save
nvim-dapbreakpoints along with the session. The solution is based off of mfussenegger/nvim-dap#198 (comment) and usesauto-session's Command Hooks to trigger saving, loading and deleting the breakpoints file.Module intended behavior:
.jsonfile with the same name and in the same dir as the session.vimfile (including named sessions)nvim-dapdepends that the file is loaded to a buffer to set a breakpoint in it.What made writing this module seamless were functions like
current_session_name(), made available atauto-session.lib, and the command hooks feature, that allow triggering actions at save, restore and delete session events.Here is the code:
Then attach the module functions to the command hooks when setting up
auto-sessions:Suggestions and corrections are welcomed!
All reactions