Pydiction 在静态分析中支持自定义装饰器
我已经为 Vim 安装了 pydiction 并开始工作。作为参考,其 Vim 脚本主页位于: http://www.vim.org /scripts/script.php?script_id=850
调用pydiction.py
静态分析脚本的方式为:
python pydiction.py root.my.submodule
一旦 root
模块的位置已放入 PYTHONPATH 变量中。这一切都工作正常,我已经能够分析我的项目的很多模块,并将标签添加到 complete-dict
文件中,当您在 Vim 中执行制表符完成时 pydiction 会在该文件中查找。
在我的项目中,有一个自定义的装饰器 @innerclass
,它位于 innerclass.py
文件中,该文件的目录已被 pydiction 成功分析和标记。
但是,当我尝试分析项目中的另一个目录时,我得到一个回溯,似乎表明在使用 @innerclass
之后的类定义行上出现 SyntaxError
装饰师。所以看起来 pydiction 并不知道装饰器。
pydiction 不支持自定义装饰器吗?或者我可以在装饰器的定义中寻找一些可能有问题的东西?
I've installed pydiction
for Vim and got it working. For reference, its Vim script home is here: http://www.vim.org/scripts/script.php?script_id=850
The way to call the pydiction.py
static analysis script is:
python pydiction.py root.my.submodule
once the location of the root
module is already put in your PYTHONPATH variable. This all works fine, and I've been able to analyze a lot of my project's modules and get the tags added to the complete-dict
file where pydiction looks when you're doing the tab completion in Vim.
In my project, there's a custom defined decorator, @innerclass
, which lives in a innerclass.py
file, the directory of which has been successfully analyzed and tagged by pydiction.
But when I try to analyze another directory in my project, I get a traceback that seems to indicate a SyntaxError
on the class definition line that comes just after use of the @innerclass
decorator. So it doesn't appear that pydiction knows about the decorator.
Does pydiction just not support custom decorators? Or is there something I can look for in the definition of the decorator that may be awry?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论