推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
a132811
V2EX  ›  Python

vscode 的 Python 你们能跳到 import 的变量的定义处?

  •  
  •   a132811 ·
    ahuigo · Apr 2, 2019 · 5150 views
    This topic created in 2735 days ago, the information mentioned may be changed or developed.
    from .user.config import name
    from aiohttp.log import access_logger
    

    无论是 name 还是 access_logger 都是变量而不是函数, 按 F12 都不能跳到定义处。

    golang 就可以做到哦。。

    11 replies  •  2019-04-04 14:05:57 +08:00
    Hopetree
        1
    Hopetree  
       Apr 2, 2019
    是 pycharm 不好用?
    inhzus
        2
    inhzus  
       Apr 2, 2019 via Android
    昂?请按 Ctrl + B

    F12 貌似不是 Pycharm 的快捷键吧
    Ansen
        3
    Ansen  
       Apr 2, 2019
    1.32.3 表示可以跳转,我一般都 crtl+left click 跳转
    Invast
        4
    Invast  
       Apr 2, 2019
    插个队,vscode 的 Python 怎么提示 numpy 之类的成员函数?我安装官方的 Python 和 Visual Studio IntelliCode,还挂代理安装个什么 python Language Server,代码提示还是很麻瓜,np.random 里面的 randn 都找不到,tensorflow 啥都不能提示。
    inhzus
        5
    inhzus  
       Apr 3, 2019 via Android
    @inhzus 楼主不好意思,回贴的时候看岔了,答非所问了。
    LokiSharp
        6
    LokiSharp  
       Apr 3, 2019 via iPhone
    都说了 VSC 不是 IDE 了
    a132811
        7
    a132811  
    OP
       Apr 3, 2019
    @Ansen 可以跳转,但是只能跳转到 function/class 吧?
    不能跳 variable definition
    sherlockwhite
        8
    sherlockwhite  
       Apr 3, 2019
    vscode 不是 IDE 谢谢。
    gjquoiai
        9
    gjquoiai  
       Apr 3, 2019
    python 插件的 bug
    a132811
        10
    a132811  
    OP
       Apr 3, 2019
    @sherlockwhite 不妨碍我把我它作为 nodejs/ts/golang/php/python 的 IDE 呀,我的需求主要是单步执行 /definition/terminal/vimMode。只是目前就 python 的不太支持变量跳转这一个毛病。。其它方面我都用得贼爽

    不想为了每个语言分别搞一个独立的 IDE。

    昨天提了 bug issue: https://github.com/Microsoft/vscode-python/issues/5074
    a132811
        11
    a132811  
    OP
       Apr 4, 2019
    @eternitym31
    1. 装 python plugin
    2.然后选择 python 解释器.
    3. 还有 python-language-server 保持最新的 0.2.43(0.2.41 有问题)
    https://github.com/Microsoft/python-language-server/issues/875
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4999 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 63ms · UTC 08:37 · PVG 16:37 · LAX 01:37 · JFK 04:37
    ♥ Do have faith in what you're doing.