NetBeans 中的代码完成python 插件无法正常工作
我在 StackOverflow 上提问是因为我肯定在做一些完全愚蠢的事情,我希望 SO 能给我一个快速的答案。我已经为 NetBeans 安装了最新的稳定 Python 插件。它工作得很好,我用各种包测试了代码完成,例如 sys
、os
等。它工作得很漂亮。
但是,它似乎没有为我自己的项目中的代码获取代码完成。
我创建了一个名为 mypackage 的包(它也有 __init__.py),其中有一个名为 mymodule.py 的模块。在 mymodule
中,我放置了一个名为 MyClass
的类,其中包含文档字符串等。
请参考此屏幕截图来描述代码完成中发生的情况: 替代文本 http://rasterburn.org/~sgt/stuff2/pythonproblem.png
正如您所看到的,它建议的是不相关的事情,而不仅仅是 MyClass
。 (请注意,如果我执行 mymodule.MyClass() ,它可以 100% 工作,只是我真的很喜欢自己的代码上的代码完成)
希望我只是在这里做一些愚蠢的事情...任何想法?
I am asking on StackOverflow because surely I am doing something completely silly and I hope S.O. might provide me with a quick answer. I've installed the latest stable Python-plugin for NetBeans. It works great, and I tested code completion with various packages such as sys
, os
and so on. It works beautifully.
However, it does not seem to pick up the code completion for the code in my own project.
I created a package called mypackage
(it has __init__.py as well), and in it I have a module called mymodule.py. Inside mymodule
I've put a class called MyClass
, complete with doc-strings and all.
Please refer to this screenshot to describe what happens in code-completion:
alt text http://rasterburn.org/~sgt/stuff2/pythonproblem.png
As you see, it's suggesting irrelevant things, as opposed to just MyClass
.
(Note that if I execute mymodule.MyClass() it works 100%, it's just that I would really like code completion on my own code)
Hope I'm just doing something silly here... Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不敢告诉您,这是一个已知错误,持续时间超过年。 有些人建议 NetBeans 中的 Python 开发似乎已陷入停滞。
就我个人而言,我使用 Eclipse。 PyDev 仍然受到积极支持,并且 自动完成很聪明。此外,它还支持更多的 syntax-highlighting 变化。 (这是我的个人配置。)
我建议您尽可能切换到另一个 IDE。如果您正在使用 Jython,请告诉我这对您来说效果如何。当您有解决方案时,请与我们分享您的解决方案。 =]
相关主题:
有人尝试过 NetBeans 6.5 Python IDE?
I'm afraid to tell you that this is a Known Bug for over a year. Some people have suggested that it seems the Python development in NetBeans is stalled.
Personally, I'm using Eclipse. PyDev is still under active support, and the auto-completion is smart. In addition, it supports more variety in syntax-highlighting. (This is my personal configuration.)
I would recommend you switch to another IDE while you can. If you're using Jython, let me know how that works out for you. Share with us your solution when you have one. =]
Related topic:
Has anyone tried NetBeans 6.5 Python IDE?