tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter
MIT License
176 stars 58 forks source link

eruby with comments 3 orders of magnitude slower #241

Open 9mm opened 1 year ago

9mm commented 1 year ago

If I open a ~100 line html file with embedded ruby (setf eruby)...

If this file contains a # comment within ERB tags somewhere in the file, it creates 2 problems:

  1. Neovim slows down by at least 100-1000x. It's so bad theres like a 200ms delay typing a single letter. If you try to use j/k to scroll it's extremely choppy like you're editing a 2 million line file.

  2. The comments are just wrong. A comment must end at the %> of the embedded ruby tag, but they keep going to all embedded ruby contained within the entire file. Here's a screenshot showing an example, notice the this should not be commented is not preceded by a #, and it's still commented from the few lines above

image