snippets.nvim
snippets.nvim copied to clipboard
MVP checklist
Here's a list of features necessary for me to switch to this library as a daily driver.
- [x] Parse the snippet inside
expand_snippet(snippet). The argument should either be a snippet AST, or a string to be parsed. - [ ] Handle escapes in the
take_untilcombinator. Namely\$,\\\$etc. Need scan backwards from the match and count the number of slashes (odd = escaped). - [ ] Match the indentation level. Figure out the current indentation level, then apply it to all the snippet lines.
- [ ] Expand placeholders that nest more content. Currently we just take the first node, need to loop over recursively.
- [ ] Handle those internal stops being overwritten (TextChanged should remove entries that have a nil range == missing marks)
- [ ] Same thing for stops being deleted by the user (filter these inside jump)
- [ ] Handle those internal stops being overwritten (TextChanged should remove entries that have a nil range == missing marks)
- [ ] Handle
$0, the last tabstop to jump to whenfinalize_snippet()is called. Should not be reachable if jumping from$1backwards. - [ ] Snippet loading mechanism, check how to integrate honza/vim-snippets. Need to populate into memory based on filetype, parsing out the
.snippetsfile format. - [ ] Correctly handle expanding a second snippet while modifying a tabstop. VSCode merges the snippet into place, inserting tabstops at the current position, that way we can correctly jump back and forth over tabstops from both snippets.
Lastly
- [ ] Add completion-nvim integration hook, calling
expand_snippet(string)