Go to Definition (F12) fails for Pydantic model attributes in VSCode #12797 #7867
Unanswered
bashirmindee
asked this question in
Q&A
Replies: 2 comments
-
|
I'm not reproducing the behavior you describe? At least I think so. Can you try the latest prerelease build? Goto def on |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
it is the reverse that doesn't always work, ie when you go to the definition of an attribute and then push F12 (Go To Definition), it should do the inverse and search for the usages but it doesn't work at all for my setup (I have a Mac Sequoia) and it works for my colleagues (they have ubuntu) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description

When using VSCode with Pylance, attempting to use "Go to Definition" on a Pydantic model attribute does not navigate to the attribute declaration in the class. Instead, it either does nothing or points to the model class itself.
However when I attempt the same on the usage of an attribute, VSCode works correctly and points to the definition of the attribute:

I am experiencing the same issue for dataclasses
I think I should also post the same issue somewhere on VSCode side (pylance extension or VSCode itself)
Beta Was this translation helpful? Give feedback.
All reactions