[language-ruby] Fix our attempt to fold Ruby comments…

…so that it doesn’t try to look up a child node that we know won’t exist.

Most Ruby comments aren’t foldable because they start and end on the same line — by their very nature! But there is one obscure multi-line syntax that we can support, so this tells Pulsar to fold to the end of the comment itself.
This commit is contained in:
Andrew Dupont 2024-06-13 14:09:23 -07:00
parent b61e491f2e
commit ef26c588a3

View File

@ -1,6 +1,5 @@
[
(method)
(comment)
(singleton_method)
(class)
(module)
@ -16,6 +15,10 @@
(string_array)
] @fold
; Multi-line comment syntax (=begin…=end) is obscure and out of favor, but we
; might as well make it foldable.
((comment) @fold
(#set! fold.endAt endPosition))
; Fold from `if` to the next `elsif` or `else` in the chain.
((if