Home Download Buy Blog Forum Support

CodeIntel ported from Open Komodo Editor

CodeIntel ported from Open Komodo Editor

Postby Kronuz on Mon May 30, 2011 11:41 am

I have the first version of the CodeIntel2 ported from Komodo to Sublime Text 2 (Mac OS X only at the moment... maybe someone's willing to compile the needed modules for other platforms, let me know)

You need only to untar the file into Packages and that's it... as you start writing, you'll get "code intellisense" suggestions. I'l still working on finding out how to do the "Jump to symbol declaration"... and Sublime needs more flexible ways to display menus (with icons perhaps and different fonts)... as well as advanced tooltips, so that I can show function calls with parameters information and documentation.

*UPDATE: Older files removed. Get the plugin from GitHub:

http://github.com/Kronuz/SublimeCodeIntel

Don't despair! The first time you use it it needs to build some indexes and it can take more than a few seconds (around six in my configuration).

Please let me know how it goes for you.

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

Kronuz.
Last edited by Kronuz on Tue Aug 02, 2011 8:21 pm, edited 4 times in total.
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: CodeIntel ported from Open Komodo Editor

Postby Kronuz on Tue May 31, 2011 1:20 am

New improved version now with "Jump to Definition" working!

*UPDATE: Older files removed. Get the plugin from GitHub:

I created a github repository to keep the plugin and make it easier for you to download just whatever changed between releases:
http://github.com/Kronuz/SublimeCodeIntel
Last edited by Kronuz on Tue May 31, 2011 6:49 pm, edited 1 time in total.
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: CodeIntel ported from Open Komodo Editor

Postby Kronuz on Tue May 31, 2011 11:13 am

The above links are now obsolete, get the latest from my github. Many improvements have been worked out (including the mouse click for jumping to symbol definitions) and it's now everything is working much much better. I'd say it's pretty much ready now :D

Full code intellisense, function tips and go to definitions in Sublime!

Please, report any bugs, suggestions or thoughts.
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: CodeIntel ported from Open Komodo Editor

Postby paulstraw on Wed Jun 01, 2011 6:47 am

Holy crap dude, this is wonderful.

Possible bug (or maybe I'm just misunderstanding something): Whenever I'm inside a function, I seem to be getting a lot of
Code: Select all
Warning: eval <blah blah blah>
in the status bar, and only sometimes the actual function information. Is this a config problem?

EDIT: I'm also getting similar errors when trying to use the jump to definition stuff on functions:
Code: Select all
Warning: eval 'functionname' <blah blah blah>
paulstraw
 
Posts: 11
Joined: Sat Apr 09, 2011 11:27 pm

Re: CodeIntel ported from Open Komodo Editor

Postby Kronuz on Wed Jun 01, 2011 4:32 pm

@paulstraw, Please pull the new version from github. This one logs errors and stuff to ~/.codeintel/codeintel.log. Please try it and post the logs somewhere if you feel you've found a problem. Thank you for your feedback. :)
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: CodeIntel ported from Open Komodo Editor

Postby paulstraw on Wed Jun 01, 2011 4:48 pm

Now it doesn't seem to be working at all. I'm getting errors like this in ~/.codeintel/codeintel.log:

Code: Select all
codeintel: ERROR: evaluating 'someFunction' at filename.js#123: could not resolve first part of 'someFunction'
codeintel.db: INFO: updating <catalog zone>: 1 catalog dir(s)
codeintel.db: WARNING: the following catalog selections didn't match any loaded API catalog: 'Mozilla Toolkit', 'Ext_30'
paulstraw
 
Posts: 11
Joined: Sat Apr 09, 2011 11:27 pm

Re: CodeIntel ported from Open Komodo Editor

Postby Kronuz on Wed Jun 01, 2011 6:25 pm

@paulstraw, pull again and try the new changes I made. By checking the log, there doesn't seem to be a problem.

This line is normal, it states that "someFunction" definition wasn't found:
Code: Select all
codeintel: ERROR: evaluating 'someFunction' at filename.js#123: could not resolve first part of 'someFunction'


This line says it couldn't find a couple catalogs:
Code: Select all
codeintel.db: WARNING: the following catalog selections didn't match any loaded API catalog: 'Mozilla Toolkit', 'Ext_30'


I'll check further into this if you send me a sample file with the problem and the logs you're getting. Please first pull again as I fixed some issues.
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: CodeIntel ported from Open Komodo Editor

Postby paulstraw on Wed Jun 01, 2011 7:53 pm

The problem is that 'someFunction' exists though (I just changed the function name in that snippet).

After playing with it a bit more, it seems the problem may be that CodeIntel is having trouble/doesn't support traversing directories. In the attached example, I can't get usingObject.js to see things from someObject (inside someObject.js), but if I move it out of ./subfolder (and let the index rebuild), it works fine. The same problem seems to happen when someObject is inside ./subfolder and usingObject is outside.

Uhh, hopefully that's clear. I'm tired.
Attachments
codeIntelTest.zip
Simple folder test.
(2.4 KiB) Downloaded 415 times
paulstraw
 
Posts: 11
Joined: Sat Apr 09, 2011 11:27 pm

Re: CodeIntel ported from Open Komodo Editor

Postby Kronuz on Thu Jun 02, 2011 1:09 am

@paulstraw, I have made some changes that fix some other edge problems so please pull the most recent code... But here, the problem is really not a problem, it's just a matter of misconfiguration... with javascript you just use files, and each file needs to be located somehow. Since it doesn't have an "import" command, it's impossible to know where the files are located by just guessing (files could be anywhere in your hard drive). So you *must* tell where all the directories containing javascript files are. You do this by creating a '.codeintel' folder and a configuration file called 'config' in either your home directory (~/.codeintel/config) or your project root directory (codeIntelTest/.codeintel/config) and adding the paths there:
Code: Select all
{
   "JavaScript": {
      "javascriptExtraPaths": [
         "subfolder",
         "/some/other/weird/absolute/subfolder",
         "some/relative/subfolder/to/the/project",
         "~/some/subfolder/in/your/home/directory"
      ]
   }
}

Basically what that says is that for language "JavaScript", you want some additional paths to be added, that contain more javascript files that will be used, by setting "javascriptExtraPaths". It adds the project folder itself to the extra paths, as wel as some extra "subfolder" directories.

In this particular case, the file "config" is not really needed, as CodeIntel will search inside the project's root folder for *JavaScript* files in up to 10 levels... however, you *must* still flag the root of your project by adding an empty folder named ".codeintel". That alone should solve the problems you were having. For your example, simply create the directory called "codeIntelTest/.codeintel", and then it'll work as expected.
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: CodeIntel ported from Open Komodo Editor

Postby paulstraw on Thu Jun 02, 2011 2:51 am

Ah, yeah, that did the trick. Would there be any way for you to autogenerate that folder if it doesn't exist? Seems like it would make sense, no?

Either way, thanks for your help, appreciate it! Fantastic, very useful plugin.
paulstraw
 
Posts: 11
Joined: Sat Apr 09, 2011 11:27 pm

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 8 guests