richterger / Perl-LanguageServer

Language Server for Perl
Other
224 stars 53 forks source link

Go to Definition does not work for multiple variable declaration #58

Closed utgwkk closed 3 years ago

utgwkk commented 3 years ago

Step to reproduce

  1. Hover over $b of the following code
  2. Run "Go to Definition"
use strict;
use warnings;

sub sum {
    my ($a, $b) = @_;

    return $a + $b;
}

print sum(3, 5);

Expected behavior

Jump to line 5 (the line of my ($a, $b) = @_;)

Actual behavior

No definition found for 'b'.

richterger commented 3 years ago

Goto Definition is turned off for local variables (ie. delcared via my) by default. You can enable it with showLocalVars setting.