|
@@ -5,12 +5,12 @@ brief: This manual explains how to create a script API definition so that the De
|
|
|
|
|
|
# Auto-complete for native extensions
|
|
# Auto-complete for native extensions
|
|
|
|
|
|
-The Defold editor will provide auto-complete suggestions for all Defold API functions and it will try to generate suggestions for Lua modules required by your scripts. The editor is however unable to provide auto-complete suggestions for the functionality exposed by native extensions. In the case of native extensions it is up to the extension author to generate a script API definition file that the editor can use to provide auto-complete suggestions.
|
|
|
|
|
|
+The Defold editor will provide auto-complete suggestions for all Defold API functions and it will generate suggestions for Lua modules required by your scripts. The editor is however unable to automatically provide auto-complete suggestions for the functionality exposed by native extensions. A native extension can provide an API definition in a separate file to enable auto-complete suggestions also for the API of the extension.
|
|
|
|
|
|
|
|
|
|
## Creating a script API definition
|
|
## Creating a script API definition
|
|
|
|
|
|
-A script API definition file has the extension `.script_api` and it is a file in [YAML format](https://yaml.org/). The expected format for a script API definition is:
|
|
|
|
|
|
+A script API definition file has the extension `.script_api`. It must be in [YAML format](https://yaml.org/) and located together with the extension files. The expected format for a script API definition is:
|
|
|
|
|
|
```yml
|
|
```yml
|
|
- name: The name of the extension
|
|
- name: The name of the extension
|
|
@@ -42,7 +42,9 @@ A script API definition file has the extension `.script_api` and it is a file in
|
|
```
|
|
```
|
|
|
|
|
|
Types can be any of `table, string , boolean, number, function`. If a value can have multiple types it is written as `[type1, type2, type3]`.
|
|
Types can be any of `table, string , boolean, number, function`. If a value can have multiple types it is written as `[type1, type2, type3]`.
|
|
-
|
|
|
|
|
|
+:::sidenote
|
|
|
|
+Types are currently not shown in the editor. It is recommended to still provide them so that they are available once the editor has support for showing type information.
|
|
|
|
+:::
|
|
|
|
|
|
## Examples
|
|
## Examples
|
|
|
|
|