Skip to content

Formatting result different from cli dprint fmt #131

@balthild

Description

@balthild

Config:

{
  "malva": {
    "indentWidth": 4,
    "printWidth": 120
  },
  "excludes": [
    "**/node_modules",
    "**/*-lock.json"
  ],
  "plugins": [
    "https://plugins.dprint.dev/g-plane/malva-v0.15.2.wasm"
  ]
}

Code:

@--x-some-at-rule {

    .class1,
    .class2 {
        background-color: black;
    }
}

An extra empty line is added before .class1, which does not exists when formatting with dprint cli.

Also, this behavior only occurs when the first css rule in the at-rule contains multiple selectors.

Has confirmed that the cli and the extension runs the same dprint executable (the one in ./node_modules).

Strange thing: I only encounter this problem when formatting css/scss. Not sure if this is caused by malva or the vscode extension.

Tried both true and false on dprint.experimentalLsp - this makes it even stranger because the LSP is provided by the dprint CLI itself. It seems to indicate that a part of the CLI's behavior is different from another part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions