ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Dev Tools (https://www.esoui.com/forums/forumdisplay.php?f=173)
-   -   IntelliJ and sylvanaar (https://www.esoui.com/forums/showthread.php?t=776)

Tinuviel 04/10/14 11:45 PM

IntelliJ and sylvanaar
 
Hi there,

As I am a professional developer that works in Visual Studio all day, I guess I'm a bit spoiled by IDE's with a good feature set. Specifically, I missed syntax checking and code completion (intellisense). Because of this, I looked around for a bit and finally found a very good solution. It adds both missing features - and after configuration - full API intellisense. As such, I figured I would share my findings with other developers.





IDE: IntelliJ Community Edition. You can find it here: http://www.jetbrains.com/idea/download/

After IntelliJ is installed, you then need to add LUA support, and luckly someone already made a plugin for this! To install it, open IntelliJ and go to File->Settings->Plugins, click on 'Browse Repositories', search for 'Lua', and click 'Install'. If you want more information about the plugin itself, you can find it here: https://bitbucket.org/sylvanaar2/lua-for-idea/wiki/Home.

Now all that is needed is to add the ESO API into the intellisense. This requires a set of .lua files that define the functions and constants. There was nothing out there I could find in this format, so I created them myself! Simply extract this zip out to a folder and you're ready for the next step:
https://www.dropbox.com/s/4gbmmerpes...lls-online.zip.

These lua files were generated with a set of powershell scripts I created. With those, I copy/paste the api information off the esoui wiki pages into a text document, save the document, then run the powershell scripts. For those interested in those scripts, please PM me.

To enable to API intellisense:
Create a new project, select 'Lua' as your framework, press 'configure', choose 'LuaJ' then press the '+' button on the right. In the dialog that pops up, select the folder you extracted earlier.

Now when you make new projects just select the 'LuaJ' target, and you will have intellisense for the ESO API and your own code!

Seerah 04/11/14 12:13 PM

Corrected your typo in the title (in sylv's name). ;)

I remember when he made that for WoW...

SpecialK 04/11/14 10:46 PM

Well take a look at "Havok Script":
http://www.havok.com/products/script

It's what the game uses.
As you can see it has an IDE with intelliSense, etc.

One could probably get a basic license, maybe an "indie" license, or something for cheap.

Iyanga 04/15/14 12:29 PM

Does the syntax checker from IntelliJ just mark lexical errors or grammatical errors, too?

In example, will it tell you that this code is not valid LUA:

if a == false then
local bla = a
else if b == false then
local bla = b
end


(Just wondering if it's worth to switch the IDE, but don't want less features.)

Tinuviel 04/15/14 05:04 PM

Quote:

Originally Posted by Iyanga (Post 4483)
Does the syntax checker from IntelliJ just mark lexical errors or grammatical errors, too?

In example, will it tell you that this code is not valid LUA:

if a == false then
local bla = a
else if b == false then
local bla = b
end


(Just wondering if it's worth to switch the IDE, but don't want less features.)

Just looked, and it doesn't.

Tyx 04/15/14 05:13 PM

Thank you for you hard work - is it possible to implement your script in Eclipse too?

I prefer to work with Eclipse because IntelliJ is to slow on my system, and Eclipse offers the usual great debug and work interface (at least in my eyes ;) maybe just used to it)

geri 04/20/14 03:18 AM

Thanks Tinuviel, thats helpful!


@Iyanga: What IDE do you use?

Wykkyd 04/21/14 09:35 PM

I work all day in Visual Studio.

I should probably use an IDE for Lua too, eh? I've done everything up to this point in Notepad++.

Seerah 04/21/14 09:52 PM

<3 Notepad++

stjobe 04/22/14 12:03 AM

Quote:

Originally Posted by Wykkyd (Post 5275)
I work all day in Visual Studio.

I should probably use an IDE for Lua too, eh? I've done everything up to this point in Notepad++.

Quote:

Originally Posted by Seerah (Post 5279)
<3 Notepad++

Notepad++

IntelliJ + ESO Lua looks interesting though, might have to use it for the next project. Thanks for the tip :)

ins 04/22/14 01:30 PM

Nobody use good old Notepad anymore? :)

Gonna test this with VS. Hopefully it works in 2010.

Tinuviel 04/25/14 07:35 PM

I work in Visual Studio all day as well. I'm a professional .NET developer for trade.
This was just the easiest way to get features I'm used to. Honestly, I've been spoiled rotten by VS2013 and Resharper. (even though I have VS installed at home, I wasn't in the mood to figure out how to set this up)

I use Notepad++ all the time too, but generally for lighter things. A lot of the time it's for manual .csproj / .vbproj editing, one-off quick fixes, viewing XML / nuspec / build logs, etc. When I'm making something more meaty, I like more help.

Tinuviel 04/25/14 07:38 PM

Quote:

Originally Posted by Tyx (Post 4532)
Thank you for you hard work - is it possible to implement your script in Eclipse too?

I prefer to work with Eclipse because IntelliJ is to slow on my system, and Eclipse offers the usual great debug and work interface (at least in my eyes ;) maybe just used to it)

I found this by looking at WoW solutions and altering them to fit ESO. I would search for that, and look into modifying it to work with Eclipse. I did see some Eclipse plugin somewhere, but I have used Eclypse in the past and there are a bunch of small differences between the Visual Studio methodology that have always irritated me, so I didn't pursue that route.

lyravega 04/28/14 08:54 AM

Quote:

Originally Posted by Wykkyd (Post 5275)
...I've done everything up to this point in Notepad++.

Npp
Best thing ever.

Stormknight 04/28/14 10:04 AM

Nice find! Whilst Notepad++ is pretty good, I've been using Ultra Edit for around 15 years. ;)

ins 04/28/14 10:47 AM

Quote:

Originally Posted by Stormknight (Post 6236)
Nice find! Whilst Notepad++ is pretty good, I've been using Ultra Edit for around 15 years. ;)

Uedit32 is great :)

And fast... Its great to use it to when you want to edit HUUUUUUUUUUUGE files since it handles those quite nicely :)

Wobin 04/28/14 12:05 PM

Quote:

Originally Posted by ins (Post 6242)
Uedit32 is great :)

And fast... Its great to use it to when you want to edit HUUUUUUUUUUUGE files since it handles those quite nicely :)

I've just used gvim for ridiculously large files.

Tyx 05/02/14 06:39 AM

Quote:

Originally Posted by Tinuviel (Post 5915)
I found this by looking at WoW solutions and altering them to fit ESO. I would search for that, and look into modifying it to work with Eclipse. I did see some Eclipse plugin somewhere, but I have used Eclypse in the past and there are a bunch of small differences between the Visual Studio methodology that have always irritated me, so I didn't pursue that route.

I know what you mean. I tried Visual Studio once when I had to work with c++ but it felt somewhat off. So same thing but the other way ;)

Thanks for the tip.

DerVagabund 05/05/14 04:33 AM

Quote:

Originally Posted by Wykkyd (Post 5275)
I work all day in Visual Studio.

I should probably use an IDE for Lua too, eh? I've done everything up to this point in Notepad++.

Heh, and I thought I am the only one doing this :D

I think I will stay with Notepad++ as I do not need to compile LUA before running it, thus I see no real need for a development environment. Sure it would be nice to have auto completion suggestions for code but unless all the ESO internal functions are supported I see no real need, as lua itself is not that much different to all other programming languages :)

Harven 05/05/14 04:51 AM

Hey,
the code copletion feature in IntelliJ looks great. I'm using LuaEdit but I don't know if it's possible to add the eso api to thier code copletion mechanism.

Marihk 05/10/14 10:07 PM

Thanks
 
Thanks very much for providing this. It's been most helpful!

CatoTheElder 05/11/14 02:31 AM

vi

Tried, trusted, and true... I find the compiler does a pretty damned good job of showing errors.

katkat42 05/11/14 12:46 PM

Quote:

Originally Posted by CatoTheElder (Post 7446)
vi

Tried, trusted, and true... I find the compiler does a pretty damned good job of showing errors.

Personally, I'm waiting for someone to write an EMACS major mode... :D :p ;)

Feroc 05/11/14 02:15 PM

Thanks for the info. I am working in VS the whole day, too. Right now I am only using Notepad++ for my small addons, but I guess I could start to organize them a bit better and a better IDE would be helpful for that.

Arkhaniir 07/25/14 01:51 AM

Just got into Addon Development and as a SE student, I definetly feel more comfortable working with a IDE. So thanks for providing this.

Quote:

Originally Posted by Tyx (Post 4532)
Thank you for you hard work - is it possible to implement your script in Eclipse too?

I prefer to work with Eclipse because IntelliJ is to slow on my system, and Eclipse offers the usual great debug and work interface (at least in my eyes ;) maybe just used to it)

It would be great to be able to work with Eclipse since I'm used to it. I will be following this thread.

Once again, thanks. I should keep digging around...

parnell 01/03/15 10:42 AM

Nice job Tinuviel. This is awesome. Any chance you would mind putting the sdk on github so we can all keep it up to date as new API are released?

I also am a VS2013/resharper developer so this makes it nice. Any chance you have found a good unit testing framework as well? I'd like to write TDD so that i'm not spending so much time writing calls to d() :)

Thanks,

mctaylor 01/09/15 05:42 PM

Quote:

Originally Posted by katkat42 (Post 7498)
Personally, I'm waiting for someone to write an EMACS major mode... :D :p ;)

There is a Lua mode already. Okay, not in the base distribution I believe, but really, did you think anything called a programming language lacked a emacs mode? :)

Now I will confess to having used notepad++, ZeroBrane Studio, and vim/gvim for my Lua/ESOUI work...

But let's not mix recreation with religions. :p :cool: :D

katkat42 01/11/15 11:38 PM

Quote:

Originally Posted by mctaylor (Post 18198)
There is a Lua mode already. Okay, not in the base distribution I believe, but really, did you think anything called a programming language lacked a emacs mode? :)

Now I will confess to having used notepad++, ZeroBrane Studio, and vim/gvim for my Lua/ESOUI work...

But let's not mix recreation with religions. :p :cool: :D

By the Eight, I hadn't seen that! But in the end, I suppose you're right... :D

timidobserver 01/27/15 05:28 PM

Does anyone have up to date files to add the ESO API into intellisense or a method to create them?

Kelnoreem 02/07/15 01:42 PM

Thanks for doing this, I set it up today and it is working great with IntelliJ 14 Ultimate. Do the API files need to be updated for 1.6 on the PTS?

mikeecrash 03/11/15 02:48 PM

I'm working on updating these to 1.6 and will post to github too.

mikeecrash 03/21/15 01:57 PM

https://github.com/mrheault/eso-api-lua-intellij

I may have missed something so obviously feel free to make pull requests :)

Mishima 03/30/15 10:19 AM

Visual Studio
 
For those of you that are Visual Studio users at work, have you tried VS with BabeLua?

I used it for my one ESO AddOn since I needed to use an IDE on Windows and I normally work on my Ubuntu laptop with Eclipse and Netbeans (for PHP dev). Obviously those work on Windows but I wanted to take the opportunity to try out the VS 2013 Community Edition. Still, I don't know VS well enough to evaluate how well wit works with Lua. Actually I don';t know Lua that well either, but that's less germane to the point.

uladz 04/07/16 01:47 PM

Quote:

Originally Posted by mikeecrash (Post 19820)
https://github.com/mrheault/eso-api-lua-intellij

I may have missed something so obviously feel free to make pull requests :)

Any chance you update it to 100014?

Baertram 11/16/16 12:10 PM

Quote:

Originally Posted by uladz (Post 26666)
Any chance you update it to 100014?

Hi there,

Scripts for the ESODocumentationPxx.txt parser (php based) + description howto_parse are available
here
You need an php.exe (or php for other OSs) file to run the parse scripts!
Instructions what to do when and how are included in a txt file "!!!howTo_parse.txt".


API100017
Just edited the stuff for "IntelliJ + luaJ" editor, for the current API 100017.
You can download it here:
https://dl.dropboxusercontent.com/u/..._API100017.zip

The ESO build in API functions + parameters, constant values, events etc. should be shown in your sources if you include the contents of this ZIP achive like described in the first post + screenshots.
Start to type a variable/function name and press CTRL+SPACE in the editor of lua files to show the auto-completion popup.
If you press CTRL and click the variable/function you'll jump into the relating esoapi file to see som more comments and parameters.

The included XML file is for a manual lookup only as building a schema file for an automatic validation is not worth the effort, sorry.

None of the files claim to be complete or perfect and I won't do this again for the next updates as it takes way too much time :-) Maybe if a script will be build that assist here.

Baertram 12/02/17 04:57 PM

Just updated the API to 100021 for IntelliJ IDEA editor.
Installation:
Go to the "Configure SDK" dialog, click on LuaJ, and add the extracted ZIP archive folder to the classpath.
The lua files will be searched for the functions etc. and you are able to use them in your code afterwards with autocompletion etc.

Baertram 06/03/18 02:07 PM

IntelliJ api support files for the luaJ SDK for ESOUI API 100023.
Some contents are double, some might be missing.
Updated the constant values from teh esoui wiki pages, and used the parser components of "reaby" to build the classes, functions and some other file contents. Thx reaby!

