Skip to content

double clicking callable inlay hint should insert Callable, not invalid code #2985

@KotlinIsland

Description

@KotlinIsland
def f() -> int: ...

a = f

expected

from collections.abc import Callable

def f() -> int: ...

a: Callable[[], int] = f

actual

def f() -> int: ...

a: () -> int = f

Yeah, this is an interesting case. For normal classes we show type[T] because that's a legal annotation (so double clicking it would insert valid type hint but double clicking the constructor signature would not) but for NewType type[N] is not a legal annotation.

Originally posted by @yangdanny97 in #2965

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-serverIssues specific to our IDE integration rather than type checkingneeds-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions