WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Dev Tools (https://www.wowinterface.com/forums/forumdisplay.php?f=41)
-   -   My Work on a Lua IDE (https://www.wowinterface.com/forums/showthread.php?t=34752)

sylvanaar 09-02-10 06:55 PM

My Work on a Lua IDE
 
4 Attachment(s)
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








Vlad 09-10-10 05:35 PM

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. ;)

sylvanaar 09-12-10 10:07 AM

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 09-12-10 10:09 AM

Quote:

Originally Posted by Vladinator (Post 205751)
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 09-12-10 12:22 PM

updated to 0.8.1 - identifier resolution fixes

try ctrl-clicking various identifiers (currently only works with locals)

sylvanaar 09-13-10 01:24 AM

Updated to 0.8.2 - support for for loop identifiers

Rilgamon 09-13-10 06:07 AM

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 ?

sylvanaar 09-13-10 06:52 AM

Quote:

Originally Posted by Rilgamon (Post 206023)
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 09-13-10 06:53 AM

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

Rilgamon 09-13-10 09:31 AM

Quote:

Originally Posted by sylvanaar (Post 206030)
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 :D

sylvanaar 09-26-10 01:48 AM

Updated the feature list.

Xubera 09-26-10 02:04 AM

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 :)

sylvanaar 09-26-10 02:21 AM

Quote:

Originally Posted by Xubera (Post 207334)
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.

Xubera 09-26-10 02:30 AM

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?

sylvanaar 09-26-10 02:31 AM

Quote:

Originally Posted by Xubera (Post 207345)
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.

Xubera 09-26-10 02:37 AM

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 :)

sylvanaar 09-26-10 02:42 AM

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.

Xubera 09-26-10 03:09 AM

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 :)

sylvanaar 09-26-10 03:36 AM

I found the error I think. I'll wait for some more feedback from you before pushing out a new version.

sylvanaar 09-26-10 04:03 AM

Went ahead an pushed a new version. You can update within the ide.

The new version is 0.8.17

sylvanaar 11-01-10 08:08 AM

Posted on lua-l


[ann] Lua 0.8.31 For IntelliJ IDEA And Other JetBrains Products
Jon Akhtar <akhtar <at> mindspring.com>
2010-11-01 14:01:51 GMT

My work on an Eclipse style Lua IDE has reached a new milestone and I felt it
was ready for another [ann].

If you would like to try it you can use the free version of IntelliJ
http://www.jetbrains.com/idea/download/

You can enable the plugin by going to the File/Settings menu, then on
the Plugins tab locate and install the Lua plugin from the list of
available plugins.

The project homepage is
http://www.bitbucket.org/sylvanaar2/...idea/wiki/Home, there are
a *A LOT* of screenshots and the source code.

This is the last of the v0.8 series. I'm interested in getting as much feedback
as possible as I release 0.9 and am on the home stretch for v1.0 by the end of
the year.

Features
--------

JavaHelp For Lua 5.1
Execution in the Kahlua interpreter
Identifier Highlighter
Go to definition
find usages
Code formatting
Keyword completion
5 code intentions(s)
6 code inspection(s)
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 inout.

sylvanaar 11-10-10 05:50 PM

Released version 0.9

sylvanaar 12-03-10 07:55 AM

Updated description for 0.9.11

sylvanaar 12-15-10 11:04 PM

Major performance improvements in 0.9.14

Vlad 12-16-10 06:31 AM

I'm happy you keep working on the LUA project for this IDE. ;) gj

sylvanaar 01-29-11 09:52 PM

Updated for 0.9.50-beta2

I need lots of people to try it out and give me feedback so I can make sure it is ready for its 1.0 release.

sylvanaar 02-07-11 01:36 AM

Updated for 0.9.51

sylvanaar 02-13-11 09:23 PM

updated for 0.9.59, added links to some screencasts

sylvanaar 04-12-11 07:38 AM

Version 0.9.90 Announced:

http://permalink.gmane.org/gmane.com....general/77870

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

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

Vlad 04-12-11 09:32 AM

Very happy to see you keep working on this project, gj on the hotfixes as well! :)

renews 05-11-11 04:08 PM

