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