Defold-api-emmylua

Update:
1)update api to version 1.2.180
2)Add some base classes and aliases
3)The doc format was change. So make fixes to parser worked with updated defold doc format

---@class quaternion
---@field x number
---@field y number
---@field z number
---@field w number

---@alias quat quaternion

---@alias hash userdata
---@alias constant userdata
---@alias bool boolean
---@alias float number
---@alias object userdata
---@alias matrix4 userdata
---@alias node userdata

--mb use number instead of vector4
---@alias vector vector4

--luasocket
---@alias master userdata
---@alias unconnected userdata
---@alias client userdata

--render
---@alias constant_buffer userdata
---@alias render_target userdata
---@alias predicate userdata
4 Likes

While updating my parser. I found some errors in doc.
Please look at them. @britzl

1)No type in types
function gui.get_flipbook_cursor) end  
2)No type in types
function gui.get_spine_cursor(node) end

  "returnvalues": [
        {
          "doc": "value <span class=\"type\">number</span> cursor value", 
          "name": "cursor", 
          "types": [
            ""
          ]
        }
      ], 


3)No method
function model.reset_constant(url, constant) end

4)No method
function model.set_constant(url, constant, value) end

5)No method
function sprite.reset_constant(url, constant) end

6)No method
function sprite.set_constant(url, constant, value) end


7)No type in types for frequency in doc
function sys.set_update_frequency(frequency) end

8)No type in types for swap_interval in doc
function sys.set_vsync_swap_interval(swap_interval) end

9)bad type(type:vector4 instead of vector4)
 "types": [
            "vector3", 
            "type:vector4"
          ]

function vmath.matrix4_translation(position) end


10)No types for all elements in timed_doc.json.
5 Likes

Thank you for reporting them! I’ve prepared a PR: Added missing API docs by britzl · Pull Request #5721 · defold/defold · GitHub

Note that the set_constant functions are deprecated. We recommend that you use go.set() and go.get() instead.

2 Likes

Thanks.:+1:

Thanks) I do not know that))

Update:
1)update api to version 1.2.181
2)remove global table builtins(api not need it)

4 Likes

Update:
1)update api to version 1.2.184
2)Rename asset from IntelliJ-Defold-Api to Defold-api-emmylua.

1 Like

Also add link to patreon in repository.

You can support me:) :hugs:

1 Like

First!

2 Likes

:partying_face:

Update:
1)update api to version 1.3.0

5 Likes

This doesn’t seem to include the defold ‘buffer’ API.

VS Code flags ‘buffer’ as “Undefined global”

How could I add it?

Thanks

1 Like

Thanks. Api was missed:)
I fix it and update release.

5 Likes

Hey @d954mas thank for such helpful plugin! But unfortunatly I cannot make it work on Mac m2 and IDEA 232. Could you please advise on troubleshooting steps?

Hi. Plugin have issue in new version of idea.

https://github.com/EmmyLua/IntelliJ-EmmyLua/issues/555

For now you need to use older version of idea(

2 Likes

Thanks for the prompt reply!

@d954mas looks like smth on my side … because with 223 it doesn’t work for me too… Any ideas what I can check to make it work? Api zip added, file associations updated…

I see you use new idea.

You need old idea.

I use 2022.3.3

I’m using 223 too… : (

oh same idea and same plugin, but for me it worked
No idea(

Mb disable new UI?

not working even new UI disabled.