Skip to content

VS Code Format selection does not work when selection ends with non-code #522

Description

@zhizhongpu

Buggy behavior

Consider this block of R code

mtcars |> 
names()
# blank line
names(mtcars)

Selecting lines 1-3 and "Format Section" in VS Code does not do anything.

Expected behavior

Selectin lines 1-2 or 1-4 and "Format Section" in VS Code formats the code correctly:

mtcars |>
    names()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions