async fn spawn_lsp_process() -> (Transport<InmemoryStream, PlainCodec>, RemoteLspProcess) {
        let (mut t1, t2) = Transport::make_pair();
        let session = Session::initialize(t2).unwrap();
        let spawn_task = tokio::spawn(async move {
            RemoteLspProcess::spawn(
                String::from("test-tenant"),
                session.clone_channel(),
                String::from("cmd"),
                vec![String::from("arg")],
                false,
                None,
            )
            .await
        });

        // Wait until we get the request from the session
        let req = t1.receive::<Request>().await.unwrap().unwrap();

        // Send back a response through the session
        t1.send(Response::new(
            "test-tenant",
            req.id,
            vec![ResponseData::ProcSpawned { id: rand::random() }],
        ))
        .await
        .unwrap();

        // Wait for the process to be ready
        let proc = spawn_task.await.unwrap().unwrap();
        (t1, proc)
    }
// Configures an lsp process with a means to send & receive data from outside
Configures an lsp process with a means to send & receive data from outside
Configures an lsp process with a means to send & receive data from outside
async fn spawn_lsp_process() -> (Transport<InmemoryStream, PlainCodec>, RemoteLspProcess) {
        let (mut t1, t2) = Transport::make_pair();
        let session = Session::initialize(t2).unwrap();
        let spawn_task = tokio::spawn(async move {
            RemoteLspProcess::spawn(
                String::from("test-tenant"),
                session.clone_channel(),
                String::from("cmd"),
                vec![String::from("arg")],
                false,
                None,
            )
            .await
        });
        // Wait until we get the request from the session
        let req = t1.receive::<Request>().await.unwrap().unwrap();
        // Send back a response through the session
        t1.send(Response::new(
            "test-tenant",
            req.id,
            vec![ResponseData::ProcSpawned { id: rand::random() }],
        ))
        .await
        .unwrap();
        // Wait for the process to be ready
        let proc = spawn_task.await.unwrap().unwrap();
        (t1, proc)
    }
async fn spawn_lsp_process ( ) -> ( Transport < InmemoryStream , PlainCodec > , RemoteLspProcess ) { let ( mut t1 , t2 ) = Transport :: make_pair ( ) ; let session = Session :: initialize ( t2 ) . unwrap ( ) ; let spawn_task = tokio :: spawn ( async move { RemoteLspProcess :: spawn ( String :: from ( " " ) , session . clone_channel ( ) , String :: from ( " " ) , vec ! [ String from ( " " ) ] , false , None , ) . await } ) ; // Wait until we get the request from the session let req = t1 . receive :: < Request > ( ) . await . unwrap ( ) . unwrap ( ) ; // Send back a response through the session t1 . send ( Response :: new ( " " , req . id , vec ! [ ResponseData ProcSpawned { id rand random ( ) } ] , ) ) . await . unwrap ( ) ; // Wait for the process to be ready let proc = spawn_task . await . unwrap ( ) . unwrap ( ) ; ( t1 , proc ) }
Configures an lsp process with a means to send & receive data from outside
Configures an lsp process with a means to send & receive data from outside