V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2019-04-02 21:16:15 +08:00 · 4108 次点击
    这是一个创建于 1822 天前的主题,其中的信息可能已经有所发展或是发生改变。
    from .user.config import name
    from aiohttp.log import access_logger
    

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

    golang 就可以做到哦。。

    11 条回复    2019-04-04 14:05:57 +08:00
    Hopetree
        1
    Hopetree  
       2019-04-02 21:57:07 +08:00
    是 pycharm 不好用?
    inhzus
        2
    inhzus  
       2019-04-02 22:09:31 +08:00 via Android
    昂?请按 Ctrl + B

    F12 貌似不是 Pycharm 的快捷键吧
    Ansen
        3
    Ansen  
       2019-04-02 22:33:32 +08:00
    1.32.3 表示可以跳转,我一般都 crtl+left click 跳转
    eternitym31
        4
    eternitym31  
       2019-04-02 23:33:59 +08:00
    插个队,vscode 的 Python 怎么提示 numpy 之类的成员函数?我安装官方的 Python 和 Visual Studio IntelliCode,还挂代理安装个什么 python Language Server,代码提示还是很麻瓜,np.random 里面的 randn 都找不到,tensorflow 啥都不能提示。
    inhzus
        5
    inhzus  
       2019-04-03 00:53:52 +08:00 via Android
    @inhzus 楼主不好意思,回贴的时候看岔了,答非所问了。
    LokiSharp
        6
    LokiSharp  
       2019-04-03 07:26:57 +08:00 via iPhone
    都说了 VSC 不是 IDE 了
    a132811
        7
    a132811  
    OP
       2019-04-03 14:14:29 +08:00
    @Ansen 可以跳转,但是只能跳转到 function/class 吧?
    不能跳 variable definition
    sherlockwhite
        8
    sherlockwhite  
       2019-04-03 15:36:38 +08:00
    vscode 不是 IDE 谢谢。
    gjquoiai
        9
    gjquoiai  
       2019-04-03 17:14:08 +08:00
    python 插件的 bug
    a132811
        10
    a132811  
    OP
       2019-04-03 20:33:50 +08:00
    @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
       2019-04-04 14:05:57 +08:00
    @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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   992 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:13 · PVG 06:13 · LAX 15:13 · JFK 18:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.