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