Closed mikemitch closed 1 year ago
Just a follow-up on this. It appears that there is a new feature in VS code that supports passing an entire string unmodified to the underlying shell: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_70.md#javascript-debugging Could this be enabled in Perl?
Perl supports args, but only as an array and without redirection :-)
I made a PR https://github.com/richterger/Perl-LanguageServer/pull/166 for redirect stdin. Maybe uft-8 would be nice for stdin? I thing nodejs always uses utf8, but Perl ascii and utf8.
Redirection of stdout would be possible similar. I had no use case so far.
At the moment I wait for feedback or merge of my PR
Args can now be a string, implemented in f16696a33a112978b4fd91704dd18506901a7222 (pull request #173 )
Currently it is possible to pass arguments to the Perl debugger in VS code in the launch.json file, using the built in args facility and input variables:
launch.json file
"configurations": [ { "type": "perl", "request": "launch", "name": "Perl-Debug", "program": "${file}", "args": ["${input:arg}"], "stopOnEntry": true, "reloadModules": true }, "inputs": [ { "type": "promptString", "id": "arg", "description": "command line argument", "default": "", }, ]
The current issue is that the input variable is passed as a string to the debugger, so it's not possible to specify multiple command line arguments this way. As discussed in the VS code channel (https://github.com/microsoft/vscode/issues/83678), the easiest way around this would be to: 'ask the debugger author to support an alternative launch configuration attribute "commandline" that avoids the array'. { "type": "perl", "request": "launch", "name": "Debug INPUT", "console": "integratedTerminal", "program": "${workspaceFolder}/${relativeFile}", "commandline": "-foo -bar /hello/world -o -p" }
Would something like this be possible to implement in the Perl language server?