IntelliJ IDEA - luaJ SDK für ESOUI "Summerset" API 100023

Baertram 09/18/18 06:28 AM

IntelliJ API support for ESOU 100025

And here are some parse tools, based on PHP, which are able to parse the ESOUIDocumentationPxx.txt file.
You can use them to parse the txt file for a new API and build your own IntelliJ compatible lua files for autocompletion and lookup of constant values.
An addon "Dumpvars" is included so you can parse the constants from the txt, put the created file into the addon, run the addon and dump the constants + the sound names to the savedvars. Then puzt the result back into lua files for IntelliJ.
-> Credit for the parsing stuff go to "Reaby"! Thanks a lot for your work :banana:

Be sure to read the included howto txt file for more information.
Parse script sphp based for IntelliJ lua file creation + instructions

r4cken 11/29/18 10:18 PM

Great work!
 
Im using this from now on, however im having issues with the eso-api.classes.lua file not showing up at all on autocomplete or intellisense on it :( Any suggestions? The other files seem to be picking up my CTRL+SPACE

raycrios 11/30/18 09:39 AM

Definitely try VSCode with Lua extension. It's MUCH faster than IntelliJ, highly customizable, with a LOT of features and great community. Highly recommended.


Baertram 11/30/18 01:30 PM

Quote:

Originally Posted by r4cken (Post 36546)
Im using this from now on, however im having issues with the eso-api.classes.lua file not showing up at all on autocomplete or intellisense on it :( Any suggestions? The other files seem to be picking up my CTRL+SPACE

CTRL+click does not work as there is missing an entry for each object/class in file eso-api.classes.lua like this
Lua Code:
  1. AddOnManager = {}

This would make IntelliJ find the definition.

But the current file supports the function name help using CTRL+sapce, e.g. type
"AddOnManager."
and then press CTRL+space

r4cken 11/30/18 03:24 PM

I used the latest files from API 100025 but writing AddOnManager brings up nothing at all

Baertram 11/30/18 03:35 PM

Try out "AddOnManager." (with the . at the end) and then CTRL+space.

r4cken 11/30/18 03:40 PM

That brings up nothing as well. I even added each object like AddOnManager = {} at the top of the classes file.

Baertram 11/30/18 04:37 PM

Quote:

Originally Posted by r4cken (Post 36565)
That brings up nothing as well. I even added each object like AddOnManager = {} at the top of the classes file.

Hm, maybe depends on the lua plugin then.
I'm using the current IntelliJ v2018.3 with the "working" lua plugin (EmmyLua) and it brings up the following for me:


Adding the = {} will just make you "navigate to the file" via STRG+left mouse click.

r4cken 11/30/18 04:43 PM

Oh i was not using emmylua, i just searched in the repository for "lua" and installed that just like the start of the thread suggested. Im using the community edition 2018.2.6

So should i not add the "= {}" parts or like another "guide" had it was like

AnimationObjectTranslate = AnimationObject

*EDIT*
It works perfectly now with emmylua! Thank you so much Baertram!

Architecture 12/05/18 01:29 PM

Double tapping shift also can bring up a symbol / workspace search (Or the old fashioned Ctrl+Shift+F). I've found Ctrl + Space usually brings up the autocompletion options where appropriate (I think it depends on if I have full inspection turned on or not). I highly recommend the experience you currently get with IntelliJ and Lua. While it is not perfect (you will definitely be dealing with beta status plugins) I find that it is in general superior to the alternatives.

Cheers,

Baertram 07/21/19 08:07 AM

https://www.esoui.com/downloads/info...Luaplugin.html

Due to the non compatible version of silvanaar with the most up2date IntelliJ Community version 19.1 I had to switch to EmmyLua plugin.
It is working but the auto complete and CTRL+click on functions and variables sometimes does not work properly anymore :(
If anyone got a fix or hint how to het this to work reliably again, I'd be really glad to know it.
Thank you.

Edit:
Due to whatever settings my normal build in LUA plugin for IntelliJ was not updated to the newest version and always shown as not compatible.
I have disabled and chanegd a lot of settings until I saw the "Update" button and now it's up2date again (LUA IntelliJ plugin, version 1.0.117).
Now the CTRL+left click to jump to the declaration works again, but not for the classes like EVENT_MANAGER anymore (mooooh!).
So I reinstaleld EmmyLUA and enabled it, and now the CTRL+CLICK does not work at all anymore. So build in IntelliJ "silvanaar" lua plugins support at least half of the jumpings... And CTRL+SPACE seems to be working with EmmyLUA as well for most of the stuff.
It used to work for all of them though, too bad.

As EmmyLUA seems to be the only working CTRL+SPACE autocomplete lua plugin which is comaptible with the generated ESOUI lua files I'll keep usign this for the moment. Build in "sylvanaar" Lua plugin just works for CTRL+left click for variables in the same files. It's not even jumping to the declaration if it was declared in another file (like it was in the past). But EmmyLUA enither does nro did this in the past (too bad).
Hopefully they will fix this. I'll try to raise a bug for the sylvanaar plugin: https://bitbucket.org/sylvanaar2/lua...ew&status=open

Edit2:
Seems this bug is already known since 2018 but no solved or worked on yet :-(
https://bitbucket.org/sylvanaar2/lua...on-cross-files

Architecture 07/21/19 02:36 PM

Looks like they put out a new version of Lua plugin yesterday. Lame -- will eventually have to see for myself what is up next time I am doing more dev. Thanks for the heads up!

Baertram 07/22/19 04:18 AM

Updated my reply 1 post above. The bug in silvanaar is already known since 2018 but not yet resolved.
Trying to find equal "bug report" in EmmyLUA or raise one :D

Edit:
Raised one as most bugs are in raised Chinese language and I wasn't able to find a similar one:
https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/264

Baertram 05/06/20 05:55 AM

IntelliJ auto completion for ESO - Last update: 2020-10-13
 
Auto completion (and harcoded helper files) for "IntelliJ IDEA"
https://www.esoui.com/downloads/info...Luaplugin.html
Updated: 31st October 2020

DewiMorgan 12/30/20 01:18 PM

Thank you so much!
I've used IntelliJ for PHP and Java at work for the last few years now, and love it.
I didn't even know they had a community version, so that alone made me happy, let alone your work with getting the ESO commands to autocomplete!

Baertram 12/31/20 09:29 AM

You are welcome.

Most current version can be found here:
https://www.esoui.com/downloads/info...Luaplugin.html

To the mass:
I'd be happy if I get any support of others devs here using the parsers after ESO APiversion changes + adding new static / removing obsolete variables to/from the static file.
Maintinign all the addons often does not provide the time to keep these files here updated as well. At least running the PHP the parser scripts on new ESOUIDocumentationxx.txt files, creating the XML json + a quick check if all created files are valid without errors, and the distribution here or even at githubg would be a real help.

I've created a github repo for the parser scripts, and the static file:
IntelliJ ESOUI AutoCompletion

If anyone wants to contribute, send me a request please.
Many thanks

DewiMorgan 01/01/21 12:24 AM

Quote:

Originally Posted by Baertram (Post 42924)
I'd be happy if I get any support of others devs here[...]
If anyone wants to contribute, send me a request please.

Happy to do whatever I can to help, but I'm wondering if there isn't some way in IntelliJ just to point the "libs" folder to an unzipped copy of the source and have it pick up from there, then people could just grab the latest source zipfile from ESOUI without us needing to do any extra work.

Mind you, I've already been briefly futzing with getting that to work today, and had no luck. Whereas, yours works perfectly.

Baertram 01/01/21 07:16 AM

Well, we get the ESOUIDocumentationPxx.txt file where all constants and functions are in.
EmmyLua and no other lua plugin, or even IntelliJ alone, would be able to use this as a source of any API :confused:
We need to extract the data from it and create lua files, or any other supported file, that the EmmyLua (or other lua plugins) are able touse AND find properly in the projects.

I also tried to unzip the source folder but EmmyLua/IntelliJ wa snot able to read all files properly to use the sources from there.
Beside that it was very slow as it had to read all the files, and if a new project was addded it re-scanned all the files each time.

So far the only way I found it is supported is create real lua functions, global variables etc. from the documentation files, and that is what the php parser classes do.

So the manual tasks after each new ESOUIDocumentationPxx.txt we get from ZOs (during PTS releases) will be:
1. Parse the txt file and create the api lua files from it
2. Use addon DumpVars and dump the new global constants, create the the api_globals.lua and api_sounds.lua files from it
3. Update the xml json file
4. Optional: Check differences in lua code and remove non-existing functions from static file eso-api_base_Manual_NonGenerated.lua
5. Optional: heck for new functions/globals you wish to add to file eso-api_base_Manual_NonGenerated.lua
6. Create zip file and release to ESOUI addon https://www.esoui.com/downloads/info...Luaplugin.html

Users can use the zip file then and extract it to their libs folder to use the updated API files.


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

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