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

On Windows RLS gives different completions if line endings are CRLF or LF #976

Closed
dgriffen opened this Issue Aug 1, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@dgriffen
Copy link
Contributor

dgriffen commented Aug 1, 2018

OS: Windows 10 RS4
Rust version: 1.29.0-nightly (866a71325 2018-07-29)
RLS version: 0.129.0-nightly (4c7cc91 2018-07-29)

I have a crate with only one main.rs follow with the following contents:

#[macro_use]
extern crate structopt;
extern crate uuid;

use structopt::StructOpt;
use uuid::Uuid;

#[derive(StructOpt, Debug)]
#[structopt(name = "guids")]
struct App {
    #[structopt(short="g", long="guid")]
    input: Option<String>,

    #[structopt(short="i", long="invert", requires="c_style")]
    invert: bool,

    #[structopt(short="c", long="c-style")]
    c_style: bool,
}


fn main() {
    
    let app: App = App::from_args();
}

I see different completion behavior depending on line endings. If I type the letter "U" in the main function's empty line with CRLF line endings I get fairly complete completions (Uuid, unimplemented!, and a bunch of module suggestions). However if the file has LF line endings the only suggestion I get is for Uuid.

@kngwyu

This comment has been minimized.

Copy link
Contributor

kngwyu commented Aug 2, 2018

I think only Uuid is intended behavior, but it sounds weird 😕 ...

@Vassalware

This comment has been minimized.

Copy link

Vassalware commented Oct 21, 2018

It seems to give nonsense autocomplete results with CR LF EOLs, but expected behavior with LF ones.

For anyone experiencing this issue, a quick workaround is adding a .gitattributes file to force LF line endings.

@kngwyu

This comment has been minimized.

Copy link
Contributor

kngwyu commented Dec 10, 2018

Thanks @akovaski 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment