reddit / emacs

LSP + debugging PHP

_gjm_ · 2022-09-01 14:24
Hi. Don't really know is this is the correct place to ask this but here it goes. I'm using Doom Emacs and I'm trying to debug some PHP Laravel code using LSP+debug. Remote debugging seems to be working fine but, in Emacs, when I inspect variables there is less information than in VS Code. Noticed this especially in `Model` instances. Below is a screenshot comparison of the same inspection in both Emacs and VS Code. As you can see, in Emacs the last entry is `escapeWhenCastingToString` and in VS Code there are entries for `attributes`, `original`, `changes`, ... Have no clue where to begin to fix this... Any help is appreciated. Thanks in advance. ​ [Emacs](https://preview.redd.it/of976ypoa9l91.png?width=500&format=png&auto=webp&s=8d884ec0e026c967afce49da5363cd1932127246) ​ [VS Code](https://preview.redd.it/7vplg3tea9l91.png?width=351&format=png&auto=webp&s=c8ae26fbbfd08af459a1cc73e0c9680198259d11)
Nazarn96 · 2022-09-01 17:21
I think you should look at customize variable "dap-ui-expressions-expand-depth" and "dap-ui-locals-expand-depth" or i guess it is -> dap-ui-variable-length to 30
_gjm_ · 2022-09-01 18:47
These only control the expansion strategy for the buffers. Tried to play with them but always yields the save result.
Nazarn96 · 2022-09-01 20:28
Yes looks like this is related to [https://github.com/xdebug/vscode-php-debug](https://github.com/xdebug/vscode-php-debug) the max\_data settings, so it should be configured under felixfbecker.php-debug
Nazarn96 · 2022-09-01 21:36
So i was able to fix this by modifying phpDebug.js to send max\_children option with some large value like 120 after theat exaclty 120 variables was displayed, probably need to put this option to launch.json and it should be okay
_gjm_ · 2022-09-01 22:44
You are right. In my case I had to change `max_children`. Don't know what the default value is but I put in 100 and it solves it.
Nazarn96 · 2022-09-01 22:46
cool, also found a way to change it by registering new template `(dap-register-debug-template "Php Stop On Entry"` `(list :type "php"` `:cwd nil` `:xdebugSettings '(:max_children "120")` `:request "launch"` `:name "Php SOE Debug"` `:stopOnEntry t` `:sourceMaps t))`