Skip to content

Generate type aliases for result types? #289

@alcarney

Description

@alcarney

Currently, to write a function that handles the result of a textDocument/completion request, you need to look up and write the following type annotation

from lsprotocol import types

def handle_result(result: Union[List[types.CompletionItem], types.CompletionList, None]):
    ...

It looks like lsprotocol already generates some type aliases e.g. DocumentDiagnosticReport - would it be possible to extend this to cover all result types (where relevant) so that you would only have to write

from lsprotocol import types

def handle_result(result: types.CompletionResult):
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions