简体   繁体   中英

Handling lots of JavaScript code with Aptana Studio

I've written some lines of JS code with Aptana Studio 3 (Web project) and tried out-sourcing.

Original structure:

(function(window) {
 var App = { // properties and functions...
 };

 App.SubObject1 = { // properties and functions...
 };
 App.SubObject2 = { // properties and functions...
 };
 // more sub objects here...

 window.App = App;

})(window);

Now, the code was growing to much (> 1000 lines), so I decided to move subobjects into single JS files (all in the same folder) for convenient developing. I also removed the anonymous self calling function, so Aptana Code Assist can find the code inside...

The Problem

The code assist (code completion etc.) doesn't seem to know all code of all JS files or doesn't work proper. Some files know the code of some other files. Other files doesn't know the code of the other files.

I tried indexing, refreshing, project clean-up -> No changes. I also checked that there are no parse errors in my code.

Can I do something to connect the files?
How do you work with mass JS in Aptana?

Thank you!

我已尽力在这里记录正在使用的变通方法: http : //karoshiethos.com/2012/05/11/hacking-code-assist-in-aptana-3-javascript/

I did have a similar problem, I have solved it by creating a new web project. After that I have drag and drop all the files I wanted to work with and I choosed the option link to files, so I don't have to change my directories structure. In your case, I guess that you only would need to drag and drop the files with the functions you want to expose, to the project in wich you want to used the functions, and choose the option 'link to files'. Hope this works for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM