Extension does not run via SSH session
I am connecting to a remote host running CentOS 7, with PHP installed. I connect using Microsoft's remote SSH plugin and install the PHP CS fixer plugin locally using the extension manager. I have it set in the settings to run on save, but it can also be run manually. I installed the PHAR for PHP CS Fixer itself in my home directory and set that as the absolute path for the executable. When I save a file or when I right click and do Format Document, nothing happens. I don't get any errors though there are these two log messages in the Remote Extension Host log:
[2019-07-16 13:49:43.239] [exthost] [error] [junstyle.php-cs-fixer] provider FAILED
[2019-07-16 13:49:43.239] [exthost] [error] undefined
I can't tell where it's failing.
I'm running VS Code from Linux (Ubuntu 18.04). Latest version (1.31.1).
I am also getting this error when using the Remote SSH plugin.
Sounds like the only different thing that I experience is I get this notification popup in the bottom right corner:
PHP CS Fixer: php general error.
For what it is worth this extension does work while using Remote SSH: https://github.com/calvinbaart/vscode-phpstan
Had the same issue with VS Code and remote-ssh to my raspi
firstly looked at the Log (Remote Extension Host) with the same text: [error] [junstyle.php-cs-fixer] provider FAILED [error] undefined
@aaronellington @JoelFeiner check ctrl+shift+u (sure output panel) and select php-cs-fixer in the dropdown.
Now you will see (i've seen):
Could not open input file: /home/pi/.vscode-server/extensions/junstyle.php-cs-fixer-0.1.153\php-cs-fixer.phar as you may not see directly, there is a backslash -> not supported by linux
SOLVING:
F1 -> Preferences: Configure Language Specific Settings... -> PHP -> search for "php-cs-fixer.executablePath": "${extensionPath}\\php-cs-fixer.phar", and set to: "php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
you can also try to edit directly:
notepad++ "C:\Users\%USERNAME%\AppData\Roaming\Code\User\setting.json"
or
notepad++ "%APPDATA%\Code\User\settings.json"
Hope that helps you both and may other people :-)
Tags: VSC, VS Code, Raspberry Pi, php-cs-fixer, fail
I'm running into the same problem.
workstation OS: Ubuntu 16.04.07 LTS vscode version: 1.48.2 vscode-php-cs-fixer version: v0.1.155 remote server OS: Ubuntu 20.04.01 LTS
I can successfully run php-cs-fixer from the command line, but not with this extension. Does anyone have a suggestion on how to get this to work?
I've stopped using the extension because of problem with remote-ssh dev.
My current solution in my settings.json with the emeraldwalk.runonsave extension:
{
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.php$",
"cmd": "/home/aaron/php-project/bin/php-cs-fixer fix ${file}"
}
]
}
}
It's not perfect but it works 95% of the time.
I'm running into the same problem.
workstation OS: Ubuntu 16.04.07 LTS vscode version: 1.48.2 vscode-php-cs-fixer version: v0.1.155 remote server OS: Ubuntu 20.04.01 LTS
I can successfully run php-cs-fixer from the command line, but not with this extension. Does anyone have a suggestion on how to get this to work?
can you show me the console info, from menu : Help => Toggle Devoleper Tools
I donot have the environment of ssh remote
Interestingly, I'm not getting the error I got yesterday.
Yesterday, I tried setting the executable path to: 'php-cs-fixer'. When running the command to 'fix this file', vscode-php-cs-fixer complained that php-cs-fixer couldn't be found and as such it reverted back to the version included with the extension.
Today, I'm unable to reproduce that error and the excutable path does not get reverted back to the version included with the extension.
The only thing that has changed in the mean time was turning my workstation off yesterday night and on again this morning.
I could tell from the console output that php-cs-fixer was running with --rules=@PSR2, so I deliberately created something that didn't comply with PSR2 and it did get fixed.