vysker / vscode-php-formatter

Visual Studio Code extension. A wrapper for the Sensiolabs PHP CS Fixer. Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible).
MIT License
93 stars 11 forks source link

Extension does nothing #24

Open hamsterkacke opened 7 years ago

hamsterkacke commented 7 years ago

Hey,

installed php-cs-fixer correctly as a global composer package, can run it from the command line.

Output from debug console inside of VSCode:

(4) ["fix", "--using-cache=no", "C:\Users\Philipp\AppData\Local\Temp/temp-wfkaylj.php", "--rules=@PSR2,@Symfony"] 0 : "fix" 1 : "--using-cache=no" 2 : "C:\Users\Philipp\AppData\Local\Temp/temp-wfkaylj.php" 3 : "--rules=@PSR2,@Symfony" length : 4

So there seems to be no error, but the formatted temp file doesn't get send back to vscode, i assume.

ghost commented 7 years ago

This extension does nothing, no error, nothing.

TheDutchCoder commented 7 years ago

Agreed same issue for me.

No errors, but not functionality either. I specified PSR2 formatting but it doesn't actually do anything.

CLOUGH commented 6 years ago

I was having the same issue. Found a solution that worked for me here.

I was following the docs and was using the settings. Which did nothing

"phpformatter.logging": true,
    "phpformatter.arguments": [
        "--level=psr2",
        "--fixers=linefeed,short_tag,indentation"
    ]

after some digging this worked for me

"phpformatter.composer": true,
    "phpformatter.logging": true,
    "phpformatter.arguments": [
        "--rules=@PSR2"
    ]
Jantho1990 commented 6 years ago

Tried using the above fix, it did not work for me.

andresubri commented 6 years ago

@Jantho1990 I just tried the above solution and its working, give it another try and verify the installation steps in case you missed something.

mattyh88 commented 6 years ago

I got it to work with @CLOUGH's solution .. Well at least for the format document functionality .. "Format selection" is not working yet.

FelipeGangrel commented 6 years ago

@CLOUGH solution did works for me

CNSKnight commented 6 years ago

This should be in the install docs until fixed in the plugin?

"phpformatter.arguments": [
        "--rules=@PSR2"
    ]
daaru00 commented 5 years ago

I tried the solution suggest by @CLOUGH but nothing, still does not work, no logging, no document formatting, nothing at all.

elbojoloco commented 5 years ago

The document format works for me, but format selection is not working. I copy pasted CLOUGH's suggestion.

definename commented 4 years ago

I was failed to find "--rules=@PSR2" option in official documentation vscode-php-formatter/wiki/Configuration but looks like it helps.

bvisonl commented 4 years ago

For me it was that I was confusing php-cs-fixer with the phpcs extension from Visual Studio Code's Marketplace.