| 1 | package PLS::Server::Response::Resolve; | ||||||||||||||||||||||||||||||||||||
| 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 '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 | 1 | ▶ | use PLS::Parser::Pod::Package; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use PLS::Parser::Pod::Subroutine; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use PLS::Parser::Pod::Builtin; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||
| 13 | =head1 NAME | ||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||
| 15 | PLS::Server::Response::Resolve | ||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||
| 17 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||
| 19 | This is a message from the server to the client with documentation | ||||||||||||||||||||||||||||||||||||
| 20 | about the currently selected completion item. | ||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||
| 22 | =cut | ||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||
| 24 | sub new | ||||||||||||||||||||||||||||||||||||
| 25 | { | ||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | my ($class, $request) = @_; | ||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=17 SCAR=57.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||
| 28 | 0 | my $self = {id => $request->{id}, result => undef}; | |||||||||||||||||||||||||||||||||||
| 29 | 0 | bless $self, $class; | |||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||
| 31 | 0 | my $index = PLS::Parser::Document->get_index(); | |||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | return $self unless (ref $index eq 'PLS::Parser::Index'); | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||
| 34 | 0 | my $kind = $request->{params}{kind}; | |||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | if ($kind == 7) | ||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||
| 37 | { | ||||||||||||||||||||||||||||||||||||
| 38 | 0 | my $pod = PLS::Parser::Pod::Package->new(index => $index, package => $request->{params}{label}); | |||||||||||||||||||||||||||||||||||
| 39 | 0 | my $ok = $pod->find(); | |||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if ($ok) | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||||||||||
| 43 | 0 | $self->{result} = $request->{params}; | |||||||||||||||||||||||||||||||||||
| 44 | 0 | $self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; | |||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||
| 46 | } ## end if ($kind == 7) | ||||||||||||||||||||||||||||||||||||
| 47 | ▶ | elsif ($kind == 3 or $kind == 21) | |||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$kind == 3 or $kind == 21
MC/DC0%0/2
$kind == 3 or $kind == 21
$kind == 3
$kind == 21
Truth table0%0/3
A or B
A= $kind == 3B= $kind == 21
| |||||||||||||||||||||||||||||||||||||
| 48 | { | ||||||||||||||||||||||||||||||||||||
| 49 | 0 | my ($package, $subroutine); | |||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if ($request->{params}{label} =~ /->/ or ($request->{params}{sortText} // '') =~ /->/) | ||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/5
$request->{"params"}{"label"} =~ /->/ or ($request->{"params"}{"sortText"} // "") =~ /->/
$request->{"params"}{"sortText"} // ""
MC/DC0%0/2
$request->{"params"}{"label"} =~ /->/ or ($request->{"params"}{"sortText"} // "") =~ /->/
$request->{"params"}{"label"} =~ /->/
$request->{"params"}{"sortText"}
Truth table0%0/3
A or B
A= $request->{"params"}{"label"} =~ /->/B= $request->{"params"}{"sortText"}
| |||||||||||||||||||||||||||||||||||||
| 52 | { | ||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | my $label = $request->{params}{label} =~ /->/ ? $request->{params}{label} : $request->{params}{sortText}; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 54 | 0 | ($package, $subroutine) = split /->/, $label; | |||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||
| 56 | ▶ | elsif ($request->{params}{label} =~ /::/ or ($request->{params}{filterText} // '') =~ /::/) | |||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$request->{"params"}{"label"} =~ /::/ or ($request->{"params"}{"filterText"} // "") =~ /::/
$request->{"params"}{"filterText"} // ""
MC/DC0%0/2
$request->{"params"}{"label"} =~ /::/ or ($request->{"params"}{"filterText"} // "") =~ /::/
$request->{"params"}{"label"} =~ /::/
$request->{"params"}{"filterText"}
Truth table0%0/3
A or B
A= $request->{"params"}{"label"} =~ /::/B= $request->{"params"}{"filterText"}
| |||||||||||||||||||||||||||||||||||||
| 57 | { | ||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | my $label = $request->{params}{label} =~ /::/ ? $request->{params}{label} : $request->{params}{filterText}; | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 59 | 0 | my @parts = split /::/, $label; | |||||||||||||||||||||||||||||||||||
| 60 | 0 | $subroutine = pop @parts; | |||||||||||||||||||||||||||||||||||
| 61 | 0 | $package = join '::', @parts; | |||||||||||||||||||||||||||||||||||
| 62 | } ## end elsif ($request->{params}...) | ||||||||||||||||||||||||||||||||||||
| 63 | else | ||||||||||||||||||||||||||||||||||||
| 64 | { | ||||||||||||||||||||||||||||||||||||
| 65 | 0 | $subroutine = $request->{params}{label}; | |||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||
| 68 | 0 | my $pod = PLS::Parser::Pod::Subroutine->new(index => $index, package => $package, subroutine => $subroutine); | |||||||||||||||||||||||||||||||||||
| 69 | 0 | my $ok = $pod->find(); | |||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if ($ok) | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 72 | { | ||||||||||||||||||||||||||||||||||||
| 73 | 0 | $self->{result} = $request->{params}; | |||||||||||||||||||||||||||||||||||
| 74 | 0 | $self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; | |||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||
| 76 | } ## end elsif ($kind == 3 or $kind...) | ||||||||||||||||||||||||||||||||||||
| 77 | elsif ($kind == 14) | ||||||||||||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||||||||||
| 79 | 0 | my $pod = PLS::Parser::Pod::Builtin->new(function => $request->{params}{label}); | |||||||||||||||||||||||||||||||||||
| 80 | 0 | my $ok = $pod->find(); | |||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | if ($ok) | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 83 | { | ||||||||||||||||||||||||||||||||||||
| 84 | 0 | $self->{result} = $request->{params}; | |||||||||||||||||||||||||||||||||||
| 85 | 0 | $self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; | |||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||
| 89 | 0 | return $self; | |||||||||||||||||||||||||||||||||||
| 90 | } ## end sub new | ||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||
| 92 | 1 | 1; | |||||||||||||||||||||||||||||||||||