Inline doc's never found a thing, completition working. can you help me?

sylvanaar 05-12-11 01:37 AM

Quote:

Originally Posted by renews (Post 237077)
Inline doc's never found a thing, completition working. can you help me?

Well did you follow the setup screencast?

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

renews 05-12-11 08:34 AM

Yes i did, like i said, only the ctrl+q feature arent working. It's show as searching the doc's but never bring anything, but if i press shift+f1 its open the browser and works as it should.

sylvanaar 05-12-11 08:42 AM

Ok, I'll take a look this weekend and see if I broke it somehow.

renews 05-12-11 01:23 PM

Quote:

Originally Posted by sylvanaar (Post 237130)
Ok, I'll take a look this weekend and see if I broke it somehow.

Thank you very much!

sylvanaar 05-14-11 01:53 PM

Quote:

Originally Posted by renews (Post 237154)
Thank you very much!

I made a fix to the SDK integration, you should download an update from:

https://bitbucket.org/sylvanaar2/idl...raft/wiki/Home

sylvanaar 07-27-14 10:17 AM

If you haven't tried out my Lua plugin for wow development, you might want to take a look. There have been a lot of improvements over the years.


Talyrius 07-28-14 10:21 PM

Are the colors for syntax highlighting easily modified?

Torhal 07-29-14 01:36 AM

Yes, they are. I have globals set to bright-friggin-red.

Resike 07-29-14 01:49 AM

This looks really cool, i'm just not familiar with this IDE.

ravagernl 07-29-14 02:08 AM

Quote:

Originally Posted by sylvanaar (Post 294426)
If you haven't tried out my Lua plugin for wow development, you might want to take a look. There have been a lot of improvements over the years.

[...]

I just wanted to say how I love this :) Whenever the documentation on wowprogramming updates, I just run the update script and I have new documentation :)

sylvanaar 07-29-14 07:41 AM

Glad to know that people are enjoying it. I don't have quite as much time to develop it as I once did, but I still work on it from time to time.

I'd love to have some contributors. It is in fact a fun project to work on (for a tools geek like me).

Wimpface 07-29-14 01:09 PM

Just found this and was excited to try it out! But, I ran into an error as soon as I got started. :(

Code:

Plugin 'Lua' failed to initialize and will be disabled.  Please restart IntelliJ IDEA.

java.lang.ClassNotFoundException: com.sylvanaar.idea.Lua.sdk.KahluaSdk PluginClassLoader[Lua, 1.0.74-135]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:68)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.loadClasses(ComponentManagerImpl.java:408)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.loadClasses(ComponentManagerImpl.java:398)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.access$000(ComponentManagerImpl.java:384)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:107)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:89)
    at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:87)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:508)
    at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:151)
    at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:46)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

I'm guessing I'm doing something wrong when installing the plugin. I'm running IntelliJ Idea 13.1.4.

EDIT: Installing via the "Browse Repositories" window in the program worked, instead of downloading from the wiki. Off I go.

sylvanaar 07-29-14 10:05 PM

Quote:

Originally Posted by Wimpface (Post 294525)
EDIT: Installing via the "Browse Repositories" window in the program worked, instead of downloading from the wiki. Off I go.

Yep. The one on the wiki i guess is pretty ancient.

Wimpface 07-29-14 11:02 PM

Quote:

Originally Posted by sylvanaar (Post 294545)
Yep. The one on the wiki i guess is pretty ancient.

I should follow up with the fact that I love it so far. Thanks for the work you've put into it!

sylvanaar 12-13-15 01:48 PM

I decided to add a new feature for WoW to the editor. It can now automatically detect scripts in the XML files and provide highlighting and code navigation features right there in the XML. So you can ctrl/cmd click on a symbol and go there.

You could do this previously but you had to set it up yourself, and it didn't know what to do with the parameters of the script method or self. Now it does.

I only implemented the base script handlers. I'd love if someone who uses it would like to make a contribution of the other script handlers.

Anyhow, here's a sample:



Here's a link to the code that does the Lua language injection:

https://bitbucket.org/sylvanaar2/lua...e-view-default


All times are GMT -6. The time now is 09:58 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI