Endless method followed by a single newline (correct):
irb(main):013:0> SyntaxTree.parse("def foo = 1\n").child_nodes.first.child_nodes.first.location
=> #<SyntaxTree::Location:0x0000000107852f48 @end_char=12, @end_column=12, @end_line=1, @start_char=0, @start_column=0, @start_line=1>
Endless method followed by multiple newlines (incorrect):
irb(main):014:0> SyntaxTree.parse("def foo = 1\n\n").child_nodes.first.child_nodes.first.location
=> #<SyntaxTree::Location:0x0000000107ff0818 @end_char=1, @end_column=1, @end_line=1, @start_char=0, @start_column=0, @start_line=1>
Shopify/ruby-lsp#400