question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension does not run via SSH session

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rayrazcommented, Aug 26, 2020

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.

1reaction
aaronellingtoncommented, Aug 25, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remote Development using SSH - Visual Studio Code
The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container...
Read more >
VS Code Remote SSH Connection not working - Stack Overflow
The first solution is to try the extension command: Remote-SSH: ... Then a good solution that can work is: to connect to your...
Read more >
Developing a Visual Studio Code Project for SSH Development
will not. execute the setvars.sh script when you. ssh ... This extension is required to debug a remote session using the VS Code...
Read more >
How to connect to a Plesk server via SSH with available ...
Warning: If your Plesk server is managed by a Hosting Provider, please contact the company that hosts your server and ask for the...
Read more >
Working Remotely with Visual Studio Code and SSH
If the connection is not successful, you may be given an option to try again; click Retry. If you succeed at connecting, there...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found