While Defold allows you to create a lot of your game content using visual tools such as the tilemap and particle effect editors you still create your game logic using a code editor. Game logic is written using the Lua programming language while extensions to the engine itself are written using the native language(s) for the target platform.
Defold uses Lua 5.1 and LuaJIT (depending on target platform) and you need to follow the language specification for those specific versions of Lua when writing your game logic. For more details on how to work with Lua in Defold see our Lua in Defold manual.
Defold supports the use of transpilers that emit Lua code. With transpiler extension installed, you can use alternative languages — such as Teal — to write statically-checked Lua. It is a preview feature that has limitations: current transpiler support does not expose the information about modules and functions defined in the Defold Lua runtime. It means that using Defold APIs like go.animate will require you to write external definitions yourself.
Defold allows you to extend the game engine with native code to access platform specific functionality not provided by the engine itself. You can also use native code when the performance of Lua isn’t enough (resource intensive calculations, image processing etc). Refer to our manuals on Native Extensions to learn more.
Defold has a built-in code editor that allows you to open and edit Lua files (.lua), Defold script files (.script, .gui_script and .render_script) as well as any other file with a file extension not natively handled by the editor. Additionally the editor provides syntax highlighting for Lua and script files.

The built-in code editor will show code completion of functions while writing code:

Pressing CTRL + Space will show additional information about functions, arguments and return values:

The bundled Lua language server includes type annotations for Defold APIs. Completion, hover information and diagnostics understand Defold types such as hashes, URLs, vectors and quaternions, as well as function arguments and return values. The editor provides annotations for game scripts and for the editor.* APIs used in .editor_script files. No separate annotation library is needed for the built-in APIs when using the Defold code editor.
Third-party extension APIs may need their own annotations.
Select Edit ▸ Format Document/Selection or press Alt + Shift + F to run the language server’s formatter. With a selection, the editor formats the selected lines; without one, it formats the document. Formatting requires a language server that supports the corresponding formatting operation.
To format modified open files when saving, enable Format on save in Preferences ▸ Code. This preference is disabled by default and requires a language server that supports document formatting. See Code preferences.
The built-in code editor can show a searchable list of symbols in the current code file, such as functions, objects, and variables. Select View ▸ Jump to Symbol…, or press Ctrl + Shift + O on Windows and Linux, or ⌘ Cmd + Shift + O on macOS.
Start typing to fuzzy search the symbols, use the arrow keys to move through the results and preview their locations in the editor, then press Enter to jump to the selected symbol. Press Esc to close the dialog and return to the previous cursor and scroll position.

The built-in code editor performs code linting using Luacheck and Lua language server. To configure the Luacheck, create a .luacheckrc file in the project root. You can read the Luacheck configuration page for the list of the available options. Defold uses the following defaults for the Luacheck configuration:
unused_args = false -- don't warn on unused arguments (common for .script files)
max_line_length = false -- don't warn on long lines
ignore = {
"611", -- line contains only whitespace
"612", -- line contains trailing whitespace
"614" -- trailing whitespace in a comment
},
The code editor in Defold provides the basic functionality you need to write code, but for more advanced use cases or for power users with a favorite code editor it is possible to let Defold open files using an external editor. In the Preferences window under the Code tab it is possible to define an external editor that should be used when editing code.
Defold Kit is a Visual Studio Code plugin with the following features:
Learn more and install Defold Kit from the Visual Studio Marketplace.
Community created API reference packages are available for Dash and Zeal.