Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete command returns the wrong info if the file has CRLF line endings #1081

Open
0xd4d opened this issue Nov 16, 2019 · 0 comments
Open

Comments

@0xd4d
Copy link

0xd4d commented Nov 16, 2019

racer 2.1.28

The line/col info (see below) is one char too early if it has CRLF line endings.

Racer command:

racer complete 2 16 main.rs

main.rs:

fn f() {
    let _ = E::E0;
}
enum E {
    E0,
    E1,
    E2,
    E3,
    E4,
    E5,
    E6,
    E7,
    E8,
    E9,
    E10,
}

CRLF line endings (wrong):

PREFIX 25,26,E
MATCH E0,5,3,main.rs,EnumVariant,E0,
MATCH E1,6,2,main.rs,EnumVariant,E1,
MATCH E10,14,2,main.rs,EnumVariant,E9,
MATCH E2,7,1,main.rs,EnumVariant,E2,
MATCH E3,8,0,main.rs,EnumVariant,E3,
MATCH E4,8,8,main.rs,EnumVariant,
MATCH E5,9,7,main.rs,EnumVariant,
MATCH E6,10,6,main.rs,EnumVariant,,
MATCH E7,11,5,main.rs,EnumVariant,6,
MATCH E8,12,4,main.rs,EnumVariant,E7,
MATCH E9,13,3,main.rs,EnumVariant,E8,
END

LF line endings (correct):

PREFIX 24,25,E
MATCH E0,5,4,main.rs,EnumVariant,E0,
MATCH E1,6,4,main.rs,EnumVariant,E1,
MATCH E10,15,4,main.rs,EnumVariant,E10,
MATCH E2,7,4,main.rs,EnumVariant,E2,
MATCH E3,8,4,main.rs,EnumVariant,E3,
MATCH E4,9,4,main.rs,EnumVariant,E4,
MATCH E5,10,4,main.rs,EnumVariant,E5,
MATCH E6,11,4,main.rs,EnumVariant,E6,
MATCH E7,12,4,main.rs,EnumVariant,E7,
MATCH E8,13,4,main.rs,EnumVariant,E8,
MATCH E9,14,4,main.rs,EnumVariant,E9,
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants