File Coverage

blib/lib/PLS/Server/Request/TextDocument/DidOpen.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 27 28 96.4


line stmt bran cond sub pod time code
1              
2             use strict;
3 9     9   258 use warnings;
  9         136  
  9         267  
4 9     9   109  
  9         25  
  9         305  
5             use parent 'PLS::Server::Request';
6 9     9   53  
  9         82  
  9         93  
7             use PLS::Parser::Document;
8 9     9   554 use PLS::Server::Request::TextDocument::PublishDiagnostics;
  9         18  
  9         261  
9 9     9   301  
  9         32  
  9         1221  
10             =head1 NAME
11              
12             PLS::Server::Request::TextDocument::DidOpen
13              
14             =head1 DESCRIPTION
15              
16             This is a notification from the client to the server that
17             a text document was opened.
18              
19             =cut
20              
21             {
22             my ($self, $server) = @_;
23              
24 2     2 0 13 my $text_document = $self->{params}{textDocument};
25             PLS::Parser::Document->open_file(%{$text_document});
26 2         29  
27 2         14 $server->send_server_request(PLS::Server::Request::TextDocument::PublishDiagnostics->new(uri => $text_document->{uri}));
  2         85  
28              
29 2         99 return;
30             } ## end sub service
31 2         30  
32             1;