Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCorrectly count CRLF newlines when counting line offsets. #1007
+29
−1
Conversation
This comment has been minimized.
This comment has been minimized.
|
Nice find! This actually fixes Windows CI failure for RLS, which was mismatched auto-completion based on lines https://travis-ci.org/Xanewok/rls/jobs/465194944 (errors because of debug |
This comment has been minimized.
This comment has been minimized.
|
Great, thanks |
kngwyu
merged commit eca9dce
into
racer-rust:master
Dec 8, 2018
This comment has been minimized.
This comment has been minimized.
|
@kngwyu I think that’d be great, yes. Windows users get their autocompletion back so I think that alone meets the point release bar |
This comment has been minimized.
This comment has been minimized.
|
Published v2.1.15 now |
This comment has been minimized.
This comment has been minimized.
|
I yanked 2.1.15 because of a really silly miss 4c2d363 |
akovaski
deleted the
akovaski:crlf_lines_fix
branch
Dec 8, 2018
This comment has been minimized.
This comment has been minimized.
|
Thanks for the release! |
Xanewok
referenced this pull request
Dec 26, 2018
Closed
Code completion just compatible with "LF" line ending #443
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
akovaski commentedDec 7, 2018
This allows completion coordinates to find the correct position in the file when using Windows style newlines (CRLF). I added two simple tests which are slight tweaks of the coords_to_point_works test in core.rs.
Notably for me, this allows RLS autocomplete to function correctly when working on files with Windows style newlines.
See issue 976 in the rust-lang/rls repo. I believe this behavior was merged to the racer github repo on Jun 24, 2018 with commit 42046fc.
Example image of the autocomplete problem in VSCode on Windows. This is a file with CRLF newlines. Notice that the cursor is on line 7, but the auto-completion is for the code that exists on line 5.

Now the autocomplete will autocomplete line 5 at the end of line 5, where the user will want it to.🎉
