Ext/MsgPack/RPC.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.9% 10 / 11 Podpod 100% 4 / 4 totaltotal 95.6% 44 / 46 CC 1 SCAR 0.9
CC
1
Cov
97%
stdio_session
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Ext/Tabpage.pm ↑ Summary
1 package Neovim::Ext::MsgPack::RPC;
2 55 $Neovim::Ext::MsgPack::RPC::VERSION = '0.01';
3 55 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 55 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 55 ▶use Neovim::Ext::MsgPack::RPC::EventLoop;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 55 ▶use Neovim::Ext::MsgPack::RPC::Stream;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 55 ▶use Neovim::Ext::MsgPack::RPC::AsyncSession;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 55 ▶use Neovim::Ext::MsgPack::RPC::Session;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 sub tcp_session
12 {
13 50 ▶ _session ('tcp', @_);
Subroutine tcp_session: called CC=1 SCAR=0.0
Pod documented
14 }
15  
16  
17  
18 sub stdio_session
19 {
20 0 ▶ _session ('stdio', @_);
Subroutine stdio_session: not called CC=1 SCAR=6.9
Pod documented
21 }
22  
23  
24  
25 sub socket_session
26 {
27 1 ▶ _session ('socket', @_);
Subroutine socket_session: called CC=1 SCAR=0.0
Pod documented
28 }
29  
30  
31  
32 sub child_session
33 {
34 1 ▶ _session ('child', @_);
Subroutine child_session: called CC=1 SCAR=0.0
Pod documented
35 }
36  
37  
38  
39 sub _session
40 {
41 52 ▶ my $transport_type = shift;
Subroutine _session: called CC=1 SCAR=0.0
42 52 my $loop = Neovim::Ext::MsgPack::RPC::EventLoop->new ($transport_type, @_);
43 43 my $stream = Neovim::Ext::MsgPack::RPC::Stream->new ($loop);
44 43 my $async_session = Neovim::Ext::MsgPack::RPC::AsyncSession->new ($stream);
45  
46 43 my $session = Neovim::Ext::MsgPack::RPC::Session->new ($async_session);
47 43 $session->request ('nvim_set_client_info',
48 'perl-client', {}, 'remote', {},
49 {
50 license => 'perl5',
51 website => 'https://github.com/jacquesg/p5-Neovim',
52 },
53 async_ => 1
54 );
55  
56 43 return $session;
57 }
58  
59 =head1 NAME
60  
61 Neovim::Ext::MsgPack::RPC - Neovim MessagePack RPC class
62  
63 =head1 VERSION
64  
65 version 0.01
66  
67 =head1 SYNOPSIS
68  
69 use Neovim::Ext;
70  
71 =head1 FUNCTIONS
72  
73 =head2 tcp_session( $address, $port )
74  
75 Create a msgpack-rpc session from a tcp address/port.
76  
77 =head2 socket_session( $path )
78  
79 Create a msgpack-rpc session from a unix domain socket.
80  
81 =head2 stdio_session( )
82  
83 Create a msgpack-rpc session from stdin/stdout.
84  
85 =head2 child_session( $argv )
86  
87 Create a msgpack-rpc session from a new Nvim instance.
88  
89 =cut
90  
91 55 1;
« Ext/Tabpage.pm ↑ Summary