vscode-laravel-pint icon indicating copy to clipboard operation
vscode-laravel-pint copied to clipboard

LaravelPint does not work with the Windows version of laravelHerd

Open uedatatsuya opened this issue 11 months ago • 14 comments

Describe the bug When command is executed from terminal, it is formatted properly. But when the file is saved, it is not formatted.

uedatatsuya avatar Apr 01 '24 16:04 uedatatsuya

Good one, no idea how can I help with this as a Mac user, probably need to check where PHP is being installed and if any PHP / artisan command is available to run on default Windows terminal

d8vjork avatar Apr 02 '24 09:04 d8vjork

Can confirm this also applies to Mac version.

Switching VSCode to use ZSH and adding global composer vendor/bin to path solved it for me.

mattkingshott avatar Apr 02 '24 14:04 mattkingshott

I'm on windows, when i execute ./vendor/bin/pint works well, but not with extension, works well on WSL with laravel sail, but not on windows with laravel Herd

JaviLerma avatar Apr 10 '24 19:04 JaviLerma

I'm on windows, when i execute ./vendor/bin/pint works well, but not with extension, works well on WSL with laravel sail, but not on windows with laravel Herd

Probably the same problem

uedatatsuya avatar Apr 11 '24 13:04 uedatatsuya

installed

It has been confirmed that php command can be executed in the container.

uedatatsuya avatar Apr 11 '24 13:04 uedatatsuya

@d8vjork I am having the same issue.

Do you have any steps for running the extension running from source code and adding some logs to see whats actually happening?

vikas5914 avatar Apr 17 '24 22:04 vikas5914

@d8vjork I am having the same issue.

Do you have any steps for running the extension running from source code and adding some logs to see whats actually happening?

Just use the tasks from the debug side panel of VSCode when open this project while the yarn watch running

d8vjork avatar Apr 18 '24 09:04 d8vjork

@d8vjork I checked, and setting shell:true will fix this issue on Windows with Laravel Herd.

Can you tell me how to build the extension so I can test it as an extension?

const exec = spawn(this.cmd, this.args, {
    cwd: cwd || this.cwd,
    shell: true
});

vikas5914 avatar Apr 26 '24 19:04 vikas5914

Found it. Please try this and let me know if it fixes your issue. (I only tested local pint, not global.)

laravel-pint-1.2.1-test.zip

vikas5914 avatar Apr 26 '24 22:04 vikas5914

@d8vjork For the global pint,, the command is wrong..

current command is : php pint --preset laravel d:\\Projects\\devil-www\\laravel-turso\\app\\Http\\Middleware\\Authenticate.php

it should not have php in starting. because you get the Could not open input file: pint error.

vikas5914 avatar Apr 27 '24 08:04 vikas5914

I try fix and formating working when i save file with autoformat but not work when i click right and select format.... its possible?

netskycz avatar May 07 '24 13:05 netskycz

I try fix and formating working when i save file with autoformat but not work when i click right and select format.... its possible?

Thanks fort the reply.. I will check it.

vikas5914 avatar May 07 '24 14:05 vikas5914

@d8vjork For the global pint,, the command is wrong..

current command is : php pint --preset laravel d:\\Projects\\devil-www\\laravel-turso\\app\\Http\\Middleware\\Authenticate.php

it should not have php in starting. because you get the Could not open input file: pint error.

I believe this was like that due to some other shells and/or OS having a problem running just the file without the language interpreter binary prepended (I don't think the shebang is supported by all operating systems)

d8vjork avatar May 07 '24 14:05 d8vjork

I believe this was like that due to some other shells and/or OS having a problem running just the file without the language interpreter binary prepended (I don't think the shebang is supported by all operating systems)

Other shells in windows?

vikas5914 avatar May 07 '24 15:05 vikas5914

@vikas5914 @d8vjork Is there any progress, can we get a fix asap? I'm getting the following message when file is saved, but no change in the file:

["INFO" - 12:47:45 PM] Extension Name: open-southeners.laravel-pint.
["INFO" - 12:47:45 PM] Extension Version: 1.2.0.
["INFO" - 12:57:42 PM] Formatting completed in 409ms.

checkuzd avatar Jul 05 '24 07:07 checkuzd

@checkuzd can you try this version: https://github.com/open-southeners/vscode-laravel-pint/files/15135605/laravel-pint-1.2.1-test.zip

vikas5914 avatar Jul 05 '24 09:07 vikas5914