atxtechbro / atxtechbro/dotfiles

feat(nvim): implement DAP breakpoint persistence across Neovim sessions

Open
#372 0 comments 0 reactions 0 assignees View on GitHub
debugging enhancement neovim
Dominant language
Shell
Stars
27
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Description

Currently, when Neovim is closed and reopened, all DAP (Debug Adapter Protocol) breakpoints are lost. This creates a frustrating workflow where developers need to recreate their breakpoints each time they restart Neovim.

This issue proposes implementing proper breakpoint persistence across Neovim sessions, allowing developers to maintain their debugging context between editor restarts.

## Proposed Implementation

Create a module that handles:

1. **Saving breakpoints** when Neovim exits:
- Capture all breakpoints using `require('dap.breakpoints').get()`
- Serialize them to a JSON file in the Neovim data directory
- Include file paths, line numbers, and breakpoint conditions

2. **Loading breakpoints** when Neovim starts:
- Read the saved JSON file on startup
- Restore breakpoints to their respective files and lines
- Preserve any conditions or hit counts

3. **Manual control**:
- Add keybindings to manually save/load breakpoints
- Add commands to clear persistent breakpoints if needed

## Technical Considerations

- The implementation should handle cases where files have moved or been renamed
- It should work with multiple different language adapters
- Breakpoint conditions and other properties should be preserved
- The solution should be compatible with the latest nvim-dap API

## Benefits

- Improved developer experience with persistent debugging context
- Reduced setup time when returning to a debugging session
- Consistent with how other IDEs handle breakpoints

## Related Work

This was initially attempted as part of PR #371 but was separated out as it deserves its own focused implementation at the appropriate level of the stack.

## References

- [nvim-dap breakpoints API documentation](https://github.com/mfussenegger/nvim-dap/blob/master/doc/dap.txt)
- [Similar feature in VS Code](https://code.visualstudio.com/docs/editor/debugging#_breakpoints)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the nvim-dap breakpoints API, especially require('dap.breakpoints').get(); the issue names no repository files, tests, or startup entry point. Determine how persistence, manual save/load, clearing, moved files, and adapter-independent breakpoint properties should be handled, then verify they survive a Neovim restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
neovim
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.