Quantcast
Download
(479 Kb)
Download
Updated: 06/21/20 04:24 PM
Compatibility:
Greymoor (6.0.5)
Updated:06/21/20 04:24 PM
Created:06/03/20 11:59 AM
Monthly downloads:23
Total downloads:157
Favorites:5
MD5:
ESOUI lua API autocompletion for JetBrains IntelliJ IDEA IDE (EmmyLua plugin)
Version: 100031_3
by: Baertram [More]
ESOUI lua API autocompletion for "JetBrains IntelliJ IDEA" IDE - using the "EmmyLua" plugin

This is a description how to enable the ESOUI lua API autocompletion for the developer IDE "IntelliJ IDEA" by JetBrains, using the plugin "EmmyLua".
I also provide the esoui API autocompletion files as ZIP archive here, which you need to download and extract somewhere on your harddrive to a folder that will not change, and can be used within IntelliJ IDEA settings as standard "external libraries" for your lua file related projects.



Prerequisites:
a) You need to install JetBrains IntelliJ IDEA (https://www.jetbrains.com/idea/) version 2019 or newer.
The type of the edition does not matter (community, education, ultimate, etc.).
Just follow the instructions of the website and the installer and install the software properly.
Start and configure it to your needs at the menu "File" -> "Settings" e.g.

b) You need to install the plugin "EmmyLUA" (https://plugins.jetbrains.com/plugin/9768-emmylua) inside the IntelliJ IDEA.
It will provide lua script support for variables, code checks and enable the auto completion file usage and variable declaration "jumpto" via CTRL+<left mouse click> e.g. via own created lua files in your project structure and external libraries.

You can either use the IntellIj IDEA plugin manager or install it manually.
Here is an installation description, for both ways, by the plugin creators: https://emmylua.github.io/installation.html

And this is my description:
b1: Start IntelliJ IDEA and open the menu "File"- > "Settings" -> "Plugins" -> Search for "EmmyLua" in the search input box at the top.
If you find more than 1 result: The author of the correct plugin is "tangzx".


b2: Click on the "Install" button at the line of the "EmmyLua" plugin. Follow the information shown in the popus and dialogs of the plugin manager.

b2 - alternative: You might also download the plugin via the plugin's website manually, using the "Get" button there.
Please refer to manual plugin installation within IntelliJ IDEA's documentation for plugins (https://www.jetbrains.com/help/idea/plugins-settings.html) and look for "Install Plugin from Disk".

b3: After the installation restart the IDE and invalidate the cache via menu "File" -> "Invalidates caches / restarts"!

b4: After the IntelliJ IDEA IDE was restarted open the settings once again via menu "File" -> "Settings" and navigate to the "Languages and Frameworks" category, where you choose the new shown entry "EmmyLua".
Change the lua version used to 5.1 as ESO only internally uses a ZOs changed lua 5.1!

Save the changes to the EmmyLua settings afterwards via the "Apply" button at the settings dialog.



HowTo enable the auto completion within IntelliJ IDEA IDE:

This list below shows the steps to take to enable the auto completion in the IntelliJ IDE.
If step description texts are related to other steps the "<relating step number>)" tag will be shown in italic style inside the description text of the step ( e.g. 2) ) .
If step description texts are related to a number shown inside an image, the "image<Imagenumber>[<numberShownInThisImage>]" tag will be shown in italic style inside the description text of the step ( e.g. image1[2]) )
  1. Download the ZIP archive for the needed ESOUI APIversion from this website here (see download link or "Other files" for older versions).
  2. Extract the ZIP archive to a folder which will not change, and where you are able to link to from within IntelliJ IDEA settings. In the further description here this folder where you have extracted the ZIP file contents to will be refered to as "ESOUI API autoCompletion files".
  3. Start IntelliJ.
  4. You need to close all open projects first via the menu "File" -> "Close project".
    If any other IntelliJ IDEA window is opened close the projects there as well until you get the "Welcome to IntelliJ IDEA" project selection dialog shown.
    Click on the gear icon "Configure" button at the bottom right and choose "Structure for new projects" context menu entry.
  5. The project structure dialog will be shown where you are able to configure the structure of new projects.
    Image1
  6. Click on Platform settings -> SDK image1[1]
    Then click on the + image1[2] and add a new SDK with a chosen name like "ESOUI lua" as description image1[3]
    Click on the + image1[4] to add a folder where you have extracted the "ESOUI API autoCompletion files" at step 2).
    The selected folder will show in the list at image1[5] afterwards.
  7. Save the project structure and you are able to open your lua AddOns with IntelliJ and use this project structure "ESOUI lua" on them.
  8. You need to use the new created "ESOUI lua" project structure for your lua projects then in order to make the auto completion work.
    Your new projects contain a subfolder "External Libraries" where you are able to see the ESOUI API files and folders then:
  9. Existing projects will not automatically update their structure! You might either need to rebuild the projects by creating them new in the same folders and if the dialog asks you if exisitng project files should be overwritten accept it. Or you need to manually change the project structure files OF EACH project by opening it and selecting menu "File" -> "Project structure". Then choose/Add the SDK like described above for the project.


