Python-language-server: Goto definition doesn't work on the third-party libraries

Created on 21 Feb 2020  路  3Comments  路  Source: microsoft/python-language-server

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. Create an simple Python source file
  2. Import an third-party library
  3. Right click on the imported classes, functions then click "go to definition"
  4. VScode will open the source code of the library, right click on the imported classes or functions in the source file.
    bug

Actual behavior

  • VScode show the message "No definition for ..."

    Expected behavior

  • VScode will open the definition for the imported classes/functions in the third-party library.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local | Remote | N/A
  • Extension version: 2020.2.63990 (19 February 2020)
  • VS Code version: 1.41.2
  • Setting python.jediEnabled: false
  • Python and/or Anaconda version: python3.6.4
  • OS: Linux (distro): Centos
  • Virtual environment: virtualenv

Developer Tools Console Output


Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

duplicate

Most helpful comment

You can try adding:

"python.analysis.memory.keepLibraryAst": true,
"python.analysis.memory.keepLibraryLocalVariables": true,

To your config, but it may not fully change this behavior. Note the memory usage will be significant.

All 3 comments

This is currently by design; we throw away this info in library files to save memory. See #840.

Hi @jakebailey , I understood the limitations. So can we have an option to specifies which third-party libraries should be analyzed?

You can try adding:

"python.analysis.memory.keepLibraryAst": true,
"python.analysis.memory.keepLibraryLocalVariables": true,

To your config, but it may not fully change this behavior. Note the memory usage will be significant.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MikhailArkhipov picture MikhailArkhipov  路  46Comments

CaselIT picture CaselIT  路  66Comments

MichalPospech picture MichalPospech  路  33Comments

AeneasZhu picture AeneasZhu  路  35Comments

brettcannon picture brettcannon  路  29Comments