File Coverage

blib/lib/PLS/Server/Response/InitializeResult.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 2 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1              
2             use strict;
3 9     9   53 use warnings;
  9         17  
  9         189  
4 9     9   36  
  9         17  
  9         187  
5             use parent q(PLS::Server::Response);
6 9     9   36  
  9         18  
  9         35  
7             use PLS::JSON;
8 9     9   553 use PLS::Server::State;
  9         10  
  9         941  
9 9     9   142  
  9         17  
  9         1834  
10             =head1 NAME
11              
12             PLS::Server::Response::InitializeResult
13              
14             =head1 DESCRIPTION
15              
16             This is a message from the server to the client with the result
17             of initialization.
18              
19             This message contains information about the server's capabilities.
20              
21             =cut
22              
23             {
24             my ($class, $request) = @_;
25              
26 5     5 0 21 my %self = (
27             id => $request->{id},
28             result => {
29             capabilities => {
30 5         111 completionItem => {
31             labelDetailsSupport => PLS::JSON::true
32             },
33             definitionProvider => PLS::JSON::true,
34             documentSymbolProvider => PLS::JSON::true,
35             hoverProvider => PLS::JSON::true,
36             signatureHelpProvider => {
37             triggerCharacters => ['(', ',']
38             },
39             textDocumentSync => {
40             openClose => PLS::JSON::true,
41             change => 2,
42             save => PLS::JSON::true,
43             },
44             documentFormattingProvider => PLS::JSON::true,
45             documentRangeFormattingProvider => PLS::JSON::true,
46             completionProvider => {
47             triggerCharacters => ['>', ':', '$', '@', '%', ' ', '-'],
48             resolveProvider => PLS::JSON::true,
49             },
50             executeCommandProvider => {
51             commands => ['pls.sortImports']
52             },
53             workspaceSymbolProvider => PLS::JSON::true,
54             workspace => {
55             workspaceFolders => {
56             supported => PLS::JSON::true,
57             changeNotifications => PLS::JSON::true
58             }
59             }
60             }
61             }
62             );
63              
64             return bless \%self, $class;
65             } ## end sub new
66 5         493  
67             {
68             my ($self) = @_;
69              
70             $PLS::Server::State::INITIALIZED = 1;
71 5     5 0 13 return $self->SUPER::serialize();
72             } ## end sub serialize
73 5         19  
74 5         94 1;