Running lua code within IntelliJ IDEA IDE:
First of all: ESOUI source code is NOT running offline in your IntelliJ IDEA IDE! You MUST be logged in and try the addons and code ingame.
There is no way to test ESOUI related source code just in your IDE.
You can try your non ESOUI related scripts offline in a normal lua environment though (like testing if a standard string function works etc.) but you cannot use ANY of the Zos added functions like d() etc. You MUST use standard functions like print then.

If you want to run lua code within IntelliJ you can read here how to setup the configurations and templates:

https://www.jetbrains.com/help/idea/2020.1/run-debug-configurations-dialog.html?utm_campaign=IU&utm_content=2020.1&utm_medium=link&utm_source=product

You need a lua.exe of the desired lua version (ESO is using 5.1) installed somewhere.
Download lua 5.1 exe binaries here: https://sourceforge.net/projects/luabinaries/files/5.1.4/
In the IntelliJ IDEA menu "Run" -> "Edit configurations" you can configure how and where the lua.exe file is located that should be used to run your scripts.

You need to expand the category "Templates" and choose the entry "Lua Application".
At the right side you are able to change the program path of the lua.exe file and some other parameters like the working directory (OBLIGATORY, e..g use your project's folder).
After you have setup everything click at the top right on the link "Create configuration" and your template will be added to the list of "Lua Application" at the left side:


It will use this template config then for any Lua Application "Run" in the future.
Unfortunately it will NOT pass in the currently run filename's path and filename (e.g. "test.lua", see below) as parameter "Entry file".
So the lua.exe will just run but nothing is passed to it
I'd mark the checkbox "Show this dialog" in your saved Lua application template so you can enter the run directory (= your project dir) and the "Entry file" (= your .lua file) there then as you run it.

I've e.g. added a new lua file "test.lua" to my project and added a standard lua print("hey!") command to it:

The green triangle run button is available and if I press it the lua5.1.exe file will compile it.

After this it will be able to run your lua code via the selected lua.exe file:



XML auto completion for keybindings and normal ESOUI XML files
Sirinsidiator created XSD files for the ESOUI XML files. Here is the link to siri's description:
https://sir.insidi.at/or/2018/07/10/...i-xml/#more-39

And the link to the XSD files for keybinds and normal xml within esoui:
http://sir.insidi.at/or/schema/esobindings.xsd
http://sir.insidi.at/or/schema/esoui.xsd

In your XML files's head line you need to chnage this to make the autocompletion work:
Code:
<GuiXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sir.insidi.at/or/schema/esoui.xsd">
Or for keybindings:
Code:
<Bindings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sir.insidi.at/or/schema/esobindings.xsd">
Within IntelliJ IDEA you can add the XSD files like described in the documentation:
https://www.jetbrains.com/help/idea/...-and-dtds.html


Troubleshooting:
  • Invalidate caches and restart: If anything is not working as intended try to use the menu "File" -> "Invalide caches / restart" to restart the IntelliJ IDEA IDE and clear the caches. This fixes most of the problems like not working auto completions etc.
100031_3 (2020-06-22)
-Updated some functions and objects like Chat
-Updated a few missing events about reticles

100031_2 (2020-06-12)
Updated the file "eso-api_base_Manual_NonGenerated.lua" with some of of the global ZOs "classes" and function names (ZOs libraris etc.).
Optional Files (0)


Archived Files (2)
File Name
Version
Size
Uploader
Date
100031_2
478kB
Baertram
06/11/20 10:05 PM
100031
451kB
06/03/20 11:59 AM


Post A Reply Comment Options
Unread 06/12/20, 03:16 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3088
File comments: 3714
Uploads: 63
Nope, not in this tool. The json and xml are for manual lookup.

But sirinsidiator added it on his website.
Check the other dev tools here on esoui.
https://www.esoui.com/downloads/info...ocomplete.html

You can add the xlst files to intellij xml validator entries in the settings.
And there is one line to set in the xml files as well, have it somewhere, can at it later here.

Here is the link to siri's description:
https://sir.insidi.at/or/2018/07/10/schema-definition-for-esoui-xml/#more-39

And the link to the xlst files for keybinds and normal xml within esoui:
http://sir.insidi.at/or/schema/esobindings.xsd
http://sir.insidi.at/or/schema/esoui.xsd

In the XML files's head line you need to add this to make the autocompletion work:
Code:
<GuiXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sir.insidi.at/or/schema/esoui.xsd">
Or for keybindings:
Code:
<Bindings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sir.insidi.at/or/schema/esobindings.xsd">
Last edited by Baertram : 06/13/20 at 06:24 AM.
Report comment to moderator  
Reply With Quote
Unread 06/12/20, 02:51 PM  
QuantumPie
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 4
Uploads: 1
Is there XML auto completion by chance? I noticed the json and js file and copied it over but that didn't do anything.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: