Sublime Forum

CodeIntel ported from Open Komodo Editor

#30

Seems broken to me:

startup, version: 2068 osx x32 channel: dev
executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
working dir: /
packages path: /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages
settings path: /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Settings
error parsing session: No data at: 0:0
PackageSetup not required
catalogue loaded
found 3 files for base name Default (OSX).sublime-keymap
found 1 files for base name Default (OSX).sublime-mousemap
found 1 files for base name Main.sublime-menu
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/comment.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/copy_path.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/delete_word.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/detect_indentation.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/duplicate_line.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/echo.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/exec.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/find_under_expand.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/font.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/goto_line.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/indentation.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/kill_ring.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/mark.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/new_templates.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/paragraph.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/save_on_focus_lost.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/scroll.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/side_bar.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/sort.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/swap_line.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/switch_file.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/transform.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/transpose.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/Diff/diff.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/HTML/html_completions.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/User/close_tag.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/User/python_codeintel.py
Reloading plugin /Volumes/HOME/douglas/Library/Application Support/Sublime Text 2/Packages/User/sublimelint_plugin.py
SublimeLint: Successfully loaded linter jshint
SublimeLint: Successfully loaded linter notes
SublimeLint: Successfully loaded linter perl
SublimeLint: Successfully loaded linter php
SublimeLint: Successfully loaded linter python
SublimeLint: Successfully loaded linter ruby
pylint is not available
pylint is not available
SublimeLint: Successfully loaded linter sublime_pylint
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
pre session restore time: 0.933785
startup time: 1.09041
loaded 1123 snippets
Traceback (most recent call last):
  File "./sublime_plugin.py", line 160, in on_query_completions
  File "./python_codeintel.py", line 300, in on_query_completions
KeyError: 39

Also how do i make pylint avaliable ? I tried installing pylint in virtualenv and in my system enviroment and it is still missing.

Thanks for the hard work =)

0 Likes

#31

When working with HTML things seem a bit wonkaloid. It only seems to suggest attributes that have already been applied to a tag elsewhere. So for instance, if I have

tags with class, id and role attributes, when I type <div I get a drop-down suggesting the class, id and role attributes. Otherwise, I don’t get any suggestions.

Is that correct behaviour?

Here’s a quick log of a fresh session editing an HTML5 doc

[code]Starting logging SublimeCodeIntel rev GIT-f26f633a (1308618629) on Wed Jun 22 09:05:08 2011

scan_multilang: path: u’C:\xampp\htdocs\susy\index.html’


Finished scanning, updating all scope names
Updating all class constructor names

CodeIntel(cplns, calltips) for C:\xampp\htdocs\susy\index.html@261 [HTML]

codeintel:done eval: success
Autocomplete called (HTML) [cplns]
scan_multilang: path: u’C:\xampp\htdocs\susy\index.html’


Finished scanning, updating all scope names
Updating all class constructor names
scan_multilang: path: u’C:\xampp\htdocs\susy\index.html’


Finished scanning, updating all scope names
Updating all class constructor names
scan_multilang: path: u’C:\xampp\htdocs\susy\index.html’


Finished scanning, updating all scope names
Updating all class constructor names

CodeIntel(cplns, calltips) for C:\xampp\htdocs\susy\index.html@261 [HTML]

codeintel:done eval: success
Autocomplete called (HTML) [cplns]
scan_multilang: path: u’C:\xampp\htdocs\susy\index.html’


Finished scanning, updating all scope names
Updating all class constructor names

CodeIntel(cplns, calltips) for C:\xampp\htdocs\susy\index.html@261 [HTML]

codeintel:done eval: success
Autocomplete called (HTML) [cplns]
scan_multilang: path: u’C:\xampp\htdocs\susy\index.html’


Finished scanning, updating all scope names
Updating all class constructor names[/code]

0 Likes

#32

@dsarch, I fixed the issue. Please pull the latest… about pylint, you’ll have to add it to your User folder I believe… or otherwise inside the “libs” directory inside SublimeLint.

@charlesroper, can you please be more specific? I couldn’t get exactly what you mean…

0 Likes

#33

@Kronuz I’ve created a screencast which might make it clearer:

dl.dropbox.com/u/256478/screenca … 2_1625.swf

While I’m here, I have another question: how do I add support for a new syntax (SCSS)? It would basically be the same as CSS with a few extras. In fact, could I simply add the .scss extension to make CodeIntel class it as a CSS file?

0 Likes

#34

@charlesroper, I think I know what you mean now… It must be a bug or issue with the underlying autocomplete in the codeintel2 engine (that comes from Open Komodo). I’ll have to look further later on, but it seems codeintel is uncapable of knowing what are the proper default attributes for div for some reason. That’s a nice screencast though… could you make some more screencasts to show the whole SublimeCodeIntel functionality? (note you can add, if you haven’t aready, a mouse binding so that when you command+click on a symbol (in python, or javascript or php, etc.) it takes you to the symbol definition (no matter in what file was defined). I’ve been wanting to have a screencast showing every feature, but I haven’t had the time…

Regarding SCSS, you can get my SCSS bundle fork, and use the Syntaxes/SCSS.tmLanguage file, it gets you the syntax. It has support for the latest Scss and compass: github.com/Kronuz/SCSS.tmbundle …If you want to add autocomplete for it, however, that’s not as easy. You’ll have to probably tweak and/or create a new SublimeCodeIntel/libs/codeintel2/lang_css.py lexer file and do more stuff… it won’t be as easy because CSS doesn’t use “imports” or anything but it can be done if you have the will. It would be nice to have SCSS code intelligence, finding mixins and user functions and all.

0 Likes

#35

[quote=“charlesroper”]@Kronuz I’ve created a screencast which might make it clearer:

dl.dropbox.com/u/256478/screenca … 2_1625.swf

While I’m here, I have another question: how do I add support for a new syntax (SCSS)? It would basically be the same as CSS with a few extras. In fact, could I simply add the .scss extension to make CodeIntel class it as a CSS file?[/quote]

Nice screencast.
But I see you forgot to register your Sublime Text copy :wink:

0 Likes

#36

@Kronuz The screencast was done in Jing. It’s free and pretty useful. I might have a crack at doing a full one, but don’t hold your breath as I’m finishing off a big project here at work (and procrastinating by visiting these forums!) :unamused:

@bizoo I didn’t forget. I tried to register some time ago, but Jon doesn’t accept anything other than PayPal, which we can’t use here because it rejects the company credit card. I’m going to have another go at some point soon, just haven’t gotten around to it. :smile:

0 Likes

#37

@Kronuz Are you submitting pull requests back to Mario Ricalde, who is maintainer of the ‘official’ SCSS bundle? I see yours is derived from his, only it’s not forked from his repo. Seeing as his bundle is linked from the Sass site, it would be great if your changes were added in. I had no idea your improved version existed!

0 Likes

#38

I have the same problem as guillermooo i think. The indexing time increased very much and it takes now for about 30 min. with maximum cpu usage, only to index the dojo javascript library which is included in my project. I end up with about 1000 directories within ~/.codeintel/db/javascript and lots of performance warnings in the log file like:

JavaScript extra lib dirs: set()
event: This buffer is configured with 816 JavaScript import dirs: this may result in poor completion performance

Dojo is included as a .cix file in SublimeCodeIntel/libs/codeintel2/catalogs/dojo.cix and doesn’t need to be indexed at all. In older versions of the plugin this didn’t happen. Is it possible to exclude directories?

0 Likes

#39

I’ve worked out s few problems in SublimeCodeIntel, and new version should work a bit better. For anyone interested, get the latest from Github (github.com/Kronuz/SublimeCodeIntel).

0 Likes

#40

Nice to see you back and working on the plugin :wink:

I still have the same problems with javascript. It would be nice if the automatic scanning of project folders could be optional.

0 Likes

#41

@sublimator, that was an old problem… please pull the latest from github :wink:

@senzo you too, try the latest and let me know… post log files too plz :smiley:

0 Likes

#42

@sublimator no, pull should do it… however that error is an old one (fixed in github’s master)… the line numbers marked don’t even contain that code anymore (check the file online at github)… actually simply “git pull” should do it…

0 Likes

#43

I’m not able to get anything working with any JavaScript libraries. Just seems to index forever (with 100% CPU usage).

0 Likes

#44

So it finally finished, however I’m not sure where it has scanned. It seems to have scanned the whole HD…

Where is the indexed content stored?

0 Likes

#45

It is still not working with javascript for me. You can try it out if you download the dojotoolkit from here:
download.dojotoolkit.org/release … .1-src.zip
Create an empty ST2 project, put the dojotoolkit in the project folder, open any .js file and type 'dojo.(ctrl + space)"

And another point besides the scanning of .js files: There is a dojo.cix file in /SublimeCodeIntel/libs/codeintel2/catalogs/dojo.cix
So there is no need to scan the dojotoolkit folder at all - the project specific files have to scanned of course. I am not sure how this can be achieved, maybe by excluding directories manually?

0 Likes

#46

I’ve this error under Ubuntu 11.04 x86_64 kernel 2.6.38-10-generic =(

Traceback (most recent call last): File ".\logging\__init__.py", line 768, in emit File ".\logging\__init__.py", line 648, in format File ".\logging\__init__.py", line 436, in format File ".\logging\__init__.py", line 306, in getMessage UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)

0 Likes

#47

I added a screencast at Jing for showing the features off:
screencast.com/t/wXFuTAvDRg

EDIT: sorry… new to screencast, posted the wrong URL :stuck_out_tongue:

0 Likes

#48

@sublimator, Indeed there’s great stuff in OpenKomodo. They also have linting stuff… but I’m now using SublimeLint…

@xavi, that seems like an encoding problem… but it doesn’t seem to come directly from SublimeCodeIntel… it’s a weird traceback :S
Does your source code contains special characters?

@senzo, I can see the problem occurring here (for dojo) …but I can’t find out what it is… the dojo CIX library included with SublimeCodeIntel is for dojo 1.5 and your link is for 1.6. I’m not sure if that can be the cause or if it’s something else…

Always pull the latest SublimeCodeIntel… and if anyone is experiencing issues or problems running SublimeCodeIntel in any platform, please let me know at github.com :smile:

0 Likes

#49

Howdy! I’m trying to try out CodeIntel, but for some reason, it is trying to load the OS X versions of the prebuilt libraries and subsequently the CodeIntel plugin fails to initialize. I’m on an up-to-date Arch Linux x86-64 system, using the latest Sublime build and my copy of CodeIntel is at the latest commit (71cf6ae as of this writing). Here is the relevant bit of the log log from the Sublime console:

Reloading plugin /home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/python_codeintel.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 29, in reload_plugin
  File "./python_codeintel.py", line 86, in <module>
    from codeintel2.common import *
  File "/home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/codeintel2/common.py", line 76, in <module>
    import SilverCity
  File "/home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/SilverCity/__init__.py", line 1, in <module>
    import _SilverCity
  File "/home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/SilverCity/_SilverCity.py", line 22, in <module>
    from _macosx_universal._SilverCity import *
ImportError: /home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/_macosx_universal/_SilverCity.so: invalid ELF header

I’m really excited to get this working, as I’ll be able to switch from my comparatively uncomfortable gvim config!

TIA,
nerdshark

Edit: After hacking on SublimeCodeIntel/libs/SilverCity/_SilverCity.py and allowing the ImportError to be raised on import of the linux x86_64 libs, I discovered that something was trying to load a version of the pcre shared library that didn’t exist on my system.

Reloading plugin /home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/python_codeintel.py Traceback (most recent call last): File "./sublime_plugin.py", line 29, in reload_plugin File "./python_codeintel.py", line 86, in <module> from codeintel2.common import * File "/home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/codeintel2/common.py", line 76, in <module> import SilverCity File "/home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/SilverCity/__init__.py", line 1, in <module> import _SilverCity File "/home/nerdshark/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/SilverCity/_SilverCity.py", line 10, in <module> from _linux_libcpp6_x86_64._SilverCity import * ImportError: libpcre.so.3: cannot open shared object file: No such file or directory

Creating a symlink from /usr/lib/libpcre.so to /usr/lib/libpcre.so.3 gets CodeIntel to load. Now, the question is, why is CodeIntel linking to a specific version of pcre? Wouldn’t it be better to link to the copy of the library that doesn’t have the version in its filename?

0 Likes