VSCode extensions for Defold (aka Defold Extension Pack)

This extension pack is a collection of popular extensions for Defold. The pack was based on the guide how to turn VSCode into Defold IDE with debugger.

Defold Extension Pack

What’s in the pack:

  • Defold Buddy - a collection of tools for Defold projects
  • Lua - for Lua syntax highlight and linting
  • Shader Languages Support - syntax highlighter for shader languages (hlsl, glsl, cg)
  • GLSL Lint - linting of OpenGL shading language
  • Lua Format - Lua code formatter
  • TextProto - Protocol Buffer syntax highlighting for .go, .gui, .collection files

Defold Buddy

Features:

IntelliSense for Defold API

Demo gif

IntelliSense for project dependencies

Autocompletion for Defold URLs in .script files

Note: read about the addressing if you are not familiar with the concept.

Run "Project > Build" from VSCode (requires Defold editor opened in background)

Note: you can set a hotkey for this command as well as for any other command

Hot reloading when .script and .lua files are saved

Create `.go` + `.script` + `.factory` files from Explorer context menu

Generate manifest (reduce game bundle size)

You can generate the app manifest from Defold editor:

Or from VSCode:

Feedback is very much welcome. Feel free to create a feature request or report an issue on Github.

Other

Luna Paint - Edit images in VSCode to quickly create prototype game assets

14 Likes

It would be great to add debugging. I read that mobdebug is used in the Editor and there is a VS Code extension for it. If anyone knows and can explain how to use it with Defold then it should be possible to add debug settings into one of the above extensions.

And it would be even better to start the project directly in Editor from VSCode (not via Bob because it didn’t work for me when I tried it in one of the existing extensions).

2 Likes

This is something we will look into. I can’t say when though. We have a few performance related tasks that we are currently focusing on.

I need to look up the details. I’ll share here later today.

3 Likes

Wow! Thank you @mikatuo ! :heart:

Btw. Is there any request for something like this:

to implement e.g. in game.project settings? That would be a great feature! I know Defold App Manifest generator, but if it would be a part of Editor it would be a blast!

3 Likes

The long term plan is for us to have it configurable in the editor yes (with more features), but for now the online tool is doing the job well enough.

3 Likes

Thank you! No rush. Once it’s ready I will add it into the extension.

Online manifest generator is great! Since it’s JavaScript it was super easy to add it.

It is part of the editor now? @vlaaad added support for it a few months ago:

11 Likes

Yes, I totally missed it!

5 Likes

Indeed, I ported manifestation web tool into the editor :slight_smile:

20 Likes

That is fantastic!

Experimenting with more interesting stuff. Generating hashes for instances and components for all .collection files. It doesn’t include components for referenced instances yet.

Demo

5 Likes

v.0.6.2 - Added autocompletion for url-s inside .script files:

Demo

9 Likes

The debugger is started by the editor when start.lua script is loaded and run in the engine. The script is sent as a RunScript protobuf message to the running engine to the /post endpoint on the engine service.

2 Likes

Thank you! And this readme DEBUG_PORTS_AND_SERVICES.md also helped a lot.

Can’t get it to work yet, but at least it doesn’t crash when I post a reload message. Will need to dig more into it.
image

Let us know if you get stuck!

1 Like

v 0.7.2 - Create .go + .script + .factory files from the Explorer’s context menu

Demo

6 Likes

Added intellisense for project dependencies.

Demo

9 Likes

Great feature!
I found in some extensions, when calling a function, “:” is used instead of “.” , like “room:send()”, but the intellisense always uses “.” :
image
image

1 Like

Nice that you are using the plugin))
I can have a look. What was the extension? It might be that EmmyLua annotations are required to correctly identify “:” vs “.”

The extension is Colyseus-Defold and the annotations are written by myself. :grinning:
image

3 Likes