richterger / Perl-LanguageServer

Language Server for Perl
Other
220 stars 53 forks source link

Comment not recognized when using x flag on regular expressions #142

Closed dseynhae closed 2 years ago

dseynhae commented 2 years ago

Consider the following code which strips information out of a line:

  $line =~ s{
      \s*        # Strip trailing blanks
      \\?        # => Optional continuation character
   $}{}smx;

It was written taking advantage of the xflag, which ignores white-space (including comments)

However, the VS Code editor doesn't understand that the comments are really active comments, and not part of the pattern:

image

Note that the real comments on the other lines are recognized (faded color). I would expect the comments within the x flagged pattern also to be recognized.

richterger commented 2 years ago

The syntax colors are not part of the Perl::LanguageServer, but done by vscode itself. So this is the wrong place to ask.