NAME

YATT::Lite::Test::LangServerClient - drive YATT::Lite::LanguageServer over pipes (for tests)

SYNOPSIS

my $cl = YATT::Lite::Test::LangServerClient->new(
  server => "$FindBin::Bin/../Lite/LanguageServer.pm",
);
my $res = $cl->call(initialize => {rootUri => "file://$root", capabilities => {}});

# Several frames in ONE write (what eglot does: didChange + definition):
my $req = $cl->make_request('textDocument/definition', {...});
$cl->send_messages($cl->make_notification('textDocument/didOpen', {...}), $req);
my $def = $cl->wait_response($req->{id});

my ($shutdown_res, $exit_code) = $cl->shutdown;

DESCRIPTION

Spawns LanguageServer.pm --quiet server as a child process and speaks JSON-RPC (Content-Length framing) with it. Every read is bounded by timeout seconds so a stalled server fails a test instead of hanging it. Notifications from the server (publishDiagnostics...) are queued and can be inspected with take_notifications.