next edit prediction via lsp by dlants · Pull Request #162 · dlants/magenta.nvim

2 min read Original article ↗

@dlants marked this pull request as ready for review

July 26, 2025 02:30

@dlants dlants changed the title edit prediction via lsp next edit prediction via lsp

Jul 26, 2025

Denis Lantsman added 14 commits

July 25, 2025 22:47
…tomization

- Add token budget control for recent changes to prevent context overflow
- Support custom system prompts and prompt append options
- Add predictionModel configuration option for profiles
- Improve prediction accuracy with better cursor handling and find text resolution
- Show 'completing...' indicator during predictions
- Add comprehensive test coverage for token budget and change selection
- Update documentation with new configuration options and keybindings
- Add cursor-utils module with selectBestPredictionLocation logic
- Prefer matches that contain the cursor position
- For matches not containing cursor, select first match after cursor
- Fall back to closest match before cursor when none exist after
- Replace complex test with focused unit tests for match selection
- Fix virtual text preview timing by using predicate-based extmark waiting
- Improve test stability and reduce flakiness
- Update snapshots to reflect formatting changes
- Clarify that predictions can be dismissed by exiting insert mode or pressing Esc in normal mode
- This reflects the actual behavior where predictions are auto-dismissed when leaving insert mode
- Replace vim's LSP client debouncing with custom implementation
- Group and batch changes by file path for more efficient processing
- Switch from fastModel to regular model for better prediction quality
- Update test infrastructure to support changeDebounceMs option
- Fix edge case in cleanup_prediction_esc_mapping for missing rhs
- Update documentation to reflect model selection changes
- Add new test for LSP debouncing behavior during continuous typing

@dlants dlants deleted the dlants-edit-prediction-lsp branch

July 26, 2025 06:42