S::JSON;
use strict;
use warnings;
use Exporter qw(import);
my $package;
BEGIN
{
if ($INC{'Cpanel/JSON/XS.pm'} or eval { require Cpanel::JSON::XS; 1 })
{
$package = 'Cpanel::JSON::
C{'JSON/XS.pm'} or eval { require JSON::XS; 1 }) and eval { JSON::XS->VERSION(3.0); 1 })
{
$package = 'JSON::XS';
}
else
{
require JSON::PP;
$package = 'JSON::P
ort(qw(encode_json decode_json));
*PLS::JSON::true = $package->can('true');
*PLS::JSON::false = $package->can('false');
} ## end BEGIN
our @EXPORT = qw(encode_json decode_json); ## no cr
ict;
use warnings;
use parent 'PLS::Server::Request';
use List::Util;
use Path::Tiny;
use PLS::JSON;
use PLS::Server::Request::Workspace::Configuration;
use PLS::Server::Request::Client::RegisterCa
dexing',
cancellable => PLS::JSON::false,
percentage => 0
IO::Async::Signal;
use IO::Async::Stream;
use IO::Handle;
use Scalar::Util qw(blessed);
use PLS::JSON;
use PLS::Server::Request::Factory;
use PLS::Server::Response;
use PLS::Server::Response::Cancell
$buffref}) < $size);
my $json = substr ${$buffref}, 0, $size, '';
$size = 0;
my $content = decode_json $json;
$self->handle_client_me
('PLS::Server::Message'));
my $json = $message->serialize();
my $length = length ${$json};
$self->{stream}->write("Content-Length: $length\r\n\r\n$$json")->retain();
return;
} ## en
etter if you have an XS JSON module installed.
If you install L<Cpanel::JSON::XS> or L<JSON::XS>, it will use one of those
before falling back to L<JSON::PP>, similar to L<JSON::MaybeXS>.
=head1 NOTE
package PLS::Server::Message;
use strict;
use warnings;
use PLS::JSON;
=head1 NAME
PLS::Server::Message
=head1 DESCRIPTION
This class is the abstract base class for all messages sent between
ser
) = @_;
my %content = (
jsonrpc => '2.0',
%{$self}
);
my $json = encode_json \%content;
return \$json;
} ## end sub serialize
1;
nse::InitializeResult;
use strict;
use warnings;
use parent q(PLS::Server::Response);
use PLS::JSON;
use PLS::Server::State;
=head1 NAME
PLS::Server::Response::InitializeResult
=head1 DESCRIPTIO
DetailsSupport => PLS::JSON::true
},
definitionProvider => PLS::JSON::true,
documentSymbolProvider => PLS::JSON::true,
hoverProvider => PLS::JSON::true,
si
arnings;
use feature 'state';
use Future;
use IO::Async::Loop;
use IO::Async::Process;
use PLS::JSON;
=head1 NAME
PLS::Parser::PackageSymbols
=head1 DESCRIPTION
This package executes a Perl proc
@_;
$data = encode_json $data;
return $process->stdin->write("$data\n")->then(sub { $process->stdout->read_until("\n") })->then(
sub {
my ($json) = @_;
retu
rn Future->done(eval { decode_json $json } // {});
},
sub { Future->done({}) }
);
} ## end sub _send_data_and_recv_result
sub start_package_symbols_process
{
my ($config) = @_
etter if you have an XS JSON module installed.
If you install L<Cpanel::JSON::XS> or L<JSON::XS>, it will use one of those
before falling back to L<JSON::PP>, similar to L<JSON::MaybeXS>.
=head1 NOTE