TheNouillet / symfony-vscode

Symfony extension for Visual Studio Code
MIT License
20 stars 22 forks source link

Call symfony in vagrant #33

Open st-schneider opened 5 years ago

st-schneider commented 5 years ago

would be nice if this would be an option.

st-schneider commented 5 years ago

ok I found the docker example and adjusted my command but i get the following

  The "-t" option does not exist.  

debug:router [--show-controllers] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<name>]
TheNouillet commented 5 years ago

Hello,

What command did you put in the Shell Command setting ? When calling the debug:router command, the extension doesn't add any argument beside --format=json. Do you have the same problem when only refreshing services ?

st-schneider commented 5 years ago
    "symfony-vscode.consolePath": "/var/www/app/console",
    "symfony-vscode.shellExecutable": "/bin/bash",
    "symfony-vscode.shellCommand": "vagrant ssh -t -c 'cd /var/www && php \"$@\"' d8d52c5 -- "

Yes I get that for all the view, then with debug:container

st-schneider commented 5 years ago

btw doesnt matter if the -t for vagrant is there or not

igorsinkovec commented 5 years ago

I have the same problem; both on load and when refreshing services. I did not include -t switch in symfony-vscode.shellCommand config.

igorsinkovec commented 5 years ago

Solved by ssh-ing to the Vagrant box directly. First I created a ssh config file from Vagrant config: vagrant ssh-config > vagrant-ssh-config The shell command config then looks like this: "symfony-vscode.shellCommand": "cd /path/to/vagrant-dir; ssh -F vagrant-ssh-config <vagrant-box-name>; 'cd /path/to/symfony-app; php \"$@\"' -- "

st-schneider commented 5 years ago

[2019-04-10 17:23:18.826] [exthost] [error] [TheNouillet.symfony-vscode] provider FAILED [2019-04-10 17:23:18.826] [exthost] [error] TypeError: Cannot read property 'find' of undefined

st-schneider commented 5 years ago

this is what I get with that

igorsinkovec commented 5 years ago

Yes, I get that too, but I don't think it's related.

st-schneider commented 5 years ago

shouldn't it be?: ssh -F vagrant-ssh-config 'cd /path/to/symfony-app; php \"$@\"'

igorsinkovec commented 5 years ago

shouldn't it be?: ssh -F vagrant-ssh-config 'cd /path/to/symfony-app; php "$@"'

Not in my environment. SSH does not connect without the host machine name.

st-schneider commented 5 years ago

ehh of coursem my point was actuall the ;

st-schneider commented 5 years ago

ssh -t -F vagrant-ssh-config default 'cd /var/www; php `$@`' -- but then I get [2019-04-11 09:38:29.810] [exthost] [error] [TheNouillet.symfony-vscode] provider FAILED [2019-04-11 09:38:29.811] [exthost] [error] Error: Illegal argument: character must be non-negative

st-schneider commented 5 years ago

This works for me.

"symfony-vscode.shellCommand": "cd /path/to/vagrant-dir && vagrant ssh-config > vagrant-ssh-config && ssh -t -F vagrant-ssh-config <vagrant-box-name> 'cd /path/to/symfony-app && php `$@`' ",