Skip to content

Dataclass/Pydantic: go-to-def on named arguments in an __init__ call should go to specific fields #1231

@rchen152

Description

@rchen152

Describe the Bug

# 1. When using Go To Definition on a model field in `__init__()`, point to the annotated attribute `a`, not the model name:
class Model5(BaseModel):
    a: int

# Go to definition here:
# -----|
#      |
Model5(a=1)

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick uplanguage-serverIssues specific to our IDE integration rather than type checkingpydanticIssues related to support for Pydantic

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions