richterger / Perl-LanguageServer

Language Server for Perl
Other
224 stars 51 forks source link

Debugging when script reads from <stdin> #112

Closed software-artisan closed 1 year ago

software-artisan commented 3 years ago

Hi,

I am not able to debug a script that reads from <stdin>. For example, when debugging below script by stepping over the line "$x = <stdin>", the debugger does not accept input from the "debug console" pane. It prints stdout to this pane but doesn't seem to accept <stdin> input. Want to know where to enter this input.

#!/usr/bin/perl
$x = <stdin>;
$y = <stdin>;
$z = $x + $y;
print "the sum of $x and $y is $z\n";
richterger commented 3 years ago

Reading from stdin are not yet implemented. Any contributions are welcome.

lilbro1062000 commented 2 years ago

You can just pass in the stdin value as a file name under arguments in the launch file.

wielandp commented 1 year ago

https://github.com/richterger/Perl-LanguageServer/pull/166 should fix this

richterger commented 1 year ago

stdin redirect is implemented in 2.6.0+