Lua Support In The IntelliJ Editor With Corona API Support

As posted elsewhere in the forums, the Lua language plugin for the IntellJ Community Edition can provide a good cross-platform IDE solution for editing Lua files.

For the Corona API it supports auto-completion and function parameter info. (Instructions on setting this up are on the wiki link below)

For full information, see the wiki: https://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Home

Features

* Live Templates (“Zen Lua”)
* Basic Completions
* Quick Documentation with Multiple documentation providers
* Resolving Globals in project and libraries
* Custom API Support including custom function signatures (Experimental)
* Function Information via Quickhelp
* Lua Standard Library Information via Quickhelp (ctrl-Q)
* Hilighting of Upvalues and Fields
* Goto Symbol
* Safe Delete (Experimental)
* Rename Identifier (Experimental)
* JavaHelp For Lua 5.1
* Execution in the Kahlua interpreter
* Go to definition
* find usages
* Code formatting
* Keyword completion
* 1 quickfix
* 5 code intentions
* 6 code inspection
* Highlighting global vs local variables
* Script execution and run configurations
* Kahlua interpreter window for interactive script execution (repl)
* Comes with an embedded Lua compiler written in Java (Kahlua)
* Structure view
* Syntax checking
* Syntax highlighting - including proper handling of extended syntax comments and quotes
* Customizable highlighting colors
* Code folding for code blocks and comments
* Brace Matching for do blocks, long strings and comments, and (, { , [
* Minor feature: comment in/out. [import]uid: 846 topic_id: 8011 reply_id: 308011[/import]

5 stars for this one, very good editor

btw, need better integration tutorial (some kind of step-by-step video is best of the best) [import]uid: 9190 topic_id: 8011 reply_id: 29490[/import]

Glad to hear you like it. I have been working on improving my screencasts. At some point I’ll do one on setting up the initial integration.

Let me know any issues if you had any particular parts that were difficult.

-Jon [import]uid: 846 topic_id: 8011 reply_id: 29574[/import]

Hello akhtar,
CORONA’s API and LUA intergration tutorial is a must have tutorial.

One of the most wanted feature from our team is “word level” auto completion (like VIM), your editor has that feature already but just in one file. If it is possible, we wish have such kind of feature to find the word we want in every lua files in the project.

By use “the word” I mean every behind a local, function and every single word in the project (You will see it in gVim). [import]uid: 9190 topic_id: 8011 reply_id: 29690[/import]

You might try the Lua plugin’s option “Enable Additional Completions”. Though that wont auto-complete every word across all files in the project.

The editor tries to use ‘smart’ auto-completion so it does not offer to complete non-identifiers.

Anyhow try the option out, and let me know how I can improve it. [import]uid: 846 topic_id: 8011 reply_id: 29694[/import]

Hello, we cannot use APIs you posted here https://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Corona%20API%20Support
to turn on full function auto complete with parameters in your editor, pls help us. [import]uid: 9190 topic_id: 8011 reply_id: 29850[/import]

Did you follow these instructions?
[import]uid: 846 topic_id: 8011 reply_id: 29853[/import]

Follow the pictures at the bottom of the page. [import]uid: 846 topic_id: 8011 reply_id: 29857[/import]

Hi, thanks for the quick reponse.
Did you mean your editor do not support complete the function with parameter level?

Like this:
http://www.spenceruresk.com/wp-content/uploads/2011/01/AutoComplete2Eclipse.png
If I have

function foo(param1, param2)

end
in other functions, when I typed foo(
the autocomplete feature you support is press Ctrl Q and show the information about foo, and tell the programmer that foo has 2 input params is param1 and param2? And just it?

All I need is to type *function fo* then Ctrl Space and I have *function foo*
Then Type *(* I have param1, type something, It will replace param1 ultil I type *,* then it will show param2, the same procedure with param2. I will type some thing then type ), it will replace param2 with something

Just like function autocompletion in Ecllipse J2EE version for java [import]uid: 9190 topic_id: 8011 reply_id: 29860[/import]

This is what parameter info looks like currently:

http://screencast.com/t/9s5vtaKw2Ca [import]uid: 846 topic_id: 8011 reply_id: 29865[/import]

OK, I got it! very nice indeed!

And 1 more question pls. How can I define Ctrl Q (function’s parameters information) for my own function in the lua script

Some thing like this:


– Info: get current highscore by user id
– Param 1: userid, number type, user:s identity number
– Return: number type, user’s highscore

function getHighscoreByID(userid)

end

then wherever I type getHighscoreByID( and Ctrl Q, I will have the help text about function info, params list and meaning, return info etc…

Thank you very much. [import]uid: 9190 topic_id: 8011 reply_id: 29873[/import]

Please see the following links as they wil show you the environment setup. I have a problem were I can see what I do on the COrona simulator but my print ('test") statements do not show. I need this for debugging. Can anyone see somthing that I did wrong that wil fix this?
http://creativescientist.com/idea/Screen%20shot%202011-05-06%20at%209.52.39%20AM.png

http://creativescientist.com/idea/Screen%20shot%202011-05-06%20at%209.52.52%20AM.png [import]uid: 6500 topic_id: 8011 reply_id: 35435[/import]

nevermind [import]uid: 4596 topic_id: 8011 reply_id: 50236[/import]

It seems when launching the project via IntelliJ, the print statements don’t properly work in the console window. To work around this, I launch the simulator manually. Then I manually launch the project a single time. From that point on, whenever code changes, I simply hit ctrl-r from within the corona simulator to quickly reload the current project. [import]uid: 81026 topic_id: 8011 reply_id: 50221[/import]

Artofacks1 //

just insert this to top of your code
io.output():setvbuf(‘no’)
then it works. [import]uid: 112642 topic_id: 8011 reply_id: 82343[/import]