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

Pawel
  • 525
  • 1
  • 5
  • 7
  • Have you configured your Python libraries in .codeintel config file? – Mikko Ohtamaa Jul 02 '12 at 09:03
  • I updated my post and I put my configuration. Most of configuration is from SublimeCodeIntel Github page. – Pawel Jul 02 '12 at 09:10
  • It looks like CIX file is working for very simple XML and in specific situation only. I posted my observation as another update. What do you think? – Pawel Jul 02 '12 at 15:33
  • @Pawel Have you succeeded in make it usable in SublimeCodeIntel ? I copied your sample here. But even the simplest one don't work here. Btw, I'm using python2.7. – silvesthu Oct 13 '12 at 13:38

1 Answers1

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.

Community
  • 1
  • 1
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • I downloaded cix file and I put this file to correct folder. I checked that file is loaded and selected. After that I still doesn't have code completion and I don't know why. I'm using latest Sublime Text 2 and latest SublimeCodeIntel plugin and latest PyQt4. – Pawel Jul 02 '12 at 10:03
  • @Pawel: sorry, I have no other ideas at the moment; there is a [related but closed issue on the SCI project](https://github.com/Kronuz/SublimeCodeIntel/issues/49); I've added a comment asking for a confirmation that the plugin loads additional catalog files. – Martijn Pieters Jul 02 '12 at 10:08
  • 1
    Hi, I found the partial solution. I removed from your file all doc parameters and I changed name and description to something simpler PyQt4. After changed mtime to 201207021815. Save file, close Sublime Edit, Remove cache, Run Sublime Edit (restart again). After that PyQt4 code completion is working. Great. Cix files are working. Maybe not fully but are working. Thanks. – Pawel Jul 02 '12 at 16:19