blib/lib/PLS/Server/Method/TextDocument.pm

filter: Statementstmt 82.8% 53 / 64 Branchbran 45.4% 10 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 14 / 14 Podpod 0.0% 0 / 1 totaltotal 76.2% 77 / 101 CC 12 SCAR 27.0
CC
12
Cov
73%
get_request
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 14.9
« blib/lib/PLS/Util.pm ↑ Summary blib/lib/PLS/JSON.pm »
1 package PLS::Server::Method::TextDocument;
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 PLS::Server::Request::TextDocument::Completion;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 13 ▶use PLS::Server::Request::TextDocument::Definition;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 13 ▶use PLS::Server::Request::TextDocument::DidChange;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 13 ▶use PLS::Server::Request::TextDocument::DidClose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 13 ▶use PLS::Server::Request::TextDocument::DidOpen;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 13 ▶use PLS::Server::Request::TextDocument::DidSave;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 13 ▶use PLS::Server::Request::TextDocument::DocumentSymbol;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 13 ▶use PLS::Server::Request::TextDocument::Formatting;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 13 ▶use PLS::Server::Request::TextDocument::Hover;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 13 ▶use PLS::Server::Request::TextDocument::SignatureHelp;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 13 ▶use PLS::Server::Request::TextDocument::RangeFormatting;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 =head1 NAME
19  
20 PLS::Server::Method::TextDocument
21  
22 =head1 DESCRIPTION
23  
24 This module redirects requests starting with C<textDocument/> to the appropriate
25 subclass of L<PLS::Server::Request> for the type of request.
26  
27 Requests currently implemented:
28  
29 =over
30  
31 =item textDocument/definition - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition>
32  
33 L<PLS::Server::Request::TextDocument::Definition>
34  
35 =item textDocument/documentSymbol - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol>
36  
37 L<PLS::Server::Request::TextDocument::DocumentSymbol>
38  
39 =item textDocument/hover - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover>
40  
41 L<PLS::Server::Request::TextDocument::Hover>
42  
43 =item textDocument/signatureHelp - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_signatureHelp>
44  
45 L<PLS::Server::Request::TextDocument::SignatureHelp>
46  
47 =item textDocument/didOpen - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didOpen>
48  
49 L<PLS::Server::Request::TextDocument::DidOpen>
50  
51 =item textDocument/didChange - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didChange>
52  
53 L<PLS::Server::Request::TextDocument::DidChange>
54  
55 =item textDocument/didClose - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didClose>
56  
57 L<PLS::Server::Request::TextDocument::DidClose>
58  
59 =item textDocument/didSave - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave>
60  
61 L<PLS::Server::Request::TextDocument::DidSave>
62  
63 =item textDocument/formatting - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting>
64  
65 L<PLS::Server::Request::TextDocument::Formatting>
66  
67 =item textDocument/rangeFormatting - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting>
68  
69 L<PLS::Server::Request::TextDocument::RangeFormatting>
70  
71 =item textDocument/completion - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion>
72  
73 L<PLS::Server::Request::TextDocument::Completion>
74  
75 =back
76  
77 =cut
78  
79 sub get_request
80 3 ▶{
Subroutine get_request: called CC=12 SCAR=34.0
Pod undocumented
81 3 my ($request) = @_;
82  
83 3 my (undef, $method) = split m{/}, $request->{method};
84  
85 3 ▶ if ($method eq 'definition')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "definition") 0 3 3
86 {
87 0 return PLS::Server::Request::TextDocument::Definition->new($request);
88 }
89 3 ▶ if ($method eq 'documentSymbol')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "documentSymbol") 0 3 3
90 {
91 0 return PLS::Server::Request::TextDocument::DocumentSymbol->new($request);
92 }
93 3 ▶ if ($method eq 'hover')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "hover") 0 3 3
94 {
95 0 return PLS::Server::Request::TextDocument::Hover->new($request);
96 }
97 3 ▶ if ($method eq 'signatureHelp')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "signatureHelp") 0 3 3
98 {
99 0 return PLS::Server::Request::TextDocument::SignatureHelp->new($request);
100 }
101 3 ▶ if ($method eq 'didOpen')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "didOpen") 2 1 3
102 {
103 2 return PLS::Server::Request::TextDocument::DidOpen->new($request);
104 }
105 1 ▶ if ($method eq 'didChange')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "didChange") 0 1 1
106 {
107 0 return PLS::Server::Request::TextDocument::DidChange->new($request);
108 }
109 1 ▶ if ($method eq 'didClose')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "didClose") 0 1 1
110 {
111 0 return PLS::Server::Request::TextDocument::DidClose->new($request);
112 }
113 1 ▶ if ($method eq 'didSave')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "didSave") 0 1 1
114 {
115 0 return PLS::Server::Request::TextDocument::DidSave->new($request);
116 }
117 1 ▶ if ($method eq 'formatting')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "formatting") 1 0 1
118 {
119 1 return PLS::Server::Request::TextDocument::Formatting->new($request);
120 }
121 0 ▶ if ($method eq 'rangeFormatting')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "rangeFormatting") 0 0 0
122 {
123 0 return PLS::Server::Request::TextDocument::RangeFormatting->new($request);
124 }
125 0 ▶ if ($method eq 'completion')
Branch: 1 branch
BranchTrueFalseTotal
if ($method eq "completion") 0 0 0
126 {
127 0 return PLS::Server::Request::TextDocument::Completion->new($request);
128 }
129 } ## end sub get_request
130  
131 13 1;
« blib/lib/PLS/Util.pm ↑ Summary blib/lib/PLS/JSON.pm »