PyCharm - 自动完成对Gtk3奇迹般地停止工作 [英] PyCharm - autocomplete for Gtk3 magically stops working

查看:434
本文介绍了PyCharm - 自动完成对Gtk3奇迹般地停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个奇怪的问题 - 我在学习Gtk3在Windows 7 PyCharm社区3.4.1。当我尝试导入的Gtk:

I have this weird problem - I'm learning Gtk3 on Windows 7 with PyCharm Community 3.4.1. When I try to import Gtk:

from gi.repository import Gtk

它强调的Gtk为未解析的引用,becouse这是一个二进制模块。然后我preSS Alt + Enter键,然后选择生成methon存根二进制模块...,然后等待,直到它完成它的索引。然后,我高兴地写这简单的空窗口,自动完成正常工作:

it underlines Gtk as unresolved reference, becouse it's a binary module. Then I press Alt+Enter and choose "Generate methon stubs for binary module..." and wait until it it finishes indexing. Then I happily write this simple empty window with autocomplete working correctly:

class Okienko(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self, title='Okienko')

app = Okienko()
app.connect('delete-event', Gtk.main_quit)
app.show_all()
Gtk.main()

我运行它,它表明了我一个漂亮的空的Gtk窗口。到目前为止好。

I run it, it shows me a nice empty Gtk window. So far so good.

BUT。

不好的事情发生 - 自动完成为GTK模块简单地消失了! 从gi.repository进口的Gtk 被红色下划线和自动完成赋予我已经pviously使用($ P $我只是名称窗口在这种情况下)。我能做的唯一的事情就是无效的高速缓存,并重新启动Pycharm和再看一遍这个程序......我也试过.NET类的IronPython的 - 它甚至更糟,索引需要几分钟,甚至没有完成

Bad things happen - autocomplete for Gtk module simply vanishes! from gi.repository import Gtk gets underlined red and autocomplete gives me just names which I've previously used (Window and main in this case). The only thing I can do is to Invalidate cache and restart Pycharm and go over this procedure again... I also tried .NET classes in IronPython - it's even worse, indexing takes several minutes and doesn't even finish.

推荐答案

我有同样的问题,并发现该Gtk.py文件太大通过PyCharm允许IDE文件大小限制。我改变了idea.properties的配置值idea.max.intellisense.filesize从2500到10000的存根生成需要一些时间,但现在完成。

I had the same issue and found out that the Gtk.py file is too big for IDE file size limit allowed by PyCharm. I changed the config value "idea.max.intellisense.filesize" in idea.properties from 2500 to 10000. The stub generation takes some time but finishes now.

希望帮助甚至是Windows用户。反馈AP preciated。

Hope that helps even Windows users. Feedback appreciated.

这篇关于PyCharm - 自动完成对Gtk3奇迹般地停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