{"id":15722620,"url":"https://github.com/astrochili/vscode-defold","last_synced_at":"2025-04-04T14:04:27.094Z","repository":{"id":40584981,"uuid":"353123858","full_name":"astrochili/vscode-defold","owner":"astrochili","description":"A toolkit for Visual Studio Code to develop games with Defold","archived":false,"fork":false,"pushed_at":"2025-01-26T07:38:08.000Z","size":1052,"stargazers_count":186,"open_issues_count":10,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T13:06:19.182Z","etag":null,"topics":["debugger","defold","lua","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=astronachos.defold","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrochili.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-30T19:51:03.000Z","updated_at":"2025-03-20T08:17:34.000Z","dependencies_parsed_at":"2023-09-18T23:23:33.533Z","dependency_job_id":"b0e4d1c9-1697-4ef9-8bbb-b5366376c2d3","html_url":"https://github.com/astrochili/vscode-defold","commit_stats":null,"previous_names":["astrochili/defold-vscode-guide"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fvscode-defold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fvscode-defold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fvscode-defold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fvscode-defold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrochili","download_url":"https://codeload.github.com/astrochili/vscode-defold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190163,"owners_count":20898697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugger","defold","lua","vscode","vscode-extension"],"created_at":"2024-10-03T22:08:39.411Z","updated_at":"2025-04-04T14:04:27.078Z","avatar_url":"https://github.com/astrochili.png","language":"TypeScript","funding_links":["https://buymeacoffee.com/astrochili"],"categories":["Tools"],"sub_categories":["Code Editor"],"readme":"![logo](https://github.com/astrochili/defold-trenchbroom/assets/4752473/ab6e5282-dd37-4586-bcab-c1ac83cf1a9f)\n\n# Defold Kit\n\n[![Version](https://img.shields.io/visual-studio-marketplace/v/astronachos.defold)](https://marketplace.visualstudio.com/items?itemName=astronachos.defold)\n[![MIT License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/astrochili/vscode-defold/blob/master/LICENSE)\n[![Website](https://img.shields.io/badge/website-gray.svg?\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxNiIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDE4IDE2Ij48Y2lyY2xlIGN4PSIzLjY2IiBjeT0iMTQuNzUiIHI9IjEuMjUiIGZpbGw9InVybCgjYSkiLz48Y2lyY2xlIGN4PSI4LjY2IiBjeT0iMTQuNzUiIHI9IjEuMjUiIGZpbGw9InVybCgjYikiLz48Y2lyY2xlIGN4PSIxMy42NSIgY3k9IjE0Ljc1IiByPSIxLjI1IiB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ZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiNGRkU2NUUiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRkM4MzAiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4=)](https://astronachos.com/)\n[![Mastodon](https://img.shields.io/badge/mastodon-gray?\u0026logo=mastodon)](https://mastodon.gamedev.place/@astronachos)\n[![Twitter](https://img.shields.io/badge/twitter-gray?\u0026logo=twitter)](https://twitter.com/astronachos)\n[![Telegram](https://img.shields.io/badge/telegram-gray?\u0026logo=telegram)](https://t.me/astronachos)\n[![Buy me a coffee](https://img.shields.io/badge/buy_me_a_coffee-gray?\u0026logo=buy%20me%20a%20coffee)](https://buymeacoffee.com/astrochili)\n\nA toolkit for [Visual Studio Code](https://code.visualstudio.com/) to develop, build, launch, debug, bundle and deploy a game with [Defold](https://defold.com/).\n\n- [x] 💼 Installing recommended extensions\n- [x] 📝 Lua highlighting, autocompletion and linting\n- [x] 🛠️ Applying relevant settings to the workspace\n- [x] 📘 Lua annotations for Defold API\n- [x] 📚 Lua annotations for dependencies\n- [x] 🚀 Building and launching\n- [x] 🔎 Debugging with breakpoints\n- [x] 📦 Bundling for all the platforms\n- [x] 📲 Deploying to connected mobile devices\n\nYou can not to use the Defold Editor at all if you are only working with code at the moment.\n\n💬 [Discuss on the forum](https://forum.defold.com/t/defold-kit-visual-studio-code-extension/74119)\n\n## Setup\n\nIt's possible to install the extension from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=astronachos.defold) or manually by downloading the `.vsix` archive from the [releases](https://github.com/astrochili/vscode-defold/releases) page.\n\nAfter installing the extension and opening a Defold project, you will be prompted to setup Defold Kit with a step-by-step dialogue.\n\n![screenshot-suggest](https://github.com/astrochili/vscode-defold/assets/4752473/102e4069-0b8b-4e42-9195-f4839d22b794)\n\nIf for some reason this doesn't happen, you can run the [Setup](#setup-1) command manually.\n\n### Path to Defold\n\n![screenshot-defold](https://github.com/astrochili/vscode-defold/assets/4752473/d0790cba-3c21-4f9b-bee3-2d2980e1ca3f)\n\nDefold Kit requires [Defold](https://defold.com) installed (surprise).\n\nSelect the automatically suggested path if it exists, or select the Defold folder manually.\n\n### Extensions\n\n![screenshot-extensions](https://github.com/astrochili/vscode-defold/assets/4752473/4e049d1c-320d-4406-ac84-b1b2dda644a6)\n\nSelect the extensions you want to install.\n\nThe first two are highly recommended, the next three are optional:\n\n- [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) - Autocompletion, annotations, diagnostics and etc.\n- [tomblind.local-lua-debugger-vscode](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode) - Launching the game and debugging with breakpoints.\n- [thejustinwalsh.textproto-grammer](https://marketplace.visualstudio.com/items?itemName=thejustinwalsh.textproto-grammer) - Syntax highlighting for `.collection`, `.go` and other Protobuf files.\n- [slevesque.shader](https://marketplace.visualstudio.com/items?itemName=slevesque.shader) - GLSL support for `.vp` and `.fp` files.\n- [dtoplak.vscode-glsllint](https://marketplace.visualstudio.com/items?itemName=dtoplak.vscode-glsllint) - GLSL linting for `.vp` and `.fp` files.\n\n### Workspace\n\n![screenshot-settings](https://github.com/astrochili/vscode-defold/assets/4752473/521af9f5-ee6f-4c51-b024-dac825560e15)\n\nSome additional settings to apply to the workspace.\n\n#### Debugger Scripts\n\n\u003e Displayed if the [`tomblind.local-lua-debugger-vscode`](#extensions) extension is installed.\n\nTo debug the game with breakpoints, it's required to [start the debugger](#breakpoints) on the game side. These files allow you to do that.\n\n#### Launch Configuration\n\n\u003e Displayed if the [`tomblind.local-lua-debugger-vscode`](#extensions) extension is installed.\n\nTo launch the game from the **Run and Debug** panel, it's required to add the relevant configuration to the `.vscode/launch.json` file. The `Defold` configuration will be added.\n\n#### Workspace Settings\n\nThese settings are recommended for Defold project workspace to make your development  more comfortable.\n\nThe settings will only be applied to the installed extensions. You can check them in the [settings.ts](src/data/settings.ts).\n\n#### Workspace Recommendations\n\nAdds Defold Kit to the `.vscode/extensions.json` file to appear in the recommended extensions to install for this workspace.\n\n### Annotations Syncing\n\n![screenshot-annotations](https://github.com/astrochili/vscode-defold/assets/4752473/88878bce-abb8-4dd2-bf76-46f7668e9129)\n\n\u003e This step is skipping if the [`sumneko.lua`](#extensions) extension is not installed.\n\nSynchronise Lua annotations with the Defold Editor version and project dependencies.\n\n#### Defold API Annotations\n\nFethes Defold API annotations from the repository according the [settings](#defoldkitannotationsrepository) and unpacks them to the Defold Kit shared storage.\n\n#### Dependencies Annotations\n\nUnpacks archives from the `.internal/libs` folder and copies `*.lua` files from libraries to the Defold Kit workspace storage.\n\n## Opening Files from Defold\n\n![screenshot-preferences](https://github.com/astrochili/vscode-defold/assets/4752473/d5107629-5f4c-4010-9851-002266fd5ff8)\n\nTo open script files from the Defold Editor directly in Visual Studio Code, you must set the following settings by specifying the path to the executable file:\n\n- Windows (user installer): `C:\\Users\\%USERNAME%\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe`\n- Windows (system installer): `C:\\Program Files\\Microsoft VS Code\\Code.exe`\n- macOS: `/Applications/Visual Studio Code.app/Contents/MacOS/Electron`\n- Linux: `/usr/bin/code`\n\n Set these parameters to open specific files and lines:\n\n- Open File: `. {file}`\n- Open File at Line: `. -g {file}:{line}`\n\nThe `.` character here is required to open the entire workspace, not an individual file.\n\n## Run and Debug\n\n![screenshot-debugger](https://github.com/astrochili/vscode-defold/assets/4752473/9a3c2184-645a-49e9-ba72-1de02290d7a5)\n\n### Launch\n\nTo launch a game ensure that two these steps are done during [setting up](#setup) Defold Kit:\n\n- The [`local-lua-debugger-vscode`](#extensions) extension is installed.\n- [Launch configiuration](#launch-configuration) are added to the workspace.\n\nEnsure that the `Defold` configuration selected on the **Run and Debug** panel and launch it using the `F5` keyboard shortcut (default).\n\n### Breakpoints\n\nTo make the breakpoints work ensure that [Debugger scripts](#debugger-scripts) are added to the workspace. Then add the `debugger.script` component to your initial collection *or* add this code to your initial script:\n\n```lua\nlocal debugger = require('debugger.debugger')\ndebugger.start()\n```\n\n## Commands\n\n![screenshot-commands](https://github.com/astrochili/vscode-defold/assets/4752473/6fff2c8d-1b49-4843-b187-be8a22cf248c)\n\nCommands with the `Defold Kit` prefix are available in the Command Palette using the `[Ctrl/Cmd]-Shift-P` keyboard shortcut (default).\n\n### Setup\n\nStarts the [setup dialogue](#path-to-defold). It's okay to run this command many times if you are not sure you are ready to turn on all the features at once.\n\n### Sync API Annotations\n\nOpens the [Annotations Syncing](#annotations-syncing) dialogue.\n\n### Clean API Annotations\n\nDeletes all the previously synced annotations from the global storage and workspace storage.\n\n### Open Defold\n\nOpens the current project in the Defold Editor.\n\nOn macOS, the window will be switched if Defold is already running.\n\n### Clean Build\n\nRuns a [bob](https://defold.com/manuals/bob/) instance with the `distclean` argument to clean the build folder.\n\n### Resolve Dependencies\n\nRuns a [bob](https://defold.com/manuals/bob/) instance with the `resolve` argument to resolve the project's dependencies. Then synchronises Lua annotations if the Lua Language Server is installed.\n\n### Bundle\n\nRuns a [bob](https://defold.com/manuals/bob/) instance with the `resolve distclean build biundle` arguments, selected options and defined values form [settings](#settings).\n\nExecutes for all selected target platforms one by one. When finished will prompt you to open the bundle folder.\n\n#### Platforms\n\n![screenshot-platforms](https://github.com/astrochili/vscode-defold/assets/4752473/7ed5addc-98ee-4598-a620-c21964ef0e64)\n\nSelect which target platforms you want to bundle your game.\n\n#### Options\n\n![screenshot-bundle](https://github.com/astrochili/vscode-defold/assets/4752473/0640062a-6736-4c7f-b6a3-fc5456bc5244)\n\n- **Release** — Bundle a [Release](https://defold.com/manuals/bundling/#release-vs-debug) variant (otherwise bundle Debug variant).\n- **Texture Compression** — Enable texture compression as specified in [texture profiles](https://defold.com/manuals/texture-profiles/).\n- **Generate Debug Symbols** — Generate the [symbol file](https://defold.com/manuals/debugging-native-code/#symbolicate-a-callstack) (if applicable).\n- **Generate Build Report** — Generate the [build report](https://defold.com/manuals/profiling/#build-reports) file.\n- **Publish Live Update Content** — Publish [Live update](https://defold.com/manuals/live-update/) content.\n\n### Deploy to Mobile\n\n![screenshot-deploy](https://github.com/astrochili/vscode-defold/assets/4752473/3f0f1e87-127f-4d78-a702-102e8e29cdf9)\n\nDeploy to the connected mobile device with [ios-deploy](https://github.com/ios-control/ios-deploy) for iOS and [adb](https://developer.android.com/studio/command-line/adb) for Android. These tools must be installed and accessible via shell.\n\n```bash\n# Will execute for iOS\nios-deploy -b ${ipa_file}\n\n# Will execute for Android\nadb install ${apk_file}\n```\n\nThe `*.ipa` or `*.apk` file is required in the corresponding bundle folder, so run the [Bundle](#bundle) command before deploying.\n\n## Tasks\n\n![screenshot-tasks](https://github.com/astrochili/vscode-defold/assets/4752473/d49eabfb-18f8-4643-a74a-c2741c4b1afa)\n\nBuild tasks with the `Defold Kit` prefix are available using the `[Ctrl/Cmd]-Shift-B` keyboard shortcut (default).\n\nTasks are aliases of some [commands](#commands) described above to have a quick access to them.\n\n- [Resolve Dependencies](#clean-build)\n- [Clean Build](#clean-build)\n- [Bundle](#bundle)\n- [Deploy to Mobile](#deploy-to-mobile)\n\n## Settings\n\n#### defoldKit.general.editorPath\n\nThe path to the Defold Editor folder.\n\nRunning the [Setup](#setup-1) command is the preferred way to update this value, but you can edit it manually if you're sure of what you are doing.\n\n#### defoldKit.general.suggestSetup\n\nSuggest to setup Defold Kit if the `game.project` file is found in the current workspace.\n\n#### defoldKit.general.showBobOutput\n\nOpen the Output panel during a [bob](https://defold.com/manuals/bob/) instance executing.\n\n#### defoldKit.annotations.repository\n\nWhere to get Defold API annotations. Three options are currently available:\n\n- [astrochili/defold-annotations](https://github.com/astrochili/defold-annotations)\n- [mikatuo/defold-lua-annotations](https://github.com/mikatuo/defold-lua-annotations)\n\n#### defoldKit.annotations.autosync.defold\n\nAutomatically synchronize annotations for Defold API with the Defold editor version when needed at extension startup.\n\n#### defoldKit.annotations.autosync.libs\n\nAutomatically synchronize annotations for dependencies when changes are detected in the `.internal/libs` folder.\n\n#### defoldKit.dependencies.email\n\nUser email to resolve dependencies.\n\nAdds the `--email ${email}` argument during [Resolve Dependencies](#resolve-dependencies) and [Bundle](#bundle) commands execution.\n\n#### defoldKit.dependencies.authToken\n\nAuthentication token to resolve dependencies.\n\nAdds the `--auth ${authToken}` argument during [Resolve Dependencies](#resolve-dependencies) and [Bundle](#bundle) commands execution.\n\n#### defoldKit.bundle.ios.debug.provisioningProfile\n\nPath to the `*.mobileprovision profile` for **Debug** variant on **iOS**.\n\nAdds the `--mobileprovisioning ${provisioningProfile}` argument during [Bundle](#bundle) command execution.\n\n#### defoldKit.bundle.ios.debug.identity\n\nCode signing identity for the **Debug** variant on **iOS**.\n\nAdds the `--identity ${identity}` argument during [Bundle](#bundle) command execution.\n\n#### defoldKit.bundle.ios.release.provisioningProfile\n\nPath to the `*.mobileprovision profile` for **Release** variant on **iOS**.\n\nAdds the `--mobileprovisioning ${provisioningProfile}` argument during [Bundle](#bundle) command execution.\n\n#### defoldKit.bundle.ios.release.identity\n\nCode signing identity for the **Release** variant on **iOS**.\n\nAdds the `--identity ${identity}` argument during [Bundle](#bundle) command execution.\n\n#### defoldKit.bundle.android.keystore\n\nPath to the `*.keystore` file for **Android**.\n\nAdds the `--keystore ${keystore}` argument during [Bundle](#bundle) command execution.\n\n#### defoldKit.bundle.android.keystorePass\n\nPath to the `*.keystore.pass.txt` file for **Android**.\n\nAdds the `--keystore-pass ${keystorePass}` argument during [Bundle](#bundle) command execution.\n\n#### defoldKit.bundle.android.keystoreAlias\n\nName of the alias from the [keystore](#defoldkitbundleandroidkeystore) for **Android**.\n\nAdds the `--keystore-alias ${keystoreAlias}` argument during [Bundle](#bundle) command execution.\n\n## Compatibility\n\nIt's possible to uncheck all the options during [Defold Kit setup](#setup) and still be able to sync annotations, bundle and deploy the game.\n\nTo use your own annotations solution you can skip the [Annotations Syncing](#annotations-syncing) step or run the [Clean API Annotations](#clean-api-annotations) command.\n\nDue to the flexibility of Defold Kit, it can be used in combination with the [Defold Buddy](https://marketplace.visualstudio.com/items?itemName=mikatuo.vscode-defold-ide) extension, which adds additional sugars and features.\n\n## Logs\n\n- The extension outputs logs to the `Default Kit` output channel.\n- A running game with a debugger outputs logs to the debug console.\n- A running game without debugger outputs logs to the `Defold Engine` terminal instance.\n\n## Troubleshooting\n\n\u003e Defold Kit doesn't see installed extensions and prompts me to install them again.\n\nMake sure that these extensions are activated. Defold Kit cannot distinguish a deactivated extension from a missing extension due to the lack of the corresponding Visual Studio Code API.\n\n\u003e The game launched, but the breakpoints don't work.\n\nMake sure that you [started the debugger](#breakpoints) on the game side.\n\n\u003e Build in VS Code is fine, but Defold Editor fails with the message `module 'debugger.debugger' not found`.\n\nThis can happen if you call a method on the requested module in a single line. Watch [defold/defold/7963](https://github.com/defold/defold/issues/7963) for updates.\n\n```lua\n-- ✅ Correct way to require in Defold\nlocal debugger = require('debugger.debugger')\ndebugger.start()\n\n-- 🚫 Wrong way, will fail in Defold Editor\nrequire('debugger.debugger').start()\n```\n\n## Limitations\n\n### Change breakpoints at runtime\n\nBreakpoints can be set before launch and changed **on pauses only**. But there is a workaround, you can bind some input key to call `debugger.requestBreak()` and execution will pause on this line.\n\nWatch [tomblind/local-lua-debugger-vscode/#32](https://github.com/tomblind/local-lua-debugger-vscode/issues/32) and [local-lua-debugger-vscode/pull/67](https://github.com/tomblind/local-lua-debugger-vscode/pull/67) for updates.\n\n### Debug on mobile devices\n\n[Local Lua Debugger](https://github.com/tomblind/local-lua-debugger-vscode/) is a *local* debugger. So you can't debug the game on the device by this way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrochili%2Fvscode-defold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrochili%2Fvscode-defold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrochili%2Fvscode-defold/lists"}