| 1 | package PLS::Server::Response::Formatting; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use parent q(PLS::Server::Response); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use PLS::Parser::Document; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | PLS::Server::Response::Formatting | ||||||||||
| 13 | |||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||
| 15 | |||||||||||
| 16 | This is a message from the server to the client with the current document | ||||||||||
| 17 | after having been formatted. | ||||||||||
| 18 | |||||||||||
| 19 | =cut | ||||||||||
| 20 | |||||||||||
| 21 | sub new | ||||||||||
| 22 | { | ||||||||||
| 23 | 0 | ▶ | my ($class, $request) = @_; | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | my $self = bless {id => $request->{id}}, $class; | |||||||||
| 26 | 0 | my ($ok, $formatted) = PLS::Parser::Document->format(uri => $request->{params}{textDocument}{uri}, formatting_options => $request->{params}{options}); | |||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | if ($ok) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | { | ||||||||||
| 30 | 0 | $self->{result} = $formatted; | |||||||||
| 31 | } | ||||||||||
| 32 | else | ||||||||||
| 33 | { | ||||||||||
| 34 | 0 | $self->{error} = $formatted; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | return $self; | |||||||||
| 38 | } ## end sub new | ||||||||||
| 39 | |||||||||||
| 40 | 1 | 1; | |||||||||