#๐Ÿ”’ VS Code - "Go To Definition" doesn't work as expected

5 messages ยท Page 1 of 1 (latest)

wanton talon
#

Right-clicking on certain modules or functions and clicking "Go To Definition", sometimes no definition is found, for example, I cannot navigate to the definition of hands module here:

mpHands = mp.solutions.hands``` 

However, I can "Go To Definition" for `mp.solutions`, which opens this file that imports other things:

```"""MediaPipe Solutions Python API."""
import mediapipe.python.solutions.hands
# Other imports omitted```

From `mp.solutions`, I can navigate to the definition for `hands` , which is what I wanted.

So, I suspect that the issue is that the `hands` module belongs to `mediapipe.python.solutions`, not `mediapipe.solutions`, where it was just imported. But surely, VSCode should be smart enough to navigate imports and show me the original module?

More info:
- mediapipe was installed with pip install.
- I have set language server to PyLance and restarted VS Code.
- Windows 11
- VSCode 1.94.2
- Python and PyLance extensions are installed in VSCode
simple lagoonBOT
#

@wanton talon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

vernal tulip
#

I have been looking for a solution to this for a very long time and I still haven't found one ๐Ÿ˜…

simple lagoonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.