4

I'm using Sublime Text 2 and SublimeCodeIntel plugin. I want to have some code completion for PyQt4 but I'm receiving notification "... could not resolve first part ...". For python libraries code completion is working awesome.

Is it possible to configure SublimeCodeIntel to have code completion for PyQt4?

Thanks for help Pawel

========== UPDATE ============
My configuration for this plugin:

{
    "Python": {
        "python": "C:\\Python32"
            "pythonExtraPaths": [
            "libs",
            "~/Applications/Sublime Text 2.app/Contents/MacOS",
            "/Applications/Sublime Text 2.app/Contents/MacOS",
            "C:\\Python32\Lib\\site-packages"
            ]
    }
}

========== UPDATE ===========
I created new cix file that contains something like that:

<?xml version="1.0"?>
<codeintel name="PyQt4" version="2.0" description="PyQt4">
    <file lang="Python" mtime="201207021718" path="QtCore.pyd">
        <scope ilk="blob" lang="Python" name="PyQt4.QtCore">
            <scope ilk="class" name="QAbstractEventDispatcher">
                <scope ilk="function" name="closingDown" signature="closingDown()"/>
            </scope>
        </scope>
    </file>
</codeintel>

After that i put file in correct place and I checked that file is loaded. But this file didn't help and it looks that SublimeCodeIntel ignore it because of something. I can't find a place and a reason why is doing that.

If you have any ideas please help.

=============== UPDATE ================
It looks like is working. I restarted Sublime Edit and change the code like this:

import PyQt4.QtCore
PyQt4.QtCore.

After last dot code completions shows that QAbstractEventDispatcher is available. That means that cix file is working but there is some problem with formatting or some problem with encoding maybe. There is something strange also. Only import PyQt4.QtCore is working. For below lines this cix file is not working:

import PyQt4
PyQt4.QtCore.

from PyQt4 import *
QtCore.

from PyQt4.QtCore import *
QAbstractEventDispatcher.

Do you have any ideas what is going on? Pawel

4

1 回答 1

3

The codeintel libraries originate from the Komodo IDE, and and solutions that work for that IDE also work with SublimeCodeIntel.

What you need are CIX (codeintel XML) files that describe the binary libraries in question. And as it happens, someone has created such files for PyQT4 and linked to them from a StackOverflow answer: Autocompletion not working with PyQT4 and PyKDE4 in most of the IDEs.

The Komodo team themselves have also generated such files, and provided a FAQ entry for them.

The trick, of course, is how to get SublimeCodeIntel to acknowledge these catalogs. Any CIX files placed in the SublimeCodeIntel/libs/codeintel2/catalogs/ path should be loaded by the codeintel library. Usually this is located within your Sublime Packages directory, reachable from the Preferences menu (look for Browse Packages...).

I do not think there is any way to configure SublimeCodeIntel to look in additional paths for these.

于 2012-07-02T09:08:53.390 回答