| 1 | package PLS::Server::Request::TextDocument::DidOpen; | ||
| 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 PLS::Parser::Document; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 13 | ▶ | use PLS::Parser::PackageSymbols; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 13 | ▶ | use PLS::Server::Request::TextDocument::PublishDiagnostics; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | PLS::Server::Request::TextDocument::DidOpen | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | This is a notification from the client to the server that | ||
| 19 | a text document was opened. | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | sub service | ||
| 24 | 2 | ▶ | { |
|
Subroutine
service: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 25 | 2 | my ($self, $server) = @_; | |
| 26 | |||
| 27 | 2 | my $text_document = $self->{params}{textDocument}; | |
| 28 | 2 | PLS::Parser::Document->open_file(%{$text_document}); | |
| 29 | |||
| 30 | 2 | $server->send_server_request(PLS::Server::Request::TextDocument::PublishDiagnostics->new(uri => $text_document->{uri})); | |
| 31 | |||
| 32 | # Warm up the cache for imported package symbols | ||
| 33 | 2 | my $text = PLS::Parser::Document->text_from_uri($text_document->{uri}); | |
| 34 | 2 | my $imports = PLS::Parser::Document->get_imports($text); | |
| 35 | 2 | PLS::Parser::PackageSymbols::get_imported_package_symbols($PLS::Server::State::CONFIG, @{$imports})->retain(); | |
| 36 | |||
| 37 | 2 | return; | |
| 38 | } ## end sub service | ||
| 39 | |||
| 40 | 13 | 1; | |