PLS/Server/Request/Initialize.pm

filter: Statementstmt 75.6% 28 / 37 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 1 totaltotal 77.0% 37 / 48 CC 1 SCAR 1.0
CC
1
Cov
76%
service
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« PLS/Server/Request/TextDocument/DidSave.pm ↑ Summary PLS/Parser/Pod/Method.pm »
1 package PLS::Server::Request::Initialize;
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::Request';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use PPI::Document;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use PLS::Parser::Document;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use PLS::Parser::Index;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use PLS::Server::Response::InitializeResult;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use PLS::Server::State;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 =head1 NAME
17  
18 PLS::Server::Request::Initialize
19  
20 =head1 DESCRIPTION
21  
22 This is the first request from the client to the server.
23  
24 The client provides information about itself, and the server performs
25 some initialization for itself and returns its capabilities.
26  
27 =cut
28  
29 sub service
30 {
31 0 ▶ my ($self) = @_;
Subroutine service: not called CC=1 SCAR=6.9
Pod undocumented
32  
33 0 my $root_uri = $self->{params}{rootUri};
34 0 my $path = URI->new($root_uri);
35 0 $PLS::Server::State::ROOT_PATH = $path->file;
36  
37 0 my $index = PLS::Parser::Index->new(root => $path->file);
38 0 $index->index_files();
39 0 $index->load_trie();
40 0 PLS::Parser::Document->set_index($index);
41 0 return PLS::Server::Response::InitializeResult->new($self);
42 } ## end sub service
43  
44 1 1;
« PLS/Server/Request/TextDocument/DidSave.pm ↑ Summary PLS/Parser/Pod/Method.pm »