Skip to content

dprint vscode extension format a file with dprint-ignore-file on save #102

@EKliptus

Description

@EKliptus

dprint cli version : 0.49.1
dprint vscode extension version : 0.16.4
I am sure there is only dprint formatter to format my files !

I have a different behavior between cli and vscode extension trigger when I save :

dprint-ignore-file directive in a file work as expect with cli dprint fmt and dprint output-file-paths : it ignore it !

BUT when I save a file in vscode with dprint.dprint as formatter (point to the same dprint runtime) :
The dprint formatter is trigger on the file and format it ! = BAD

Why ?

I try /*dprint-ignore-file */ in css and // dprint-ignore-file in ts, <!-- dprint-ignore-file -->in astro files, etc...

Maybe like write here dprint/dprint#976 (comment) the path not correspond cause it is relative or absolute or other ?

The dprint log show it can be the problem with le drive letter case :

[DEBUG] Reading file: E:\pathproject\dprint.json
[DEBUG] Checking can format: E:\pathproject\src\styles\global.css
[DEBUG] Checking path exists: E:\pathproject\src\styles\.git
[DEBUG] Reading file: E:\pathproject\src\.gitignore
[DEBUG] Reading file: E:\pathproject\src\styles\.gitignore
[DEBUG] Checking path exists: src\styles\.git
[DEBUG] Checking path exists: src\.git
[DEBUG] Reading file: .gitignore
[DEBUG] Reading file: src\.gitignore
[DEBUG] Reading file: src\styles\.gitignore
[DEBUG] Host formatting e:\pathproject\src\styles\global.css - File length: 584 - Plugins: [dprint_plugin_malva] - Range: None
[DEBUG] Response - Formatted: e:\pathproject\src\styles\global.css

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