Skip to content

Pint works differently on save and when manually calling format #70

@CicerBro

Description

@CicerBro

I was testing formatting by adding a tab in front of a variable. When I save the file, the tab gets removed (which is good) but when I run Format Document (this calls Pint) it doesn't remove the tab.

I know it calls pint when doing calling Format Document because I can see it on the console: ["INFO" - 14:58:53] Formatting completed in 388ms.

When I do "Format Document With" then Pint is listed as the default.

Any ideas?

.vscode/settings.json:

{
    "laravel-pint.enable": true,
    "editor.formatOnSave": true,
    "[php]": {
        "editor.defaultFormatter": "open-southeners.laravel-pint"
    }
}

pint.json

{
    "preset": "laravel",
    "rules": {
        "array_indentation": true,
        "blank_line_after_namespace": true,
        "blank_line_after_opening_tag": true,
        "combine_consecutive_issets": true,
        "combine_consecutive_unsets": true,
        "concat_space": {
            "spacing": "one"
        },
        "is_null": true,
        "logical_operators": true,
        "mb_str_functions": true,
        "method_chaining_indentation": true,
        "modernize_strpos": true,
        "no_empty_comment": true,
        "ternary_to_null_coalescing": true,
        "trim_array_spaces": true,
        "array_push": true,
        "assign_null_coalescing_to_coalesce_equal": true,
        "method_argument_space": {
            "on_multiline": "ensure_fully_multiline"
        },
        "modernize_types_casting": true,
        "no_superfluous_elseif": true,
        "no_useless_else": true,
        "ordered_imports": {
            "sort_algorithm": "alpha"
        },
        "ordered_class_elements": {
            "order": [
                "use_trait",
                "case",
                "constant",
                "constant_public",
                "constant_protected",
                "constant_private",
                "property_public",
                "property_protected",
                "property_private",
                "construct",
                "destruct",
                "magic",
                "phpunit",
                "method_abstract",
                "method_public_static",
                "method_public",
                "method_protected_static",
                "method_protected",
                "method_private_static",
                "method_private"
            ],
            "sort_algorithm": "none"
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions