PhpStorm on Windows and WSL : ALT+ENTER (fix the whole file) only works with Php-Cs-Fixer version <= 2.16.4 (composer global)

Hi,

Php-cs-fixer only works with the version 2.16.4 and older on PhpStorm.

Php-cs-fixer Installed with : composer global require friendsofphp/php-cs-fixer:2.16.4

System : Windows 10 pro 21H1 19043.1288

WSL : Ubuntu 20.04

Php (installed with chocolatey) : 7.4.7

Maybe this post will help some peoples who try to make php-cs-fixer works with PhpStorm :)

Best regards.

 

4 comments
Comment actions Permalink

I am confused. Are you using the Windows interpreter or the WSL one?
It seems to work fine with the WSL interpreter and PHP CS Fixer 3.2.1.
https://drive.google.com/file/d/1CAwf7Z1voG6mRlwugucgxrs6-hTnHgFk/view?usp=drivesdk

0
Comment actions Permalink

I am confused too. When i use the WSL interpreter nothing is happening :

https://drive.google.com/file/d/1vaqv5uLntWJ5rS1nqRm0evLkHd0Ga90r/view?usp=sharing

Download the video if you don't have the 1080p setting.

And yes for make this working i use the Windows interpreter.

0
Comment actions Permalink

In idea.log i found this spammed when i save the file i try to fix with php-cs-fixer :

2021-10-26 11:15:01,737 [2282732]   INFO - tellij.wsl.fs.WslContentLoader - Remote call <fleet.api.FsApi#readFile> has failed: invalid type: string "/", expected internally tagged enum Root
fleet.rpc.RpcException: Remote call <fleet.api.FsApi#readFile> has failed: invalid type: string "/", expected internally tagged enum Root
    at fleet.rpc.RpcException$Companion.callFailed(RpcFailure.kt:88)
    at fleet.rpc.client.RpcClient.requestFailed(RpcClient.kt:307)
    at fleet.rpc.client.RpcClient.acceptMessage(RpcClient.kt:259)
    at fleet.rpc.client.RpcClient.access$acceptMessage(RpcClient.kt:36)
    at fleet.rpc.client.RpcClient$start$2$1$receiver$1.invokeSuspend(RpcClient.kt:84)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)
0
Comment actions Permalink

Thanks, it appears to be a bug in our WSL support then: https://youtrack.jetbrains.com/issue/IDEA-280317
Unfortunately, it doesn't seem like there's any workaround available at the moment.

0

Please sign in to leave a comment.