# Defold-api-emmylua

**URL:** <https://forum.defold.com/t/defold-api-emmylua/18606>\
**Category:** The Defoldmine\
**Created:** [April 4, 2018, 12:28pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606 "2018-04-04T12:28:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [April 4, 2018, 12:28pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/1 "2018-04-04T12:28:29Z")

</div>

I am a big fun of intellij idea. So i integrate defold api with it.

To use Idea with lua and defold your need.  
1)Install lua plugin. EmmyLua [https://plugins.jetbrains.com/plugin/9768-emmylua](https://plugins.jetbrains.com/plugin/9768-emmylua)  
2)Edit file associations. Press ctrl + shift + a. Then enter command Edit file associations. To lua language add .\*script .\*render\_script .\*gui\_script.  
3)Download defold api library.  
I create a tool that parse defold docs and generate lua files with description.  
You need download zip file [Releases · d954mas/defold-api-emmylua · GitHub](https://github.com/d954mas/defold-api-emmylua/releases)  
4)Add library to your project.  
File/Project structure/libraries/lua zip library.  
5)Use it =)

 ![2018-04-04_15-26-44](https://forum-defold-uploads.b-cdn.net/original/2X/2/25a2513f51700aa9b3f61b1603ef1dce4fff414c.png)  
 ![2018-04-04_15-35-01](https://forum-defold-uploads.b-cdn.net/original/2X/2/2715815de916bb3194cae2c242c16428e3107d92.png)

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [April 4, 2018, 12:42pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/2 "2018-04-04T12:42:12Z")

</div>

This is AWESOME!!! Thank you!

---

<div class="post-metadata">

**Author:** ![pontino](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pontino/32/8125_2.png) [@pontino](https://forum.defold.com/u/pontino)\
**Post date:** [April 4, 2018, 6:06pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/3 "2018-04-04T18:06:37Z")

</div>

Thanks you! Fantastic work!

---

<div class="post-metadata">

**Author:** ![lovebird](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lovebird/32/1953_2.png) [@lovebird](https://forum.defold.com/u/lovebird)\
**Post date:** [April 8, 2018, 1:30am UTC](https://forum.defold.com/t/defold-api-emmylua/18606/4 "2018-04-08T01:30:14Z")

</div>

Emmylua is a very nice lua extension to idea and I use it with defold for a long time.

---

<div class="post-metadata">

**Author:** ![chernikov.i123](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@chernikov.i123](https://forum.defold.com/u/chernikov.i123)\
**Post date:** [April 8, 2018, 11:40am UTC](https://forum.defold.com/t/defold-api-emmylua/18606/5 "2018-04-08T11:40:00Z")

</div>

And how to run and debug project from IDEA?

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [April 8, 2018, 11:45am UTC](https://forum.defold.com/t/defold-api-emmylua/18606/6 "2018-04-08T11:45:52Z")

</div>

No way. We need write plugin for that.

---

<div class="post-metadata">

**Author:** ![chernikov.i123](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@chernikov.i123](https://forum.defold.com/u/chernikov.i123)\
**Post date:** [April 8, 2018, 11:57am UTC](https://forum.defold.com/t/defold-api-emmylua/18606/7 "2018-04-08T11:57:32Z")

</div>

@d954mas is there any way to set defold editor automatically reload file if it was changed in another program like idea does?

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [April 8, 2018, 12:01pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/8 "2018-04-08T12:01:33Z")

</div>

i write scripts, only in idea. Then run game from defold editor. I don’t edit script from defold and from IDEA in same time. If editor not automaticaly reload file, you should make issue for that.

---

<div class="post-metadata">

**Author:** ![onnlinne](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/onnlinne/32/8182_2.png) [@onnlinne](https://forum.defold.com/u/onnlinne)\
**Post date:** [April 8, 2018, 5:54pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/9 "2018-04-08T17:54:06Z")

</div>

is it possible to use this in zerobrane ?

---

<div class="post-metadata">

**Author:** ![iovorobiev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/iovorobiev/32/6755_2.png) [@iovorobiev](https://forum.defold.com/u/iovorobiev)\
**Post date:** [April 10, 2018, 2:06pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/10 "2018-04-10T14:06:29Z")

</div>

Is there any way to add a warning about using global variables in IDEA? The only thing that I found about it is this issue [Add global variable inspections · Issue #127 · EmmyLua/IntelliJ-EmmyLua · GitHub](https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/127) but it’s in Chinese and according to google translate EmmyLua doesn’t support it for now ☹

---

<div class="post-metadata">

**Author:** ![dakasha](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@dakasha](https://forum.defold.com/u/dakasha)\
**Post date:** [April 10, 2018, 7:14pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/11 "2018-04-10T19:14:20Z")

</div>

> [@iovorobiev](#):
>
> Is there any way to add a warning about using global variables in IDEA? The only thing that I found about it is this issue [Add global variable inspections · Issue #127 · EmmyLua/IntelliJ-EmmyLua · GitHub](https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/127) but it’s in Chinese and according to google translate EmmyLua doesn’t support it for now ☹

It has luacheck support. Rightclick your code and hit use luacheck. Itll open a prompt and ask you to point towards the luacheck exe

---

<div class="post-metadata">

**Author:** ![dakasha](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@dakasha](https://forum.defold.com/u/dakasha)\
**Post date:** [April 10, 2018, 7:34pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/12 "2018-04-10T19:34:51Z")

</div>

> [@iovorobiev](#):
>
> Is there any way to add a warning about using global variables in IDEA? The only thing that I found about it is this issue [Add global variable inspections · Issue #127 · EmmyLua/IntelliJ-EmmyLua · GitHub](https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/127) but it’s in Chinese and according to google translate EmmyLua doesn’t support it for now ☹

Actually you can even set it as an option. Hit ctrl + alt + s, go to editor/inspections/lua “global name can be local”

---

<div class="post-metadata">

**Author:** ![iovorobiev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/iovorobiev/32/6755_2.png) [@iovorobiev](https://forum.defold.com/u/iovorobiev)\
**Post date:** [April 10, 2018, 11:46pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/13 "2018-04-10T23:46:02Z")

</div>

This one is just what I’ve looked for, thanks!

---

<div class="post-metadata">

**Author:** ![dakasha](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@dakasha](https://forum.defold.com/u/dakasha)\
**Post date:** [April 11, 2018, 9:23am UTC](https://forum.defold.com/t/defold-api-emmylua/18606/14 "2018-04-11T09:23:42Z")

</div>

How do i remove the upvalue underlining? its really distracting

edit: of course i ended up finding it right after asking (its under syntax highlighting)

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [June 17, 2018, 11:02am UTC](https://forum.defold.com/t/defold-api-emmylua/18606/15 "2018-06-17T11:02:30Z")

</div>

Update:  
1)fixed return value in api headers

```lua
 ---Creates a new zero vector with all components set to 0.
- ---@return v vector3 new zero vector
+ ---@return vector3 new zero vector
 function vmath.vector3() end

```

2)add headers for vector3/vector4

3)update api to version 1.2.129

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [June 29, 2018, 11:03pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/16 "2018-06-29T23:03:05Z")

</div>

Update:  
1)fix gui autocompile(replace - to \_)

```lua
---@param line-break boolean true or false
function gui.set_line_break(node, line-break) end

```

2)fix luasocket autocompile (“\*” as name)

```lua
---@param "*" string if address is "*"" and the object is connected, the peer association is removed and 
function connected:setpeername("*") end

```

3)Add timer autocomplite.(i add it by myself. Please add timer doc to docs @sven )  
4)make class global. Idea will now autocomplite sprite, spine and etc. Before it autocomplite only their functions  
5)Add jar and instruction to generate headers @AGulev

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [September 22, 2018, 8:02pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/17 "2018-09-22T20:02:19Z")

</div>

Update:  
1)update api to version 1.2.136  
2)timer api from from timer\_doc.json

No more than 3 consecutive replies are allowed. Please edit your previous reply instead, or wait for someone to reply to you. LOL=) So update prev post.

Update:  
1)update api to version 1.2.143  
2)autocomplete returned tables(sys.get\_sys\_info() … )  
3)autocomplete url fields(socket, path, fragment)  
4)Add this project to asset page. [https://www.defold.com/community/projects/128566/](https://www.defold.com/community/projects/128566/)

 ![2018-12-05_22-59-46](https://forum-defold-uploads.b-cdn.net/original/2X/e/e977a30f9054b28161052ec8d96e8b6b0f7770e8.png)

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [August 25, 2019, 1:11pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/18 "2019-08-25T13:11:57Z")

</div>

Update:  
1)update api to version 1.2.160

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [October 7, 2019, 9:05pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/19 "2019-10-07T21:05:46Z")

</div>

Update:  
1)update api to version 1.2.163

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [June 20, 2020, 4:46pm UTC](https://forum.defold.com/t/defold-api-emmylua/18606/20 "2020-06-20T16:46:54Z")

</div>

Update:  
1)update api to version 1.2.169

[Next page](https://forum.defold.com/t/defold-api-emmylua/18606.md?page=2)
