| 1 | package PLS::Server::Response::SignatureHelp; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use parent q(PLS::Server::Response); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use PLS::Parser::Document; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | PLS::Server::Response::SignatureHelp | ||||||||||
| 13 | |||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||
| 15 | |||||||||||
| 16 | This is a message from the server to the client with information about the | ||||||||||
| 17 | parameters of the current function. | ||||||||||
| 18 | |||||||||||
| 19 | =cut | ||||||||||
| 20 | |||||||||||
| 21 | sub new | ||||||||||
| 22 | { | ||||||||||
| 23 | 0 | ▶ | my ($class, $request) = @_; | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | my ($line, $character) = @{$request->{params}{position}}{qw(line character)}; | |||||||||
| 26 | 0 | my $document = PLS::Parser::Document->new(uri => $request->{params}{textDocument}{uri}, line => $line); | |||||||||
| 27 | |||||||||||
| 28 | 0 | my $list = $document->find_current_list($line, $character); | |||||||||
| 29 | 0 | my $results = $document->go_to_definition_of_closest_subroutine($list, $line, $character); | |||||||||
| 30 | 0 | my @signatures = map { $_->{signature} } @{$results}; | |||||||||
| 31 | 0 | my $active_parameter = $document->get_list_index($list, $request->{params}{position}{line}, $request->{params}{position}{character}); | |||||||||
| 32 | |||||||||||
| 33 | my %self = ( | ||||||||||
| 34 | id => $request->{id}, | ||||||||||
| 35 | 0 | ▶ | result => scalar @signatures ? {signatures => \@signatures, activeParameter => $active_parameter} : undef | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | ); | ||||||||||
| 37 | |||||||||||
| 38 | 0 | return bless \%self, $class; | |||||||||
| 39 | } ## end sub new | ||||||||||
| 40 | |||||||||||
| 41 | 1 | 1; | |||||||||