Intellij idea autocomplete


#1

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
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 from https://github.com/d954mas/IntelliJ-Defold-Api/releases.
4)Add library to your project.
File/Project structure/libraries/lua zip library.
5)Use it =)
2018-04-04_15-26-44


#2

This is AWESOME!!! Thank you!


#3

Thanks you! Fantastic work!


#4

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


#5

And how to run and debug project from IDEA?


#6

No way. We need write plugin for that.


#7

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


#8

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.


#9

is it possible to use this in zerobrane ?


#10

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


#11

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


#12

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


#13

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


#14

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)


#15

Update:
1)fixed return value in api headers

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


#16

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

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

2)fix luasocket autocompile ("*" as name)

---@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


#17

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/

2018-12-05_22-59-46