richterger / Perl-LanguageServer

Language Server for Perl
Other
220 stars 53 forks source link

Debugger: "Invalid variable attributes" when showing array content #120

Closed scriplit closed 2 years ago

scriplit commented 2 years ago

image

=== Perl: v5.34.0 Perl-LanguageServer-v2.3.0 VS Code: Version: 1.62.3 Commit: ccbaa2d27e38e5afa3e5c21c1c7bef4657064247 Date: 2021-11-17T08:00:36.721Z Electron: 13.5.2 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Linux x64 5.4.0-91-generic (Linux Mint 20.2)

phimmi commented 2 years ago

image

I tried your provided example and it works as desired. Please paste in your example in future, so someone from the community can easily test it on their own.

Version: 1.63.2 Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2021-12-15T09:39:46.686Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Linux x64 5.16.1-arch1-1 Perl LanguageServer: 2.3.0 Perl: v.5.34.0

thGirard commented 2 years ago

@scriplit: could you solve this? I have the very same issue.... thank you Thierry

thGirard commented 2 years ago

to be more precise: perl installed with perlbrew. I tried perl 5.34.0 and 5.28.3 not difference. I have also tried older versions of the debugger: no difference. The issue persists with all arrays, there the content is only shown as 'invalid variable attributes'. any help is very much appreciated

richterger commented 2 years ago

I don't have this issue, so I can't fix it.

Please set the perl.logLevel to 2 and send the output from the LanguageServer output pane (or use perl.logFile to write it to a file).

thGirard commented 2 years ago

Wow, this is super kind of you! This is the easy script I try to run. Hope I did it correct with the log file.

Thank you

Thierry

On 15 Mar 2022, at 15:51, Gerald Richter @.***> wrote:

I don't have this issue, so I can't fix it.

Please set the perl.logLevel to 2 and send the output from the LanguageServer output pane (or use perl.logFile to write it to a file).

— Reply to this email directly, view it on GitHub https://github.com/richterger/Perl-LanguageServer/issues/120#issuecomment-1068077395, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQP737UVPB7GZIUAXKIYKDVACPX3ANCNFSM5JNCY7CA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.

richterger commented 2 years ago

@thGirard, there are no script and no log file in your posting. Maybe github has striped it from the mail? Can you retry, maybe use the github webinterface, instead of sending a mail.

thGirard commented 2 years ago

ah, sorry. here there are. Thank you so much for your support! Archive.zip

richterger commented 2 years ago

@thGirard, could you please try if the following patch fixes the problem (of course you have to adapat the path to your perl installation):

Index: /usr/bbsrc/bbbin/usr/lib64/perl5/vendor_perl/5.34/Perl/LanguageServer/Methods/DebugAdapter.pm
===================================================================
--- /usr/lib64/perl5/vendor_perl/5.34/Perl/LanguageServer/Methods/DebugAdapter.pm   
+++ /usr/lib64/perl5/vendor_perl/5.34/Perl/LanguageServer/Methods/DebugAdapter.pm   (working copy)
@@ -545,6 +545,7 @@
                                                                         'package'  => $package,
                                                                          type      => $type}):
                                                     0 ;    
+        $_ -> {name} .= '' ;
         }

     return $variables ;
thGirard commented 2 years ago

ok, got it! AND IT WORKS genius! Thank you

Screenshot 2022-03-18 at 22 31 51
dseynhae commented 2 years ago

The single-line patch works great for me as well...

How often should we expect releases? I'm just wondering if I should just build this Perl Module myself, or if I can just wait for the next release.