Rls: On Windows RLS gives different completions if line endings are CRLF or LF

Created on 1 Aug 2018  路  3Comments  路  Source: rust-lang/rls

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.

bug racer

All 3 comments

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

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.

Thanks @akovaski :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaccarmac picture jaccarmac  路  3Comments

dnsco picture dnsco  路  5Comments

dpc picture dpc  路  4Comments

PumpkinSeed picture PumpkinSeed  路  3Comments

jntrnr picture jntrnr  路  6Comments