richterger / Perl-LanguageServer

Language Server for Perl
Other
224 stars 51 forks source link

Using multiline qx strings - Function outline in VSCode is off by one line #92

Open ESSKA-de opened 3 years ago

ESSKA-de commented 3 years ago

Hi,

i'm using many multiline qx Strings in my codes. For example:

use strict;
use utf8;

sub sub1 {
    return qq|
        Hello world 1
    |;
}

sub sub2 {
    return qq|
        Hello world 2
    |;
}

sub sub3 {
    return qq|
        Hello world 2
    |;
}

If you click the functions in the Outline view in VSCode, you are supposed to jump to the corresponding line 'sub ... {'.

For the first sub (sub1) this is the case. image

For sub2 you jump one line after 'sub sub2 {' image

And for sub3 you jump two lines after 'sub sub3'. image

It looks like you are off by one line for each qx| which is in the code before the clicked sub. This error only occurs, if there is a newline right after qx|. If you for example add a space (or any other character) after qx|, the problem does not occur.

Not ok - all following subs are off by one line: image

Ok: image