| 1 | package PLS::Server::Response::Hover; | ||||||||||
| 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 q(PLS::Server::Response); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 13 | ▶ | use PLS::Parser::Document; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | PLS::Server::Response::Hover | ||||||||||
| 13 | |||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||
| 15 | |||||||||||
| 16 | This is a message from the server to the client with | ||||||||||
| 17 | documentation for the location the mouse is currently hovering. | ||||||||||
| 18 | |||||||||||
| 19 | =cut | ||||||||||
| 20 | |||||||||||
| 21 | sub new | ||||||||||
| 22 | 0 | ▶ | { | ||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 23 | 0 | my ($class, $request) = @_; | |||||||||
| 24 | |||||||||||
| 25 | my $self = bless { | ||||||||||
| 26 | id => $request->{id}, | ||||||||||
| 27 | 0 | result => undef | |||||||||
| 28 | }, $class; | ||||||||||
| 29 | |||||||||||
| 30 | 0 | my $document = PLS::Parser::Document->new(uri => $request->{params}{textDocument}{uri}, line => $request->{params}{position}{line}); | |||||||||
| 31 | 0 | ▶ | return $self if (ref $document ne 'PLS::Parser::Document'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | my ($ok, $pod) = $document->find_pod($request->{params}{textDocument}{uri}, 1, $request->{params}{position}{character}); | |||||||||
| 33 | 0 | ▶ | return $self unless $ok; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | |||||||||||
| 35 | $self->{result} = { | ||||||||||
| 36 | 0 | contents => {kind => 'markdown', value => ${$pod->{markdown}}}, | |||||||||
| 37 | range => $pod->{element}->range() | ||||||||||
| 38 | 0 | }; | |||||||||
| 39 | |||||||||||
| 40 | 0 | return $self; | |||||||||
| 41 | } ## end sub new | ||||||||||
| 42 | |||||||||||
| 43 | 13 | 1; | |||||||||