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