File Coverage

blib/lib/PLS/Server/Request/Workspace/ApplyEdit.pm
Criterion Covered Total %
statement 12 18 66.6
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 24 66.6


line stmt bran cond sub pod time code
1             package PLS::Server::Request::Workspace::ApplyEdit;
2              
3 11     11   63 use strict;
  11         14  
  11         453  
4 11     11   73 use warnings;
  11         87  
  11         474  
5              
6 11     11   138 use parent 'PLS::Server::Request';
  11         3101  
  11         89  
7              
8 11     11   1451 use URI;
  11         38  
  11         2188  
9              
10             =head1 NAME
11              
12             PLS::Server::Request::Workspace::ApplyEdit
13              
14             =head1 DESCRIPTION
15              
16             This is a message from the server to the client requesting that
17             an edit be made to one or more sections of one or more documents.
18              
19             =cut
20              
21             sub new
22             {
23 0     0 0   my ($class, %args) = @_;
24              
25 0           my $uri = URI::file->new($args{path})->as_string;
26 0           my $text = $args{text};
27              
28             my $self = {
29             method => 'workspace/applyEdit',
30             params => {
31             edit => {
32             changes => {
33             $uri => [
34             {
35             range => {
36             start => {line => 0, character => 0},
37             end => {line => $args{lines}, character => 0}
38             },
39 0           newText => ${$text}
  0            
40             }
41             ]
42             }
43             }
44             }
45             };
46              
47 0           return bless $self, $class;
48             } ## end sub new
49              
50             1;