Reply
Thread Tools Display Modes
Unread 09-02-10, 06:55 PM   #1
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
My Work on a Lua IDE

I know this may not be for everyone, but I have been working on a Lua IDE within IntelliJ.

If you would like to try it out, there is a free version of IntelliJ 10:

http://www.jetbrains.com/idea/free_java_ide.html

There are loads of pictures here on the wiki page: http://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Home

ohloh page: http://www.ohloh.net/p/idlua

"how to" screencast showing how to set up the WOW APIs and FrameXML libraries for completions and documentation.

http://www.screencast.com/t/78ltrNMsC7

Here's an (incomplete) feature list

1. Basic Completions
2. Quick Documentation with Multiple documentation providers
3. Resolving Globals in project and libraries
4. Custom API Support including custom function signatures (Experimental)
5. Function Information via Quickhelp
6. Lua Standard Library Information via Quickhelp (ctrl-Q)
7. Hilighting of Upvalues and Fields
8. Goto Symbol
9. Safe Delete (Experimental)
10. Rename Identifier (Experimental)
11. JavaHelp For Lua 5.1
12. Execution in the Kahlua interpreter
13. Go to definition
14. find usages
15. Code formatting
16. Keyword completion
17. 1 quickfix
18. 5 code intentions
19. 6 code inspection
20. Highlighting global vs local variables
21. Script execution and run configurations
22. Kahlua interpreter window for interactive script execution (repl)
23. Comes with an embedded Lua compiler written in Java (Kahlua)
24. Structure view
25. Syntax checking
26. Syntax highlighting - including proper handling of extended syntax comments and quotes
27. Customizable highlighting colors
28. Code folding for code blocks and comments
29. Brace Matching for do blocks, long strings and comments, and (, { , [
30. 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.

I am using it for my plugin development now. The global vs local highlighting is very handy!

Here are some screencasts so you can see it in action:

Unbalanced Assignment Quickfix
Custom APIs and Parameter Info
Code Formatter
Lua API Documentation


Another example of how its being used







Attached Thumbnails
Click image for larger version

Name:	8-31-2010 5-42-00.jpg
Views:	2766
Size:	89.4 KB
ID:	4791  Click image for larger version

Name:	1-29-2011 10-09-46 PM-popup.png
Views:	1672
Size:	128.7 KB
ID:	5653  Click image for larger version

Name:	1-29-2011 10-33-46 PM.jpg
Views:	1593
Size:	118.7 KB
ID:	5654  Click image for larger version

Name:	1-29-2011 10-40-29 PM.jpg
Views:	1602
Size:	97.5 KB
ID:	5655  


Last edited by sylvanaar : 04-13-11 at 07:39 AM.
sylvanaar is offline   Reply With Quote
Unread 09-10-10, 05:35 PM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 760
Gj, I was trying to find some editor that supports LUA as in syntax highlight and also smart "find usages" and local/global highlight, e.g. Would love to be able to spot errors before compiling, like parsing the code in the editor and underlining problems in red or something -guess this is for the future.
Vlad is offline   Reply With Quote
Unread 09-12-10, 10:07 AM   #3
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
updated to version 0.8

experimental support for "find usages" and "go to definition" - mind you *alot* of cases don't work, but its a definite start
sylvanaar is offline   Reply With Quote
Unread 09-12-10, 10:09 AM   #4
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Originally Posted by Vladinator View Post
Gj, I was trying to find some editor that supports LUA as in syntax highlight and also smart "find usages" and local/global highlight, e.g. Would love to be able to spot errors before compiling, like parsing the code in the editor and underlining problems in red or something -guess this is for the future.
It can already find errors in the code and hilight those without compiling.

"find usages" support has just been added in an experimental capacity (i.e it only partially works).
sylvanaar is offline   Reply With Quote
Unread 09-12-10, 12:22 PM   #5
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
updated to 0.8.1 - identifier resolution fixes

try ctrl-clicking various identifiers (currently only works with locals)
sylvanaar is offline   Reply With Quote
Unread 09-13-10, 01:24 AM   #6
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Updated to 0.8.2 - support for for loop identifiers
sylvanaar is offline   Reply With Quote
Unread 09-13-10, 06:07 AM   #7
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 546
I've never used IntelliJ before so I know nothing about it.
Is there a way to have it show a list of my own functions sorted by the filename
they're in ?
__________________
The cataclysm broke the world ... and the pandas could not fix it!
Rilgamon is offline   Reply With Quote
Unread 09-13-10, 06:52 AM   #8
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Originally Posted by Rilgamon View Post
I've never used IntelliJ before so I know nothing about it.
Is there a way to have it show a list of my own functions sorted by the filename
they're in ?
There is a list of functions, but they are for the currently open file.

Give it a try...its pretty easy to get up and running.
sylvanaar is offline   Reply With Quote
Unread 09-13-10, 06:53 AM   #9
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
0.8.4 support for the vexing
Code:
local a; local a=a
Noted link to wiki page now with loads of pictures showing basic setup and usage

Last edited by sylvanaar : 09-13-10 at 07:43 AM.
sylvanaar is offline   Reply With Quote
Unread 09-13-10, 09:31 AM   #10
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 546
Smile

Originally Posted by sylvanaar View Post
There is a list of functions, but they are for the currently open file.

Give it a try...its pretty easy to get up and running.
If it were easy I would not ask From your screenshot I found it was
supposed to be listed in the structure window but for me this was empty.
I had to delete the project and restart and then it showed up

Thanks for your help
__________________
The cataclysm broke the world ... and the pandas could not fix it!
Rilgamon is offline   Reply With Quote
Unread 09-26-10, 01:48 AM   #11
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Updated the feature list.
sylvanaar is offline   Reply With Quote
Unread 09-26-10, 02:04 AM   #12
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
downloading now, i need a better IDE than SciTE one that I found somewhere here on WoWI, I hate the window management when I need more than file up at the same time. so here's hoping
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
Xubera is offline   Reply With Quote
Unread 09-26-10, 02:21 AM   #13
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Originally Posted by Xubera View Post
downloading now, i need a better IDE than SciTE one that I found somewhere here on WoWI, I hate the window management when I need more than file up at the same time. so here's hoping
make sure your plugin version is 0.8.16 or greater. There was a big bug in some earlier versions.
sylvanaar is offline   Reply With Quote
Unread 09-26-10, 02:30 AM   #14
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
i was looking through your screen shots, and it had an instruction to include the Lua directory when creating a project... I dont have Lua on my computer, do I need that library?
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
Xubera is offline   Reply With Quote
Unread 09-26-10, 02:31 AM   #15
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Originally Posted by Xubera View Post
i was looking through your screen shots, and it had an instruction to include the Lua directory when creating a project... I dont have Lua on my computer, do I need that library?
No, only if you want to run the Lua code on your local machine. You can select "Kahlua" as the SDK when you set up your project.

With Kahlua as the SDK, your code will execute in the embedded interpreter (assuming you even try to run it)

Oh, if you are on IRC, i can help you set up - its actually pretty easy.

Last edited by sylvanaar : 09-26-10 at 02:35 AM.
sylvanaar is offline   Reply With Quote
Unread 09-26-10, 02:37 AM   #16
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
alrighty, well ill definitely give it a go. I'll have to figure out to make the indentions work how I like...

like if im typing on a line thats 4 spaces out then hit enter, the cursor is 4 spaces out, but i usually like to double tap enter when breaking things up

like
if 1 == 1 then
someLogic
someStuff

someMoreButDifferentStuff
end

but when i double tap enter, it sets the cursor at the first column, instead of the 4th... into the options i go
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
Xubera is offline   Reply With Quote
Unread 09-26-10, 02:42 AM   #17
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
well, I have to code for all the text alignment and formatting as well. so there may be cases where it doesn't behave optimally.

if you can give steps to reproduce and expected behavior, i can see what i can do.
sylvanaar is offline   Reply With Quote
Unread 09-26-10, 03:09 AM   #18
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
well lets just say this

Code:
function myAddonFrame_OnEvent(self, event, ...)
    print(event,...)

    if event == "ACTIONBAR_SHOWGRID" then
        someFunc()
    elseif event == "ACTIONBAR_HIDEGRID" then
        otherFunc()
    end
end
in this example, the first print command is about 4 spaces as its indention, my normal coding habit is to double tap the enter key, to give that space between the print and if statements.

right now what im experimenting in the IDE is if i type like this

Code:
function myAddonFrame_OnEvent(self, event, ...)
    print(event,...)
    if event == "ACTIONBAR_SHOWGRID" then
        someFunc()
    elseif event == "ACTIONBAR_HIDEGRID" then
        otherFunc()
    end
end
it works fine, but if i type like in the first code box, i will have to reapply the 4 spaces.

for further attempts at clarification, say my cursor is on row 2 column 4 and I hit enter, my cursor is in row 3 column 4. now if I hit enter again without typing anything, im in row 4 column 1. so now to keep the same indention, i have to Tab or space out to get to row 4 column 4.


EDIT:: ---

Actually, ive been noticing now, alot of the times it works as expected, and only occasionally does it do as I am describing above... probably user error
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>

Last edited by Xubera : 09-26-10 at 03:22 AM.
Xubera is offline   Reply With Quote
Unread 09-26-10, 03:36 AM   #19
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
I found the error I think. I'll wait for some more feedback from you before pushing out a new version.
sylvanaar is offline   Reply With Quote
Unread 09-26-10, 04:03 AM   #20
sylvanaar
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 63
Went ahead an pushed a new version. You can update within the ide.

The new version is 0.8.17
sylvanaar is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Dev Tools » My Work on a Lua IDE

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off