richterger / Perl-LanguageServer

Language Server for Perl
Other
220 stars 53 forks source link

array of hash references can't be displayed in debugger #136

Closed dseynhae closed 2 years ago

dseynhae commented 2 years ago

Consider the simple example, with the array @objects of hashreferences:

package main 1.0;
use strict;
use warnings;

my @objects = (
  {
    name  => 'object1',
    value => 1
  },
  {
    name  => 'object',
    value => 2
  },
  {
    name  => 'object2',
    value => 3
  },
  {
    name  => 'object',
    value => 4
  },
);

my @objects_filter1 = grep { $_->{name} eq 'object' } @objects;

print @objects_filter1 . "\n";

1;

When going through the debugger, each array element is listed as Invalid variable attributes.

I filter the array down with a simple grep expression, and the result array @objects_filter shows the same problem.

Exploring the arrays in the WATCH window shows that everything is actually working as expected:

image

richterger commented 2 years ago

duplicate of #120