snippets.nvim icon indicating copy to clipboard operation
snippets.nvim copied to clipboard

MVP checklist

Open archseer opened this issue 5 years ago • 0 comments

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_until combinator. 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 $0, the last tabstop to jump to when finalize_snippet() is called. Should not be reachable if jumping from $1 backwards.
  • [ ] Snippet loading mechanism, check how to integrate honza/vim-snippets. Need to populate into memory based on filetype, parsing out the .snippets file 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)

archseer avatar May 12 '20 10:05 archseer