Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

textDocument/formatting requests removes whitespaces lines #1642

@alexheretic

Description

@alexheretic

RLS formatting can remove some whitespace lines that cargo fmt does not.
Downstream: rust-lang/atom-ide-rust#146

Example

fn main() {
    let foo = 123;
    
    let bar = 234;
}

Before

Note: line 3 is 4 spaces.

After textDocument/formatting

RLS responds with:

[{"range":{"start":{"line":6,"character":0},"end":{"line":7,"character":0}},"newText":""}]

So the blank line is removed.

Expected behaviour: cargo fmt

cargo fmt trims the line without removing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions