Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript, SublimeCodeIntel and hinting Code Intelligence auto-completion

Are there any tips or tutorials to set-up Javascript auto-completion with Sublime Text 2 and SublimeCodeIntel?

  • What are the limitations of Code Intel auto-completion (modules inside wrapper functon, etc.)

  • How Javascript namespace tree is build and can you give manual hints for the Code Intel when it fails to guess correctly (e.g. give somekind of @class my.module.Foobar hint in comments)

The problem is that SublimeCodeIntel itself does not describe the process and the orignal authors of Code Intelligence assume you use it with Komodo IDE (where it works fine what I have heard)

Also here goes forum thread without answers

like image 543
Mikko Ohtamaa Avatar asked Jul 06 '12 10:07

Mikko Ohtamaa


1 Answers

I had a look at SublimeCodeIntel (SCI) source codes and my understanding is that lang_javascript.py describes what SCI is capable of. A simple grep of the file shows that it relies on its own implementation and it does not use external JavaScript lexer. It tries to check JSDoc to some point but the implementation looks rather like an ad-hoc one to me.

The JavaScript lexer does not seem to have any tests so it's hard to know what it can do exactly but there are logging commands so you enable them and give it a go what it does. Personally, I have rather bad experience with SCI (it was slow for me and not accurate enough), so I would try to use something more robust - it's old now as the question is two years old.

This is not a direct answer to your questions, it's just an analysis and you'll have to contact the author or dig some more in the source code (which is fairly easy since it's written in Python), if you are still interested.


There are hidden gems in the source code though:

# Everything is JS is an object.... MUMUHAHAHAHAHAHAAAA.......

:-)

like image 152
Martin Vseticka Avatar answered Sep 20 '22 17:09

Martin Vseticka