richterger / Perl-LanguageServer

Language Server for Perl
Other
222 stars 53 forks source link

regular expressions eliminated from debug view #66

Open dseynhae opened 3 years ago

dseynhae commented 3 years ago

I have a $splittervariable which is a parameter of one of my subroutines:

  my $splitter = qr{
      [,\s]+  # Sequence of commas/spaces
      (?=     # Start of instruction '['
      [[]
      )
      }smx;
  my $list_items = import_list_items( $list, $splitter );

Inside the subroutine:

sub import_list_items {
  my ( $input, $splitter ) = @_;

  # Default splitter: commas and spaces
  if ( !( defined $splitter ) ) { $splitter = qr/[,\s]+/smx; }

I am monitoring the content of splitter in the debugger (both as a "locals" variable and an expression in the "watch" window).

However, as soon as the qr expression is assigned to the variable:

Not sure if this is intended behavior, but it certainly isn't what I expect: something like:

(?^msx:

      [,\s]+  # Sequence of commas/spaces

      (?=     # Start of instruction '['

      [[]

      )

      )