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! |
Corrected your typo in the title (in sylv's name). ;)
I remember when he made that for WoW... |
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. |
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.) |
Quote:
|
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) |
Thanks Tinuviel, thats helpful!
@Iyanga: What IDE do you use? |
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++. |
<3 Notepad++
|
Quote:
Quote:
IntelliJ + ESO Lua looks interesting though, might have to use it for the next project. Thanks for the tip :) |
Nobody use good old Notepad anymore? :)
Gonna test this with VS. Hopefully it works in 2010. |
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. |
Quote:
|
Quote:
Best thing ever. |
Nice find! Whilst Notepad++ is pretty good, I've been using Ultra Edit for around 15 years. ;)
|
Quote:
And fast... Its great to use it to when you want to edit HUUUUUUUUUUUGE files since it handles those quite nicely :) |
Quote:
|
Quote:
Thanks for the tip. |
Quote:
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 :) |
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. |
Thanks
Thanks very much for providing this. It's been most helpful!
|
vi
Tried, trusted, and true... I find the compiler does a pretty damned good job of showing errors. |
Quote:
|
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.
|
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:
Once again, thanks. I should keep digging around... |
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, |
Quote:
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 |
Quote:
|
Does anyone have up to date files to add the ESO API into intellisense or a method to create them?
|
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?
|
I'm working on updating these to 1.6 and will post to github too.
|
https://github.com/mrheault/eso-api-lua-intellij
I may have missed something so obviously feel free to make pull requests :) |
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. |
Quote:
|
Quote:
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. |
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. |
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 |
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 |
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
|
Definitely try VSCode with Lua extension. It's MUCH faster than IntelliJ, highly customizable, with a LOT of features and great community. Highly recommended.
|
Quote:
Lua Code:
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 |
I used the latest files from API 100025 but writing AddOnManager brings up nothing at all
|
Try out "AddOnManager." (with the . at the end) and then CTRL+space.
|
That brings up nothing as well. I even added each object like AddOnManager = {} at the top of the classes file.
|
Quote:
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. |
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! |
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, |
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 |
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!
|
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 |
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 |
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! |
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 |
Quote:
Mind you, I've already been briefly futzing with getting that to work today, and had no luck. Whereas, yours works perfectly. |
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:13 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI