# code actions.
            if (attr == "version" and obj_field_name == "textDocument"
                    and "uri" in dir(obj)):
                setattr(obj, "version", 0)
            else:
                delattr(obj, attr)

        elif is_json_basic_type(member):
            continue

        else:
            handle_null_fields(member, attr)


def patched_without_none_fields(resp):
    """Monkeypatch for `JsonRPCResponseMessage.without_none_fields` to remove `None` results."""
    if resp.error is None:
        del resp.error
        if hasattr(resp, "result"):
            handle_null_fields(resp.result)
    else:
        del resp.result
    return resp


pygls.protocol.JsonRPCResponseMessage.without_none_fields = patched_without_none_fields

from jedi_language_server.cli import cli

sys.exit(cli())
Esempio n. 2
0
from jedi_language_server.cli import cli

cli()