Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CicerBro opened this issue Nov 28, 2024 · 1 comment
Open

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

CicerBro opened this issue Nov 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@CicerBro
Copy link

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"
        }
    }
}
@CicerBro CicerBro added the bug Something isn't working label Nov 28, 2024
@kev1ncal
Copy link

kev1ncal commented Dec 2, 2024

I thought I was the only one experiencing a bug on this extension. For me, the extensions just doesn't work anymore. Format Document using... option on VSCode does fix the file I'm currently in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants