如何让PyCharm在docstrings中找到Todo项目

问题描述 投票:1回答:2

我当时正在玩PyCharms TODO finder。这是一个很好的功能,我想更强烈地使用它。但是它没有找到我在我的文档字符串中使用的任何待办事项。

"""
Do something.

:todo: This is my Todo-Item that is sadly not found

"""
# Todo: When I use line comments it is found.
def my_function():
    pass

有没有办法配置PyCharm在文档字符串中查找待办事项?

pycharm
2个回答
0
投票

如果我做对了,PyCharm会在评论之间产生影响

# Comment

和docstrings喜欢

"""
My function does this and that.

"""

只在评论中查找TODO条目。所以

"""
My function does this and that.

todo: add something else

"""

不会工作。


0
投票

自2017.3版以来,PyCharm支持Docstrings中的TODO

见:https://youtrack.jetbrains.com/issue/PY-11040

© www.soinside.com 2019 - 2024. All rights reserved.