« blib/lib/PLS/Server/Request/Factory.pm
↑ Summary
blib/lib/PLS/Server/Request/Workspace/ExecuteCommand.pm »
| 1 | package PLS::Server::Request::Workspace::DidChangeWorkspaceFolders; | ||
| 2 | |||
| 3 | 13 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 13 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 13 | ▶ | use parent 'PLS::Server::Request'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 13 | ▶ | use URI; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 13 | ▶ | use PLS::Parser::Index; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | PLS::Server::Request::Workspace::DidChangeWorkspaceFolders | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | This is a notification from the client to the server that | ||
| 19 | workspace folders were added or removed. | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | sub service | ||
| 24 | 0 | ▶ | { |
|
Subroutine
service: not called CC=3 SCAR=24.8
Pod
undocumented
| |||
| 25 | 0 | my ($self) = @_; | |
| 26 | |||
| 27 | 0 | my $added = $self->{params}{event}{added}; | |
| 28 | 0 | my $removed = $self->{params}{event}{removed}; | |
| 29 | |||
| 30 | 0 | my $index = PLS::Parser::Index->new(); | |
| 31 | |||
| 32 | 0 | foreach my $folder (@{$removed}) | |
| 33 | { | ||
| 34 | 0 | my $path = URI->new($folder->{uri})->file; | |
| 35 | 0 | $index->deindex_workspace($path); | |
| 36 | } | ||
| 37 | |||
| 38 | 0 | foreach my $folder (@{$added}) | |
| 39 | { | ||
| 40 | 0 | my $path = URI->new($folder->{uri})->file; | |
| 41 | 0 | $index->index_workspace($path); | |
| 42 | } | ||
| 43 | |||
| 44 | 0 | return; | |
| 45 | } ## end sub service | ||
| 46 | |||
| 47 | 13 | 1; | |