Skip to content

TypeError when inheriting from sublime_aio.ViewCommand #34

Description

@rwols

I'm experimenting with sublime_aio.ViewCommand.

But it looks like existing, old command classes that take an edit object as the first argument are failing to run. For instance:

Traceback (most recent call last):
  File "/home/raoul/.config/sublime-text-3/Lib/python314/sublime_aio.py", line 493, in run_
    call_coroutine(self.run(**args) if args else self.run())
                   ~~~~~~~~^^^^^^^^
TypeError: LspHoverCommand.run() missing 1 required positional argument: 'edit'

The signature of LspHoverCommand.run is:

    def run(
        self,
        edit: sublime.Edit,
        only_diagnostics: bool = False,
        point: int | None = None,
        event: dict | None = None
    ) -> None:
        ...

Could the ViewCommand class ensure that old command classes remain compatible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions