rbs icon indicating copy to clipboard operation
rbs copied to clipboard

Add support for `__END__` in rbs files

Open sampersand opened this issue 2 years ago • 1 comments

(This was originally a discussion, #1610. I think it's more apt as an issue, so it's been moved here).

One thing I really like about Ruby is the fact that you can type \n__END__\n and it'll comment out the rest of the file. I use it very extensively, from testing quick snippets, to commenting out code i'm replacing, to finding where the missing end originated from.

I'd really like if we could support \n__END__\n in RBS. It'd act just like Ruby's (except for no DATA) and would "comment out" the rest of the file.

sampersand avatar Nov 24 '23 22:11 sampersand

Oh no, you want __END__ in RBS too? 😳

class Foo
end

__END__

class Foo      # Comment
end

Technically, it's possible. __END__ is not a valid identifier in RBS.

soutaro avatar Nov 27 '23 01:11 soutaro