Perl-LanguageServer
Perl-LanguageServer copied to clipboard
Debug launch.json redirect standard input
How do I read in variables while debugging? My current Launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "perl",
"request": "launch",
"name": "Perl-Debug",
"program": "${file}",
"stopOnEntry": true,
"reloadModules": true,
}
]
}
Sorry, stdin in not implemented yet in the debugger (Patches are welcome :-). You might use environment variables, are open a file as workaround.
@richterger I am interested in trying to get this to work. What I am wondering is if there is a good way to use the LanguageServer to debug itself? So far I can easily debug the vscode client portion of the code but I'm unsure how to debug the debug-adapter Perl::LanguageServer itself. Is this something that should be possible?
Also, I am wondering if you may have some insight into how accomplishing the task of redirecting standard input may work. It seems that stdin and stdout are being redirected for the debugger already to talk to it (using open3 and specifying out and in file handlers in IO.pm), correct? Or am I misunderstanding?
Also missing this functionality, C debug in VS Code enables to add "<", "input_file.txt"
to args, which redirects file to stdin. This will help and it might be easier that working with debug terminal?
https://github.com/richterger/Perl-LanguageServer/pull/166 should fix this Syntax is same like C debug
stdin redirect is implemented in 2.6.0+