Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

My Work On a Lua IDE
Started by akhtar Sep 25 2010 02:40 PM

- - - - -
58 replies to this topic
[TOPIC CONTROLS]
Page 1 of 3 1 2 3
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

I have been working on a Lua IDE within the FREE IntelliJ IDE.

Screenshots, Screencasts, and setup instructions on the wiki page:

http://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Home
Here's an (incomplete) feature list:

Modules support
Debugger support (Experimental)
LuaDoc Support (Experimental)
Lua SDK REPL Console (Experimental)
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.

To install the Lua plugin, use the plugin manager inside IntelliJ

To do so, choose File/Settings/Plugins, and Locate the Lua plugin and right click it and choose install.
uid: 846 topic_id: 2200 reply_id: 302200


[TOPIC: post.html]
#2

newbie101

[GLOBAL: userInfoPane.html]
newbie101
  • Contributor

  • 108 posts
  • Corona SDK

I have been using your plugin, all I can say is:WOW, the new update has really helped speed up my development time.

Is it possible to do function parameter autocomplete?
uid: 11334 topic_id: 2200 reply_id: 21478


[TOPIC: post.html]
#3

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

Glad you like it. I have been developing it for almost a year - so it is nice to hear that people are enjoying it.

Im not 100% sure what you mean by parameter autocomplete, but I am working an interface to allow custom API's (such as corona) to have auto-completion and documentation for their functions (sort of like the documentation you see when ctrl-hover over a std lua function like io.write, or table.insert.

The custom API support is already built into the plugin, and the interface to it will be included sometime between now and the 1.0 release (at the time i am writing this the current release is 0.9.51).
uid: 846 topic_id: 2200 reply_id: 21488


[TOPIC: post.html]
#4

newbie101

[GLOBAL: userInfoPane.html]
newbie101
  • Contributor

  • 108 posts
  • Corona SDK

the function parameter is when after you autocomplete a function it shows you the parameters of the function ex: auto completing table.remove will show table.remove(table, index), screen cast: http://screencast.com/t/MH7e2H9w4sG

PS: I think changing the name of a variable is broken in the new release? It works great in previous versions.
uid: 11334 topic_id: 2200 reply_id: 21490


[TOPIC: post.html]
#5

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

I see. Ok, i'll do my best to add it in. if it is not too difficult, ill try to get it in 1.0

Yes variable name change was broken in 0.9.50, its on my list.

Your feature request ticket is here:

http://bitbucket.org/sylvanaar2/lua-for-idea/issue/17/add-function-parameter-hints-on

uid: 846 topic_id: 2200 reply_id: 21545


[TOPIC: post.html]
#6

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

Your change is in the latest version
uid: 846 topic_id: 2200 reply_id: 22297


[TOPIC: post.html]
#7

bsoisoi

[GLOBAL: userInfoPane.html]
bsoisoi
  • Observer

  • 11 posts
  • Guests

Great work! I'm really happy to have found this, I use IntelliJ IDEA in my day job, and really don't know what I'd do without it.

What do I need to do to enable autocomplete functionality on Corona SDK classes (e.g. display., physics., etc)?
uid: 21649 topic_id: 2200 reply_id: 23434


[TOPIC: post.html]
#8

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

Well, cagatay was nice enough to set up the corona API, but we haven't posted it yet. In the meantime:

You can check out this ticket: https://bitbucket.org/sylvanaar2/lua-for-idea/issue/24/corona-sdk-import-error

and then these instructions:

https://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Setting_Up_Custom_API%27s

uid: 846 topic_id: 2200 reply_id: 23436


[TOPIC: post.html]
#9

bsoisoi

[GLOBAL: userInfoPane.html]
bsoisoi
  • Observer

  • 11 posts
  • Guests

Great! I've set this up, looks good. The completions aren't as intelligent as those in TextMate. In the short term, I'll just edit the lua2.lua file to conform to my development patterns.

cheers!
uid: 21649 topic_id: 2200 reply_id: 23437


[TOPIC: post.html]
#10

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

the completions and quickdocs are done, and can be found here:

https://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Corona%20API%20Support
uid: 846 topic_id: 2200 reply_id: 24162


[TOPIC: post.html]
#11

Magenda

[GLOBAL: userInfoPane.html]
Magenda
  • Contributor

  • 427 posts
  • Corona SDK

@akhtar

Great work there. Thank you so much!

Question:

Is there any way, currently, to have Corona function arguments/parameters shown in the tooltips? I see that the .properties file for WOW API is richer than the corresponding one for Corona -is this because it is made just for autocompletion?

If yes, are you planning to enrich the file so that arguments inspection inside IDE is possible, just like te wow example? That would be awesome!

I see that the Corona online API docs are well structured, so we could grab the "Syntax" snippet for each API function with a lua script.
Thanks again for your time!
uid: 7356 topic_id: 2200 reply_id: 24398


[TOPIC: post.html]
#12

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

Magenta:

The files you need are on this page:

https://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Corona%20API%20Support

The Corona properties file is fully completed, so you should have full parameter info just like in the wow example if you set it up.

Docs are moving to a lua based mechanism now, so that you can supply them with a lua script (that is how the wow docs are working currently and the corona ones will be soon enough)

Here is the current wow documentation file (its Lua based)

https://bitbucket.org/sylvanaar2/lua-for-idea/src/452197717dc7/test/plugin/api/wow-api.doclua
uid: 846 topic_id: 2200 reply_id: 24411


[TOPIC: post.html]
#13

Magenda

[GLOBAL: userInfoPane.html]
Magenda
  • Contributor

  • 427 posts
  • Corona SDK

@akhtar

This is great!

I can now properly see full arguments listing.

However, some functions (which are included in .lua) are not included in the .properties file. With the lua based mechanism you described, are you planning to make the argument retrieval procedure fully automated so that the functions are constantly in sync with the online docs? That would give an excellent documentation solution for Corona users!

PS: I am starting to love IntelliJ ... especially with your documentation solution it is a very nice editor to work with! Bye bye TextMate...
uid: 7356 topic_id: 2200 reply_id: 24426


[TOPIC: post.html]
#14

khanh.dq

[GLOBAL: userInfoPane.html]
khanh.dq
  • Contributor

  • 264 posts
  • Corona SDK

Work great!!!
We decided to use this Editor in our studio.
Thank you very much.
uid: 9190 topic_id: 2200 reply_id: 29452


[TOPIC: post.html]
#15

puyopuy

[GLOBAL: userInfoPane.html]
puyopuy
  • Observer

  • 13 posts
  • Guests

Well done, akhtar.

I installed your plug-in and Corona's API but I still can't figure out how to debug and launch Corona simulator from IDEA. Can anyone provide me details how to set it up?

Thank you very much in advance.
uid: 48794 topic_id: 2200 reply_id: 32279


[TOPIC: post.html]
#16

afonseca

[GLOBAL: userInfoPane.html]
afonseca
  • Enthusiast

  • 87 posts
  • Corona SDK

Looks great, I'll give it a try as I've been looking for an IDE and haven't found one I'm happy with yet. Any plans to support the Corona debugger? This would be huge for me.
uid: 8692 topic_id: 2200 reply_id: 32573


[TOPIC: post.html]
#17

bsoisoi

[GLOBAL: userInfoPane.html]
bsoisoi
  • Observer

  • 11 posts
  • Guests

Dudes. This is a Lua IDE. Continue to run your debugger as you have been.
uid: 21649 topic_id: 2200 reply_id: 32576


[TOPIC: post.html]
#18

afonseca

[GLOBAL: userInfoPane.html]
afonseca
  • Enthusiast

  • 87 posts
  • Corona SDK

bsoisoi, are you saying an IDE shouldn't have a built in visual debugger? Seems like an obvious feature for an IDE nowadays.
uid: 8692 topic_id: 2200 reply_id: 32578


[TOPIC: post.html]
#19

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

As an embedded Lua user you would have no use for a generic Lua debugger. You would want the debugging features from the Corona SDK.

I am looking into how best to provide such features, but for now you do have existing tools that can be configured to work with the IDE.

Maybe when I get some time this weekend I can put together a screencast.
uid: 846 topic_id: 2200 reply_id: 32579


[TOPIC: post.html]
#20

afonseca

[GLOBAL: userInfoPane.html]
afonseca
  • Enthusiast

  • 87 posts
  • Corona SDK

>> As an embedded Lua user you would have no use for a generic Lua debugger.

Agreed, my suggestion was to integrate with the Corona SDK debugger so we could debug apps in the IDE running on the Corona simulator. I'd love to learn more about what you mean by configuring existing tools.

Ideally what would be a great integration feature would include being able to set breakpoints in a source file in the IDE, step through code from the editor and provide views for the stack trace, local variables, and watch expressions.

I'll give the IDE a try and see how it works, from the screenshots looks really good!
uid: 8692 topic_id: 2200 reply_id: 32590


[TOPIC: post.html]
#21

afonseca

[GLOBAL: userInfoPane.html]
afonseca
  • Enthusiast

  • 87 posts
  • Corona SDK

akhtar, I got it working and the plug-in is very nice! It takes some getting used to since it's my first time with the editor but I like the features so far. However, I can't get the parameter auto-complete to work even after following the install guide. Any ideas?
uid: 8692 topic_id: 2200 reply_id: 32647


[TOPIC: post.html]
#22

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

I'll look into it. You might try "Invalidate Caches" from (I think) the file menu.

I am not sure that will fix your issue.

I'll look into it.
uid: 846 topic_id: 2200 reply_id: 32648


[TOPIC: post.html]
#23

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

I have been spending so much time working on the editor, I have been relying on users to provide usage feedback.

I think this weekend I will write a Corona app myself just to make see what the main hurdles are, and how to set everything up.

Then I can make a "setup" screencast which may help. Once you have set it up once, it becomes quite easy to set up...but the first time is always confusing.
uid: 846 topic_id: 2200 reply_id: 32651


[TOPIC: post.html]
#24

afonseca

[GLOBAL: userInfoPane.html]
afonseca
  • Enthusiast

  • 87 posts
  • Corona SDK

I'd be glad to provide some feedback as I learn it. The install process was a bit unfamiliar because I had to install Lua and it wasn't clear how to do that since I never needed to with Corona.

I think I found the bug, looks like it's trying to do autocomplete for parameters but gets an error. Sorry for the long message but I figure you'll find this stack trace helpful:
:1: '' expected near `)`: :1: '' expected near `)`
se.krka.kahlua.vm.KahluaException: :1: '' expected near `)`
at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:270)
at org.luaj.kahluafork.compiler.LexState.syntaxerror(LexState.java:281)
at org.luaj.kahluafork.compiler.LexState.error_expected(LexState.java:675)
at org.luaj.kahluafork.compiler.LexState.check(LexState.java:688)
at org.luaj.kahluafork.compiler.LexState.compile(LexState.java:191)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:125)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:117)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadstring(LuaCompiler.java:129)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.runLua(KahluaPluginDocumentationProvider.java:244)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.runLuaQuickNavigateDocGenerator(KahluaPluginDocumentationProvider.java:217)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.getQuickNavigateInfo(KahluaPluginDocumentationProvider.java:115)
at com.intellij.lang.documentation.CompositeDocumentationProvider.getQuickNavigateInfo(CompositeDocumentationProvider.java:59)
at com.sylvanaar.idea.Lua.codeInsight.LuaParameterInfoHandler.showParameterInfo(LuaParameterInfoHandler.java:81)
at com.sylvanaar.idea.Lua.codeInsight.LuaParameterInfoHandler.showParameterInfo(LuaParameterInfoHandler.java:31)
at com.intellij.codeInsight.hint.ShowParameterInfoHandler.invoke(ShowParameterInfoHandler.java:94)
at com.intellij.codeInsight.AutoPopupController$4.run(AutoPopupController.java:145)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:229)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:332)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:652)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:505)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:404)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

se.krka.kahlua.vm.KahluaException: :1: '' expected near `)`
at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:270)
at org.luaj.kahluafork.compiler.LexState.syntaxerror(LexState.java:281)
at org.luaj.kahluafork.compiler.LexState.error_expected(LexState.java:675)
at org.luaj.kahluafork.compiler.LexState.check(LexState.java:688)
at org.luaj.kahluafork.compiler.LexState.compile(LexState.java:191)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:125)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:117)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadstring(LuaCompiler.java:129)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.runLua(KahluaPluginDocumentationProvider.java:244)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.runLuaQuickNavigateDocGenerator(KahluaPluginDocumentationProvider.java:217)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.getQuickNavigateInfo(KahluaPluginDocumentationProvider.java:115)
at com.intellij.lang.documentation.CompositeDocumentationProvider.getQuickNavigateInfo(CompositeDocumentationProvider.java:59)
at com.intellij.codeInsight.navigation.CtrlMouseHandler.generateInfo(CtrlMouseHandler.java:234)
at com.intellij.codeInsight.navigation.CtrlMouseHandler.access$1000(CtrlMouseHandler.java:81)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$InfoSingle.getInfo(CtrlMouseHandler.java:313)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$TooltipProvider.showHint(CtrlMouseHandler.java:538)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$TooltipProvider.access$1900(CtrlMouseHandler.java:432)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$TooltipProvider$2.run(CtrlMouseHandler.java:516)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:652)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:505)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:404)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

se.krka.kahlua.vm.KahluaException: :1: '' expected near `)`
at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:270)
at org.luaj.kahluafork.compiler.LexState.syntaxerror(LexState.java:281)
at org.luaj.kahluafork.compiler.LexState.error_expected(LexState.java:675)
at org.luaj.kahluafork.compiler.LexState.check(LexState.java:688)
at org.luaj.kahluafork.compiler.LexState.compile(LexState.java:191)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:125)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadis(LuaCompiler.java:117)
at se.krka.kahlua.luaj.compiler.LuaCompiler.loadstring(LuaCompiler.java:129)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.runLua(KahluaPluginDocumentationProvider.java:244)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.runLuaQuickNavigateDocGenerator(KahluaPluginDocumentationProvider.java:217)
at com.sylvanaar.idea.Lua.lang.documentor.KahluaPluginDocumentationProvider.getQuickNavigateInfo(KahluaPluginDocumentationProvider.java:115)
at com.intellij.lang.documentation.CompositeDocumentationProvider.getQuickNavigateInfo(CompositeDocumentationProvider.java:59)
at com.intellij.codeInsight.navigation.CtrlMouseHandler.generateInfo(CtrlMouseHandler.java:234)
at com.intellij.codeInsight.navigation.CtrlMouseHandler.access$1000(CtrlMouseHandler.java:81)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$InfoSingle.getInfo(CtrlMouseHandler.java:313)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$TooltipProvider.showHint(CtrlMouseHandler.java:538)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$TooltipProvider.access$1900(CtrlMouseHandler.java:432)
at com.intellij.codeInsight.navigation.CtrlMouseHandler$TooltipProvider$2.run(CtrlMouseHandler.java:516)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:652)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:505)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:404)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
uid: 8692 topic_id: 2200 reply_id: 32653


[TOPIC: post.html]
#25

akhtar

[GLOBAL: userInfoPane.html]
akhtar
  • Enthusiast

  • 61 posts
  • Guests

I have created an issue for this:

https://bitbucket.org/sylvanaar2/lua-for-idea/issue/53/exception-in-corona-doclua
uid: 846 topic_id: 2200 reply_id: 32654



[topic_controls]
Page 1 of 3 1 2 3
 
[/topic_controls]