Skip to content

Formatter: Empty line added when pasting (VS Code) #995

@klunejko

Description

@klunejko

Description

When pasting text, mago always adds an empty line after the pasted code. Only happens when mago is set as the formatter using customLocalFormatters.formatters, doesn't happen with prettier or cs fixer.

Happens for constructor properties, array keys, named arguments etc.

Playground Link

No response

Reproduction

Config

[formatter]
print-width = 80
align-assignment-like = true
parentheses-around-new-in-member-access = true
empty-line-after-opening-tag = false
empty-line-after-trait-use = true
empty-line-after-class-like-constant = false
empty-line-after-property = false
empty-line-after-symbols = false
empty-line-between-same-symbols = false
separate-class-like-members = false

Copy/Cut multiple lines of text, place the caret at the desired position and paste the code:

Image

Expected Result
Image

Actual Result
Image

Environment

Mago: 1.3.0
OS: Windows 10
"Installed" from zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    c-formatterPHP code reformatting and style rulest-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions