line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PLS::Server::Request::Workspace::DidChangeWatchedFiles; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
62
|
use strict; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
227
|
|
4
|
9
|
|
|
9
|
|
37
|
use warnings; |
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
208
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
37
|
use parent 'PLS::Server::Request'; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
45
|
|
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
683
|
use List::Util qw(any uniq); |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
1555
|
|
9
|
9
|
|
|
9
|
|
62
|
use Path::Tiny; |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
1060
|
|
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
9
|
|
57
|
use PLS::Parser::Index; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
245
|
|
12
|
9
|
|
|
9
|
|
60
|
use PLS::Server::Request::TextDocument::PublishDiagnostics; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
3323
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
PLS::Server::Request::Workspace::DidChangeWatchedFiles |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This is a notification from the client to the server indicating |
21
|
|
|
|
|
|
|
that one or more files that the server watched have changed. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
The server queues up these files to be re-indexed. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub service |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
0
|
0
|
|
my ($self, $server) = @_; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
return if (ref $self->{params}{changes} ne 'ARRAY'); |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $index = PLS::Parser::Index->new(); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my @changed_files; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
foreach my $change (@{$self->{params}{changes}}) |
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
|
|
|
my $file = URI->new($change->{uri}); |
40
|
0
|
0
|
|
|
|
|
next if (ref $file ne 'URI::file'); |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
if ($change->{type} == 3) |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
|
|
|
$index->cleanup_file($file->file); |
45
|
0
|
|
|
|
|
|
next; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
next if ($file->file =~ /\/\.pls-tmp-[^\/]*$/); |
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
|
|
|
next unless $index->is_perl_file($file->file); |
51
|
0
|
0
|
|
|
|
|
next if $index->is_ignored($file->file); |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
push @changed_files, $change->{uri}; |
54
|
|
|
|
|
|
|
} ## end foreach my $change (@{$self...}) |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
@changed_files = uniq @changed_files; |
57
|
0
|
0
|
|
0
|
|
|
$index->index_files(@changed_files)->then(sub { Future->wait_all(@_) })->retain() if (scalar @changed_files); |
|
0
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return; |
60
|
|
|
|
|
|
|
} ## end sub service |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |