draw-graph
draw-graph copied to clipboard
[BugReport]解析python代码,函数调用关系不完整
python版本3.6 插件版本1.22.2025.01.11_00.25 系统版本 windows10专业版 pycharm版本 2021.3.3 (Professional Edition)
源码为 test1调用了test2和test3 生成后,缺少了test2
区别 test3为self调用 test2为其他模块(目录) ,在当前.py文件的顶部有引用 from xxx import preset_api
你是直接打开文件的话只会展示当前文件的调用关系,对着方法右键才会显示其他文件的。
你是直接打开文件的话只会展示当前文件的调用关系,对着方法右键才会显示其他文件的。
你好, 我的使用方式正确吗? 如果不正确, 正确的是什么样的 求个截图示意下
可否安装 PsiViewer 插件,点击引用处看下是不是 PyReferenceExpression,然后进入方法,看看是不是 PyFunction,调用关系查找的原理很简单,就是查找方法内的 PyReferenceExpression 然后 resolve 到 PyFunction 然后继续查找。
https://plugins.jetbrains.com/plugin/227-psiviewer
https://github.com/LinWanCen/draw-graph/blob/a637dd9836287eb500f6abd73fb6632d4a243a54/src/main/kotlin/com/github/linwancen/plugin/graph/parser/python/PythonParser.kt#L44-L46
https://github.com/LinWanCen/draw-graph/blob/a637dd9836287eb500f6abd73fb6632d4a243a54/src/main/kotlin/com/github/linwancen/plugin/graph/parser/Call.kt#L14-L18
可否安装 PsiViewer 插件,点击引用处看下是不是 PyReferenceExpression,然后进入方法,看看是不是 PyFunction,调用关系查找的原理很简单,就是查找方法内的 PyReferenceExpression 然后 resolve 到 PyFunction 然后继续查找。
https://plugins.jetbrains.com/plugin/227-psiviewer
https://github.com/LinWanCen/draw-graph/blob/a637dd9836287eb500f6abd73fb6632d4a243a54/src/main/kotlin/com/github/linwancen/plugin/graph/parser/python/PythonParser.kt#L44-L46
https://github.com/LinWanCen/draw-graph/blob/a637dd9836287eb500f6abd73fb6632d4a243a54/src/main/kotlin/com/github/linwancen/plugin/graph/parser/Call.kt#L14-L18
安装了PsiViewer插件,
操作1:
在函数test1()鼠标右键,操作如截图所示
得到这些内容
操作2:
操作3:
操作4:
进入,def test2(self, device_id, collection_id): 鼠标右键点击
得到数据如图
下午好, 期待您解决这个问题
可否弄个demo给我调试下,我自己的demo没问题
可否弄个demo给我调试下,我自己的demo没问题
收到, 这个项目的代码非常多 我需要一些时间 摘取一个可复现问题的案例 预计会在今天完成
可否弄个demo给我调试下,我自己的demo没问题
https://gitee.com/phpgogo/draw-graph_issues_12 复现此问题的样例代码