# Full autocomplete Defold API for Sublime Text 3

**URL:** <https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910>\
**Category:** The Defoldmine\
**Created:** [August 23, 2017, 3:30pm UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910 "2017-08-23T15:30:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarnumius](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@tarnumius](https://forum.defold.com/u/tarnumius)\
**Post date:** [August 23, 2017, 3:30pm UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910/1 "2017-08-23T15:30:08Z")

</div>

Hello all!

I use Sublime Text 3 as external editor for Lua code. After sometime use I created for Sublime Text 3 with LuaExtended plugin full autocomplete for Defold API.

For use you need Sublime Text 3 with LuaExtended Plugin  
[Sublime Text 3 - Sublime Text](http://www.sublimetext.com/3) - Sublime  
[LuaExtended - Packages - Package Control](https://packagecontrol.io/packages/LuaExtended) - plugin

After install Sublime and Plugin you need replace LuaExtended.sublime-package(for windows this packege located in \AppData\Roaming) my version.

Link for download modified packege - [Dropbox - Error - Simplify your life](https://www.dropbox.com/s/ijtxet59hfhf2r9/LuaExtended.sublime-package?dl=0) (Plugin under MIT license)

After start Sublime you can use Defold API autocomplete.

For good work with Defold LUA scripts you need in Sublime goto “View menu-\>Syntax-\>Open all with current extension as …” and select LuaExtended for .script and .gui\_script files!

Due to the limitations of the plugin you need to type commands with “\_”, but not to the “.”. For example, to use the functions GameObjects, you need to start typing go\_, then you see a list of all available functions for working with GameObjects (go\_get\_position for example). After you select need function, you press Enter and see right function format(for our example go.get\_position([id])).

All start prefix same from API Defold documentation (crash,gui, go,sys,profiler,render,resource,sys,window,collectionfactory,collectionproxy,physics,factory,label,model,particlefx,sound,spine,sprite,tilemap,buffer,hash,html5,image,json,msg,vmath,zlib,facebook,iap,iac,push and webview)

I make special addons for standart messages. For example you enter go\_msg\_enable and after press enter you see msg.post(‘#my\_component’, ‘enable’). If message sent back you receive only message. For example you enter “collectionproxy\_proxy\_loaded” and receieve “proxy\_loaded”

All macros for messages:  
gui\_layout\_changed post layout\_changed  
go\_msg\_acquire\_input\_focus post msg.post(‘#my\_component’, ‘acquire\_input\_focus’)  
go\_msg\_disable post msg.post(‘#my\_component’, ‘disable’)  
go\_msg\_enable post msg.post(‘#my\_component’, ‘enable’)  
go\_msg\_release\_input\_focus post msg.post(‘#my\_component’, ‘release\_input\_focus’)  
go\_msg\_set\_parent post msg.post(‘#my\_component’, ‘set\_parent’, {parent\_id=…, keep\_world\_transform=… })  
render\_clear\_color post msg.post(‘@render:’, ‘clear\_color’, { color = vmath.vector4(r, g, b, a) } )  
render\_draw\_line post msg.post(‘@render:’, ‘draw\_line’, { start\_point = vmath.vector3(x, y, z), end\_point = vmath.vector3(x, y, z), color = vmath.vector4(r, g, b, a) } )  
render\_draw\_text post msg.post(‘@render:’, ‘draw\_text’, { text = … , position = vmath.vector3(x, y, z) } )  
render\_window\_resized post window\_resized  
sys\_msg\_exit post msg.post(‘@system:’, ‘exit’, {code = 0})  
sys\_msg\_reboot post msg.post(‘@system:’, ‘reboot’, {arg1 = .., arg2 = .., arg3=…, arg4=…, arg5=…, arg6=… )  
sys\_msg\_set\_update\_frequency post msg.post(‘@system:’, ‘set\_update\_frequency’, { frequency = 60 } )  
sys\_msg\_start\_record post msg.post(‘@system:’, ‘start\_record’, { file\_name = …, frame\_period = …, fps = … } )  
sys\_msg\_stop\_record post msg.post(‘@system:’, ‘stop\_record’)  
sys\_toggle\_physics\_debug post msg.post(‘@system:’, ‘toggle\_physics\_debug’)  
sys\_msg\_toggle\_profile post msg.post(‘@system:’, ‘toggle\_profile’)  
camera\_acquire\_camera\_focus post msg.post(‘#camera’, ‘acquire\_camera\_focus’)  
camera\_release\_camera\_focus post msg.post(‘#camera’, ‘release\_camera\_focus’)  
camera\_set\_camera post msg.post(‘#camera’, ‘set\_camera’, {aspect\_ratio = …, fov = …, near\_z = …, far\_z = …})  
collectionproxy\_async\_load post msg.post(‘#proxy’, ‘async\_load’)  
collectionproxy\_disable post msg.post(‘#proxy’, ‘disable’)  
collectionproxy\_enable post msg.post(‘#proxy’, ‘enable’)  
collectionproxy\_final post msg.post(‘#proxy’, ‘final’)  
collectionproxy\_init post msg.post(‘#proxy’, ‘init’)  
collectionproxy\_load post msg.post(‘#proxy’, ‘load’)  
collectionproxy\_proxy\_loaded post proxy\_loaded  
collectionproxy\_proxy\_unloaded post proxy\_unloaded  
collectionproxy\_set\_time\_step post msg.post(‘#proxy’, ‘set\_time\_step’, {factor = …, mode = …})  
collectionproxy\_unload post msg.post(‘#proxy’, ‘unload’)  
collobj\_apply\_force post msg.post(‘#co’, ‘apply\_force’, {force = vmath.vector3(x, y, z), position = vmath.vector3(x, y, z)})  
collobj\_collision\_response post collision\_response  
collobj\_contact\_point\_response post contact\_point\_response  
collobj\_ray\_cast\_response post ray\_cast\_response  
collobj\_trigger\_response post trigger\_response  
model\_animation\_done post model\_animation\_done  
sound\_play\_sound post msg.post(‘#sound’, ‘play\_sound’, {delay = 0, gain = 1})  
sound\_set\_gain post msg.post(‘#sound’, ‘set\_gain’, {gain = 1})  
sound\_stop\_sound post msg.post(‘#sound’, ‘stop\_sound’)  
spine\_animation\_done post spine\_animation\_done  
spine\_event post spine\_event  
sprite\_animation\_done post animation\_done  
sprite\_play\_animation post msg.post(‘#sprite’, ‘play\_animation’, {id = hash(‘jump’)})

PS: I patched BracketHighlighter plugin for correct select If end, for end and etc blocks for LuaExtended(plugin under MIT License too)

Install by same path about install LuaExtended  
Link to original version - [BracketHighlighter - Packages - Package Control](https://packagecontrol.io/packages/BracketHighlighter)  
Link to patched version - [Dropbox - Error - Simplify your life](https://www.dropbox.com/s/hnvmdtdwr070itl/BracketHighlighter.sublime-package?dl=0)  
PPS: Sorry for my bad English and I hope my work help someone

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [August 24, 2017, 5:17am UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910/2 "2017-08-24T05:17:46Z")

</div>

Thank you for sharing your work! I prefer Atom myself, but I have some colleagues that swear by Sublime instead. Ain’t that right @Adam_Westman?

---

<div class="post-metadata">

**Author:** ![Adam\_Westman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/adam_westman/32/46_2.png) [@Adam\_Westman](https://forum.defold.com/u/Adam_Westman)\
**Post date:** [August 24, 2017, 6:54am UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910/3 "2017-08-24T06:54:16Z")

</div>

Looks great! Yeah when spanning over multiple code bases Sublime vs Atom is not a question anymore, the ability to join together projects and search them all in a matter of milliseconds is far too valuable 🙂

---

<div class="post-metadata">

**Author:** ![tarnumius](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@tarnumius](https://forum.defold.com/u/tarnumius)\
**Post date:** [August 25, 2017, 8:10am UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910/4 "2017-08-25T08:10:37Z")

</div>

Uploaded new version. Small fix for functions with more when 2 params

---

<div class="post-metadata">

**Author:** ![Dragosha](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dragosha/32/5103_2.png) [@Dragosha](https://forum.defold.com/u/Dragosha)\
**Post date:** [February 1, 2019, 12:27pm UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910/5 "2019-02-01T12:27:32Z")

</div>

I’ve a bit updated this useful package here: [GitHub - Dragosha/LuaExtended: An improved ST3 Lua syntax definition + Defold Engine API. · GitHub](https://github.com/Dragosha/LuaExtended)

- Forked from most newest version of that package what I found.
- Added: GUI and GO CONSTANTS, timer, spine\_slots
- Added: Defenitions for **Flow.lua** module ([ludobits/ludobits/m/flow.lua at master · britzl/ludobits · GitHub](https://github.com/britzl/ludobits/blob/master/ludobits/m/flow.lua))
- Zipped version ‘LuaExtended.sublime-package’ for quick replace old one at C:\Users\USERNAME\AppData\Roaming\Sublime Text 3\Installed Packages

---

<div class="post-metadata">

**Author:** ![Ahmutkadim](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ahmutkadim/32/33104_2.png) [@Ahmutkadim](https://forum.defold.com/u/Ahmutkadim)\
**Post date:** [July 5, 2024, 6:23pm UTC](https://forum.defold.com/t/full-autocomplete-defold-api-for-sublime-text-3/10910/6 "2024-07-05T18:23:40Z")

</div>

Thanks for the extension! Next time pls check the readme, I lost a day figuring out that the original package in sublime package repo does not have any Defold api. Is there a way to make luacheck read lib dependancies?
