Sublime Forum

CodeIntel ported from Open Komodo Editor

#61

I put this on the github, but figured I’d put it here in case anyone else has a similar problem. I’ve pulled the most recent version of SublimeCodeIntel from Git, and installed it. However, when ST2 opens up, the error in the console I get is:
“ImportError: Could not find a suitable _SilverCity binary for your platform and architecture.”
I tried running build.sh from the src directory, but it fails to build Scintilla with this error: pastebin.com/JNpJaAhA

Any suggestions?

0 Likes

#62

To build you need the python libraries compiled with 4bytes Unicode (check the build.sh for the exact option needed while building python) …indeed, new binaries need to be compiled for the latest version to work…

If anyone manages to compile them in any platform an architecture, please send them over so others can benefit from it. Please try to compile libpcre statically if you can. I have no access to Linux or Windows at the moment as to do so myself :frowning:

0 Likes

#63

Is there a way to remove the delay you have in this? so when I start typing no matter what it pops up? For php and css so far I’ve noticed I don’t get the dropdown until I stop typing.

0 Likes

#64

[quote=“guillermooo”]Hey Kronuz,

This looks like a fantastic package, but… I can’t make it work on Windows.

What I’ve done:

  1. Installed the packages as per your instructions
  2. Created a new folder
  3. Created a new file one.py
  4. Typed in some Python functions.
  5. Pressed super+j

The status bar reports that CodeIntel is creating the indexes, but it does so every time I press the shortcut and nothing else happens.[/quote]

[quote=“Kronuz”]@guillermooo, I have somewhat improved the loggings and fixed a couple issues. Could you please pull the latest and try again?

The indexes are saved at ~/.codeintel/db/ and there’s a log file at ~/.codeintel/codeintel.log (that gets wiped out and recreated every time you start Sublime Text).[/quote]

@Kronuz, I got the same problem as guillermooo.
I already using the lastest build from git, and i don’t find any files/folder under “.codeintel/”, except the “config” file. I have marked the “.codeintel” as not read-only already.

I am using portable build of Sublime Text 2 (tried 32 and 64bit) under Windows 7 64bit.

0 Likes

#65

Plugin aint working for me, I used git to clone it in my /Packages directory, no luck, auto-complete does not kicks off! Any ideas?

0 Likes

#66

I really need someone to compile the new binaries for Widows and Linux :frowning: …I rushed into updating some code, but now SublimeCodeIntel doesn’t work in those platforms anymore for that reason :-S …anyone willing to help us compiling those!?

0 Likes

#67

Hi, man. Just updated to your last version and got this:

Reloading plugin /Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/python_codeintel.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 65, in reload_plugin
  File "./python_codeintel.py", line 86, in <module>
    from codeintel2.common import *
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/codeintel2/common.py", line 76, in <module>
    import SilverCity
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/__init__.py", line 19, in <module>
    LanguageInfo.do_registration()
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/LanguageInfo.py", line 116, in do_registration
    import CSS
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 42, in <module>
    class CSSHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, CSSHandler):
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 50, in CSSHTMLGenerator
    def generate_html(self, file, buffer, lexer = CSSLexer()):
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 26, in __init__
    _CSSLexerTemplate.__init__(self, properties)
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 17, in __init__
    WordList(Keywords.css_properties_3),
AttributeError: 'module' object has no attribute 'css_properties_3'

os: macosx lion

0 Likes

#68

@sublimator, yes, I tried it once, but it wouldn’t work (different python versions I guess) …I might have done something wrong though.

0 Likes

#69

Is this supposed to work under Windows 7 64Bit?

0 Likes

#70

[quote=“squ1b3r”]Hi, man. Just updated to your last version and got this:

Reloading plugin /Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/python_codeintel.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 65, in reload_plugin
  File "./python_codeintel.py", line 86, in <module>
    from codeintel2.common import *
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/codeintel2/common.py", line 76, in <module>
    import SilverCity
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/__init__.py", line 19, in <module>
    LanguageInfo.do_registration()
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/LanguageInfo.py", line 116, in do_registration
    import CSS
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 42, in <module>
    class CSSHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, CSSHandler):
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 50, in CSSHTMLGenerator
    def generate_html(self, file, buffer, lexer = CSSLexer()):
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 26, in __init__
    _CSSLexerTemplate.__init__(self, properties)
  File "/Users/squ1b3r/Library/Application Support/Sublime Text 2/Packages/SublimeCodeIntel/libs/SilverCity/CSS.py", line 17, in __init__
    WordList(Keywords.css_properties_3),
AttributeError: 'module' object has no attribute 'css_properties_3'

os: macosx lion[/quote]

I can confirm this error happens (on Snow Leopard, too) with the current code on GitHub.

Martin

0 Likes

#71

Same error here with osx lion using latest version from github.

0 Likes

#72

Kronuz, you don’t seem to have had much luck getting these binaries compiled for you. I’m running Win7 here and, assuming it’s a relatively easy process, will gladly compile a windows version of whatever you need. But I am in dire need of instructions, including and dependencies (linkables and also the compiler I need to use) if I’m to attempt it. And obviously based on the list of things I need I’ll be able to tell you whether I’m going to be able to help or not. Let me know, anyway.

0 Likes

#73

