diff --git a/lib/ruby_lsp/requests/on_type_formatting.rb b/lib/ruby_lsp/requests/on_type_formatting.rb index 65ea034eb..833bd5635 100644 --- a/lib/ruby_lsp/requests/on_type_formatting.rb +++ b/lib/ruby_lsp/requests/on_type_formatting.rb @@ -139,7 +139,6 @@ def handle_heredoc_end(delimiter) sig { params(spaces: String).void } def handle_comment_line(spaces) add_edit_with_text("##{spaces}") - move_cursor_to(@position[:line], @indentation + spaces.size + 1) end sig { params(text: String, position: Document::PositionShape).void } diff --git a/test/requests/on_type_formatting_test.rb b/test/requests/on_type_formatting_test.rb index 73f3145c2..89ed5acd9 100644 --- a/test/requests/on_type_formatting_test.rb +++ b/test/requests/on_type_formatting_test.rb @@ -209,10 +209,6 @@ def test_comment_continuation range: { start: { line: 0, character: 14 }, end: { line: 0, character: 14 } }, newText: "# ", }, - { - range: { start: { line: 0, character: 9 }, end: { line: 0, character: 9 } }, - newText: "$0", - }, ] assert_equal(expected_edits.to_json, T.must(edits).to_json) end @@ -253,10 +249,6 @@ def test_comment_continuation_with_other_line_break_matches range: { start: { line: 0, character: 14 }, end: { line: 0, character: 14 } }, newText: "# ", }, - { - range: { start: { line: 0, character: 9 }, end: { line: 0, character: 9 } }, - newText: "$0", - }, ] assert_equal(expected_edits.to_json, T.must(edits).to_json) end @@ -282,10 +274,6 @@ def test_comment_continuation_when_inserting_new_line_in_the_middle range: { start: { line: 0, character: 7 }, end: { line: 0, character: 7 } }, newText: "# ", }, - { - range: { start: { line: 0, character: 2 }, end: { line: 0, character: 2 } }, - newText: "$0", - }, ] assert_equal(expected_edits.to_json, T.must(edits).to_json) end