有时我在 PyCharm 终端中使用
grep
,因为 PyCharm 搜索不适合我的需求。
有没有办法以 PyCharm 创建指向找到的行的超链接的方式制作 grep 的输出,以便我可以通过单击链接转到该行?
find abc/ -name '*.py' -mtime -3 |xargs grep -P 'assign.*date'
abc/institution.py: assignment = slot.assignment.order_by('-date')[0]
abc/apl/views.py: already_sent_qs = qs.filter(assignment__date...
abc/apl/views.py: obj.assignment.all().update(info_mail_sent_date...
示例:我想观看第一场比赛:
assignment = slot.assignment.order_by('-date')[0]
在文件中 abc/admin/institution.py
看起来这是 6 年前开始的 这张票 中一个备受期待的功能。 jetbrains 开发人员的评论表明,当他们进行更新时,所有工具都可以使用该更新。
如果您的团队拥有付费许可证,我建议您对您想要看到的门票进行投票
在我得到一个工作版本之前,我为此创建了一个 bash 函数:
pg () {
grep --line-number --recursive --with-filename "$@" | sed -re 's%^([^:]+):([0-9]+):\s+%File "'$PWD'/\1", line \2\n\t%
}
免责声明:仅适用于 python 文件...
我看到有人做了类似的,并在 https://gitlab.com/-/snippets/2590127
上分享