Windows binaries! Please :frowning: This would be so awesome!

0 Likes

#74

@squ1b3r, is that traceback from editing a css file?

@alexrussell, for the compiler you’ll need Vusual Studio (probably it can be compiled with VS express version, but I’m not entirely sure). You’ll need python with it’s libraries and headers (same version and architecture as the one binded with Sulime Text 2 for windows) and you’ll also need to compile libpcre (as a static library) since SilverCity needs to link against it. Next, doing “python setup.py build” should compile everything after going out to the console VS provides for building stuff (32 and 64 bits, depending). Please check “build.sh” which contains the steps for building stuff in Mac OS X and Linux, but I dont think I’m missing anything… except the extensions for windows libraries will be “.pyd”, not “.so”. If you can buil using this procedure, please post about it here. Consider building both 32 and 64 bits libraries if you can.

For building under Linux, you’ll have to run build.sh, but the only catch is you’ll need to compile python yourself with UCS-4 (for 4 bytes Unicode strings)… also, in Linux, you’ll also have to preferably build libpcre yourself too (as a static library) to avoid having it as an external dependency.

Please, if anyone can build these for 32 and 64 bits architectures in these platforms, it would be very much appreciated.

0 Likes

#75

Hello @kronuz,

I tried to build it on a Ubuntu 11.04 machine:

(11:52:01) - douglas at shoryuken in src
$ uname -a
Linux shoryuken 2.6.38-10-generic-pae #46-Ubuntu SMP Tue Jun 28 16:54:49 UTC 2011 i686 i686 i386 GNU/Linux

(11:53:12) - douglas at shoryuken in src
$ cat /etc/issue
Ubuntu 11.04 \n \l

And im having these problems:

(11:51:43) - douglas at shoryuken in src
$ ./build.sh &> build_problems.log

Here are the link to a paste of the log ( in short, im having problems with LexTCL.cxx or something like that).

http://paste.archlinux-br.org/1784

I tried to look in the openkomodo code, but seems it is very different from SublimeCodeIntel (im talking about contrib/patches/scintilla).

Is there something else that i can do ?

Thanks !

0 Likes

#76

@dsarch, try again, but this time delete that LexTCL.cxx file. There should be a LexTcl.cxx (note lowercases) but not a LexTCL.cxx. I think I forgot to delete it in the build.sh (after copying the files from “src” for scintilla)

0 Likes

#77

No. I’ve got it on start of ST2

0 Likes

#78

Thanks @kronuz,

It worked =)

I added this line code after line 16 in build.sh:

find . -name "LexTCL*" | xargs rm

Then i just ./build.sh and it worked - the problem was the LexTCL.cxx file that comes from scintilla (which is unpacked everytime build.sh runs).

How do you want me to send the libs to you ?

Thanks again for the hard work !

0 Likes

#79

Hello @kronuz,

Also to make it work (i dont care for css support now), i had to comment these lines (17-21):

  9 class _CSSLexerTemplate(Lexer.Lexer):                                          
 10     def __init__(self, properties):                                            
 11         self._properties = properties                                          
 12         self._lexer = find_lexer_module_by_id(SCLEX_CSS)                       
 13         self._keyword_lists =                                                 
 14             WordList(Keywords.css_keywords),                                   
 15             WordList(Keywords.css_pseudo_classes),                             
 16             WordList(Keywords.css_keywords_2),                                 
 17             #WordList(Keywords.css_properties_3),                              
 18             #WordList(Keywords.css_pseudo_elements),                           
 19             #WordList(Keywords.css_browser_specific_properties),               
 20             #WordList(Keywords.css_browser_specific_pseudo_classes),           
 21             #WordList(Keywords.css_browser_specific_pseudo_elements),

In SublimeCodeIntel/libs/SilverCity/CSS.py.

Also, i just noticed i can skip css using this config:

"codeintel_disabled_languages": 'css']

Thanks !

0 Likes

#80

[quote=“Kronuz”]@squ1b3r, is that traceback from editing a css file?

@alexrussell, for the compiler you’ll need Vusual Studio (probably it can be compiled with VS express version, but I’m not entirely sure). You’ll need python with it’s libraries and headers (same version and architecture as the one binded with Sulime Text 2 for windows) and you’ll also need to compile libpcre (as a static library) since SilverCity needs to link against it. Next, doing “python setup.py build” should compile everything after going out to the console VS provides for building stuff (32 and 64 bits, depending). Please check “build.sh” which contains the steps for building stuff in Mac OS X and Linux, but I dont think I’m missing anything… except the extensions for windows libraries will be “.pyd”, not “.so”. If you can buil using this procedure, please post about it here. Consider building both 32 and 64 bits libraries if you can.

For building under Linux, you’ll have to run build.sh, but the only catch is you’ll need to compile python yourself with UCS-4 (for 4 bytes Unicode strings)… also, in Linux, you’ll also have to preferably build libpcre yourself too (as a static library) to avoid having it as an external dependency.

Please, if anyone can build these for 32 and 64 bits architectures in these platforms, it would be very much appreciated.[/quote]

Eep, I think that might end up being a bit too much for me to do. Was kinda hoping download and install gcc (or whatever), run build.bat or something! I’ll have a go at downloading VS etc.

0 Likes