PyCharm 文档字符串链接到类 [英] PyCharm docstrings linking to classes

查看:60
本文介绍了PyCharm 文档字符串链接到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IntelliJ IDEA 允许链接到 Java 文档注释中的其他方法.这允许我将光标移动到符号上并使用键盘快捷键跳转到定义,以及按住 ctrl 的同时鼠标悬停在可点击的符号下显示下划线.例如:

IntelliJ IDEA allows for linking to other methods in Java document comments. This allows me to move the cursor over a symbol and jump to the definition using a keyboard shortcut, as well as holding down ctrl while hovering with the mouse displaying an underline under the symbol which is clickable. For example:

/**
  * This is a link to a method {@link #setBalance}
  */

我正在尝试使用 PyCharm 在 Python 中实现这一点.我已经尝试了其他答案中的各种方法而没有任何运气.以下是一些尝试:

I am trying to achieve this in Python with PyCharm. I've tried various things from other answers without any luck. Here are some attempts:

def my_func(my_arg):
    '''
    Convert a S{decimal.Decimal} to an :ref:`int`.

    This method imports a module called :mod:``django``.

    Sometimes we might call :func:`~utils.error` to raise an {@link Exception}.
    '''

这些都不会自动完成或创建超链接.

None of these autocomplete or create a hyperlink.

难道 PyCharm 还没有实现这个功能?

Could it be that PyCharm simply hasn't implemented this functionality (yet)?

这个问题类似于链接到python docstring中的类方法 但答案似乎不适用于 PyCharm.

This question is similar to Link to class method in python docstring but the answers don't seem to apply to PyCharm.

推荐答案

我联系了支持人员,结果发现它尚未实施.

I contacted support and it turns out it hasn't been implemented.

我在他们的问题跟踪器上创建了一个功能请求:

I have created a feature request on their issue tracker:

https://youtrack.jetbrains.com/issue/PY-14743

更新:

原始功能请求被标记为重复

original feature request is marked as a duplicate of

https://youtrack.jetbrains.com/issue/PY-27635

状态:进行中

这篇关于PyCharm 文档字符串链接到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