You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change is correctly detected and new_text contains the changed endings.
But then to_proto::text_edit_vec subsequently changes the line endings back, because it uses the ones passed in by line_index instead of new_line_endings
So the actual TextEdit in the response contains new_text with the old line endings.
reports CRLF -> LF change and new_text contains LF endings
the client receives TextEdit replacing the document but still containing CRLF endings
This results in clients receiving the whole document on each request, because they always make requests with line endings that rust-analyzer wants to convert.
The text was updated successfully, but these errors were encountered:
When line endings are changed during a formatting request, the whole document is sent to the client.
rust-analyzer/crates/rust-analyzer/src/handlers.rs
Lines 1874 to 1884 in 65874df
The change is correctly detected and new_text contains the changed endings.
But then to_proto::text_edit_vec subsequently changes the line endings back, because it uses the ones passed in by line_index instead of new_line_endings
So the actual TextEdit in the response contains new_text with the old line endings.
Steps to reproduce
rust-analyzer/crates/rust-analyzer/src/handlers.rs
Line 1876 in 65874df
This results in clients receiving the whole document on each request, because they always make requests with line endings that rust-analyzer wants to convert.
The text was updated successfully, but these errors were encountered: