Sign in to follow this  
PhaserEditor2D

Phaser Code Completion for Eclipse

Recommended Posts

Hello

 

I created a set of Eclipse Editor Templates with the code completions used by the Phaser sandbox (http://phaser.io/sandbox)

 

You can see instructions to install it on Eclipse here:

 

https://bitbucket.org/boniatillo/phasereditortemplates

 

Screenshot:

 

post-8392-0-69670900-1428871999.png

 

 

Share this post


Link to post
Share on other sites

@Pooya72

 

Bracket uses Tern as its built-in JS analyzer. On the Brackets How-to-Use page, it makes it seem that as long as the phaser.js file is in the same folder or if it is in a require statement, then it should be picked up for code completion.

 

However, I haven't been able to get it to work.

 

Anyone know more about this? Thanks.

Share this post


Link to post
Share on other sites

So I think I figured it out. The max file size for what Tern analyzes is 524288 bytes by default, and Phaser is over 2000000. You can adjust this by creating a new .jscodehints file in the root directory. The config is a JSON block, and the one I did to make it work, at least partially, was this:

 

{ "max-file-size: 3000000 }

 

It may work to just use the minified file instead.

Share this post


Link to post
Share on other sites

@Pooya72

 

To clarify, the default 512KB limit Tern sets for the files it uses for autocomplete is less than the phaser.js file which is over 2MB, therefore Tern does not parse it for definitions for populating the autocomplete.

 

However, the phaser min file, it being significantly smaller, could very well be parsed by the Tern autocomplete engine, so it might just work to make sure the phaser min file is in the same directory as your project source files.

 

The other option I suggested was to change that 512KB limit by creating a new file with the name ".jscodehints". To change the size limit of files the Tern engine will parse, you can include { "max-file-size": 3000000 } in the .jscodehints file. Reload brackets and this should hopefully do the trick.

Share this post


Link to post
Share on other sites

@Pooya72

 

To clarify, the default 512KB limit Tern sets for the files it uses for autocomplete is less than the phaser.js file which is over 2MB, therefore Tern does not parse it for definitions for populating the autocomplete.

 

However, the phaser min file, it being significantly smaller, could very well be parsed by the Tern autocomplete engine, so it might just work to make sure the phaser min file is in the same directory as your project source files.

 

The other option I suggested was to change that 512KB limit by creating a new file with the name ".jscodehints". To change the size limit of files the Tern engine will parse, you can include { "max-file-size": 3000000 } in the .jscodehints file. Reload brackets and this should hopefully do the trick.

 

Thx oranjoose. your solution could be helpful for many of developers (also out of Phaser's world), please Create a new topic for it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.