File Coverage

blib/lib/PLS/Server/Method/Workspace.pm
Criterion Covered Total %
statement 24 38 63.1
branch 0 12 0.0
condition n/a
subroutine 8 9 88.8
pod 0 1 0.0
total 32 60 53.3


line stmt bran cond sub pod time code
1             package PLS::Server::Method::Workspace;
2              
3 11     11   140 use strict;
  11         161  
  11         1025  
4 11     11   105 use warnings;
  11         105  
  11         2999  
5              
6 11     11   9036 use PLS::Server::Request::Workspace::Configuration;
  11         80  
  11         694  
7 11     11   6383 use PLS::Server::Request::Workspace::DidChangeConfiguration;
  11         46  
  11         409  
8 11     11   5588 use PLS::Server::Request::Workspace::DidChangeWatchedFiles;
  11         153  
  11         897  
9 11     11   5474 use PLS::Server::Request::Workspace::DidChangeWorkspaceFolders;
  11         51  
  11         408  
10 11     11   5490 use PLS::Server::Request::Workspace::ExecuteCommand;
  11         25  
  11         401  
11 11     11   4983 use PLS::Server::Request::Workspace::Symbol;
  11         156  
  11         2235  
12              
13             =head1 NAME
14              
15             PLS::Server::Method::Workspace
16              
17             =head1 DESCRIPTION
18              
19             This module redirects requests starting with C<workspace/> to the appropriate
20             subclass of L<PLS::Server::Request> for the type of request.
21              
22             Requests currently implemented:
23              
24             =over
25              
26             =item workspace/didChangeConfiguration - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeConfiguration>
27              
28             L<PLS::Server::Request::Workspace::DidChangeConfiguration>
29              
30             =item workspace/didChangeWatchedFiles - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWatchedFiles>
31              
32             L<PLS::Server::Request::Workspace::DidChangeWatchedFiles>
33              
34             =item workspace/didChangeWorkspaceFolders - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWorkspaceFolders>
35              
36             L<PLS::Server::Request::Workspace::DidChangeWorkspaceFolders>
37              
38             =item workspace/configuration - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_configuration>
39              
40             L<PLS::Server::Request::Workspace::Configuration>
41              
42             =item workspace/executeCommand - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand>
43              
44             L<PLS::Server::Request::Workspace::ExecuteCommand>
45              
46             =back
47              
48             =cut
49              
50             sub get_request
51             {
52 0     0 0   my ($request) = @_;
53              
54 0           my (undef, $method) = split m{/}, $request->{method};
55              
56 0 0         if ($method eq 'didChangeConfiguration')
57             {
58 0           return PLS::Server::Request::Workspace::DidChangeConfiguration->new($request);
59             }
60 0 0         if ($method eq 'didChangeWatchedFiles')
61             {
62 0           return PLS::Server::Request::Workspace::DidChangeWatchedFiles->new($request);
63             }
64 0 0         if ($method eq 'didChangeWorkspaceFolders')
65             {
66 0           return PLS::Server::Request::Workspace::DidChangeWorkspaceFolders->new($request);
67             }
68 0 0         if ($method eq 'configuration')
69             {
70 0           return PLS::Server::Request::Workspace::Configuration->new($request);
71             }
72 0 0         if ($method eq 'executeCommand')
73             {
74 0           return PLS::Server::Request::Workspace::ExecuteCommand->new($request);
75             }
76 0 0         if ($method eq 'symbol')
77             {
78 0           return PLS::Server::Request::Workspace::Symbol->new($request);
79             }
80             } ## end sub get_request
81              
82             1;