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              
2             use strict;
3 9     9   118 use warnings;
  9         461  
  9         558  
4 9     9   111  
  9         187  
  9         784  
5             use PLS::Server::Request::Workspace::Configuration;
6 9     9   4422 use PLS::Server::Request::Workspace::DidChangeConfiguration;
  9         26  
  9         383  
7 9     9   4067 use PLS::Server::Request::Workspace::DidChangeWatchedFiles;
  9         25  
  9         325  
8 9     9   3540 use PLS::Server::Request::Workspace::DidChangeWorkspaceFolders;
  9         19  
  9         347  
9 9     9   3397 use PLS::Server::Request::Workspace::ExecuteCommand;
  9         18  
  9         363  
10 9     9   3504 use PLS::Server::Request::Workspace::Symbol;
  9         18  
  9         249  
11 9     9   3253  
  9         18  
  9         1313  
12             =head1 NAME
13              
14             PLS::Server::Method::Workspace
15              
16             =head1 DESCRIPTION
17              
18             This module redirects requests starting with C<workspace/> to the appropriate
19             subclass of L<PLS::Server::Request> for the type of request.
20              
21             Requests currently implemented:
22              
23             =over
24              
25             =item workspace/didChangeConfiguration - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeConfiguration>
26              
27             L<PLS::Server::Request::Workspace::DidChangeConfiguration>
28              
29             =item workspace/didChangeWatchedFiles - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWatchedFiles>
30              
31             L<PLS::Server::Request::Workspace::DidChangeWatchedFiles>
32              
33             =item workspace/didChangeWorkspaceFolders - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWorkspaceFolders>
34              
35             L<PLS::Server::Request::Workspace::DidChangeWorkspaceFolders>
36              
37             =item workspace/configuration - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_configuration>
38              
39             L<PLS::Server::Request::Workspace::Configuration>
40              
41             =item workspace/executeCommand - L<https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand>
42              
43             L<PLS::Server::Request::Workspace::ExecuteCommand>
44              
45             =back
46              
47             =cut
48              
49             {
50             my ($request) = @_;
51              
52 0     0 0   my (undef, $method) = split '/', $request->{method};
53              
54 0           if ($method eq 'didChangeConfiguration')
55             {
56 0 0         return PLS::Server::Request::Workspace::DidChangeConfiguration->new($request);
57             }
58 0           if ($method eq 'didChangeWatchedFiles')
59             {
60 0 0         return PLS::Server::Request::Workspace::DidChangeWatchedFiles->new($request);
61             }
62 0           if ($method eq 'didChangeWorkspaceFolders')
63             {
64 0 0         return PLS::Server::Request::Workspace::DidChangeWorkspaceFolders->new($request);
65             }
66 0           if ($method eq 'configuration')
67             {
68 0 0         return PLS::Server::Request::Workspace::Configuration->new($request);
69             }
70 0           if ($method eq 'executeCommand')
71             {
72 0 0         return PLS::Server::Request::Workspace::ExecuteCommand->new($request);
73             }
74 0           if ($method eq 'symbol')
75             {
76 0 0         return PLS::Server::Request::Workspace::Symbol->new($request);
77             }
78 0           } ## end sub get_request
79              
80             1;