Skip to content

More edge cases for completion: lambdas and async functions #15045

@krassowski

Description

@krassowski

With

%config Completer.use_jedi=True

We should be able to complete on lambda results e.g.:

"\n".join(
    [
        "make_list = lambda: []",
        "make_list().",
    ]
),

often lambda will be used for deferred if/else like lambda number: "odd" if x % 2 == 1 else "even"

Async functions - this should complete coroutine methods e.g. .close():

"\n".join(
    [
        "async def async_func():",
        "    return []",
        "async_func().",
    ]
),

(await async_func()). should complete the potential return value methods.

Both are supported by jedi.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions