-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug #24
Comments
Sure! Have you tried it with https://github.com/felixfbecker/vscode-php-debug? This launch.json config works to run PHPUnit tests: {
"name": "PHPUnit",
"type": "php",
"request": "launch",
"program": "${workspaceRoot}\\vendor\\phpunit\\phpunit\\phpunit",
"args": ["--bootstrap", "vendor/autoload.php", "tests"],
"cwd": "${workspaceRoot}"
} If you want to debug it in action, I recommend to open vscode-php-intellisense in a seperate window and symlink vendor/felixfbecker/language-server to the git clone of the language server. Then in the window with php-language-server, you can use the "Listen for XDebug" configuration and set breakpoints. Then launch the extension from the window with vscode-php-intellisense. |
I repeated steps that you described but nothing happens. {
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
} |
Running PHPUnit or debugging with vscode-php-intellisense? Did you install XDebug properly? |
running debug, yes XDebug is properly installed. I'll double check and let you know. |
You might wanna look into the troubleshooting section of vscode-php-debug. In particular, enable |
Try to run the tests with some breakpoints and see if that works. |
Just tried it again and it works for me.
launch.json in php-language-server: {
"name": "Listen for XDebug",
"type": "php",
"request": "launch"
} And the included "Launch Extension" config from vscode-php-intellisense. Of course you then need to open a PHP project so the extension gets activated. |
without port option? |
Port defaults to 9000. |
Can you debug PHPUnit at least? |
when I launch extension development host and execute command to list symbols in document nothing happens, progress bar just runs. |
I just removed all breakpoints and extension work again, but without debugging :( |
Can you run PHPUnit with the debugger? |
I have finally launched debugging. I've just unchecked warnings and exceptions in breakpoints section of debugger. |
It is very hard for me to help you if you provide so little information... What did you finally launch (PHPUnit/intellisense)? Can you hit breakpoints? |
Yes, I can hit breakpoints. PHPUnit, Debugger and intellisense work. |
So everything is working now? It is probably a good idea to add some guidance to the readme. |
Yes everything works fine. I don't know why, but exceptions and warnings option in debugger were causing this behavior. |
That's not the way it should be... please open an issue at vscode-php-debug. Make sure to include what versions of PHP/XDebug you are running and the log from |
ok. thank's for help. |
Hello @felixfbecker, Trying to do the same thing as @lgabeskiria and use xdebug on the php-language-server. I followed all your steps but am not ableto get the breakpoints to execute. the PHPUnit xdebug does work and when I use the as you can see there is Request's coming through but they never change from Any help would be appreciated thanks!! |
I am confused, are you saying PHPUnit works or does not work? Try setting the environment variable |
PHPUnit does work. I just added Thank you. |
Could you do a PR to add that to the README? This is the reason why it's needed: php-language-server/bin/php-language-server.php Lines 34 to 35 in b03b9a2
|
Sure! I'll do that tomorrow. -- How come we need to restart when xdebug is enabled? Thanks for the help. |
Is it possible to debug language server with vscode?
The text was updated successfully, but these errors were encountered: