Javascript, SublimeCodeIntel and hinting Code Inte

2019-02-04 02:28发布

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

2条回答
叛逆
2楼-- · 2019-02-04 02:34

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.......

:-)

查看更多
疯言疯语
3楼-- · 2019-02-04 02:35

This is a good question. However, your answer is not something that is attainable via this forum. Since the SublimeCodeIntel project is open-source, your best resource is to simply read the code. This may be time-consuming especially if the documentation is weak, but it's ultimately the best way to go when using open-source products. The nice (and, IMO, cool) thing is that you can easily contribute to making it a better product, if so inclined.

You're obviously familiar enough with Sublime Text 2 and it's code completion plugin to the point in which you feel comfortable positing this question. Someone could read through the code and spoon-feed you an answer, but that would help no one, especially you, given your interest. I've personally experienced issues regarding a few Sublime Text plugins and just learn to ignore them blissfully while evangelizing the fundamental merits of this IDE.

I look forward to the possibility (at this point) of seeing someone post a listing summarizing your questions -- I would find it helpful too ... but, only for a week. It's open-source and as such changes rapidly. Your question can ultimately only be answered within the context of the effort you wish to put into contributing to it's further development.

https://github.com/Kronuz/SublimeCodeIntel

查看更多
登录 后发表回答