def METHOD_NAME(
    write_to, read_from, language_server_client_class=None, kwargs={}
):
    if language_server_client_class is None:
        from robocorp_ls_core.unittest_tools.language_server_client import (
            LanguageServerClient,
        )
        language_server_client_class = LanguageServerClient
    from robocorp_ls_core.jsonrpc.streams import JsonRpcStreamWriter
    from robocorp_ls_core.jsonrpc.streams import JsonRpcStreamReader
    w = JsonRpcStreamWriter(write_to, sort_keys=True)
    r = JsonRpcStreamReader(read_from)
    language_server = language_server_client_class(w, r, **kwargs)
    try:
        yield language_server
    finally:
        if language_server.require_exit_messages:
            language_server.shutdown()
            language_server.exit()