Skip to content

Support hover info for TypedDict key access #2477

@max-kamps

Description

@max-kamps

Summary

Pyright supports hover info for TypedDict key accesses. For example:

class Person(TypedDict):
    """A person in the database"""

    name: str
    """The person's full legal name"""

person = Person(name="Sarah Stevens")
print(person["name"])

Hovering over "name" on the last line shows the declared type and docstring for the name field:
Image

This relates to #2189 (autocomplete for TypedDict keys)

(Thank you Alex and Micha)

Version

0.0.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions