Skip to content

Commit 9b8b2b8

Browse files
[Auto] [Update] Document JS type error preference and extended Diagnostic Report coverage (#551)
Co-authored-by: 4ian <1280130+4ian@users.noreply.github.com>
1 parent d7eca24 commit 9b8b2b8

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

automated_updates_data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"last_automated_updates_commit": "50afd05049bc87c288dc4c7ccbce55388522fe53",
2+
"last_automated_updates_commit": "9cd06e4e71f45c80c1b566bd918b410e28a7dce1",
33
"last_improved_things": [
44
{
55
"date": "2026-02-16",

docs/gdevelop5/events/js-code/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ Equivalent events would be:
101101

102102
By writing the **annotation** `/** @type {gdjs.XXX} */` just before the declaration of a variable in JavaScript, you let the code editor know that the variable has the type gdjs.XXX. The editor will be able to assist you by providing **autocompletion** while you type (or when you hover over a word).
103103

104+
!!! tip
105+
106+
You can enable **type error highlighting** in the code editor by going to **Preferences** and toggling "Show type errors in JavaScript events" (a restart is required). This helps catch type mismatches as you write code.
107+
104108
Most of the time annotations are not needed. The methods that you are using are already setup with type annotations. But when you use a list of objects, you may want to access this object specific method (for example, methods to modify the animation of a sprite object). In this case, you could write `/** @type {gdjs.SpriteRuntimeObject} */`.
105109

106110
If you don't do this, the code will still work, but the editor will only be able to provide you with the methods of [gdjs.RuntimeObject](https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeObject.html) (the base class).

docs/gdevelop5/interface/events-editor/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ You can open the diagnostic report by:
143143
- Pressing **F7** (default keyboard shortcut)
144144
- Opening the command palette (Ctrl+P) and searching for "diagnostic report"
145145

146-
The diagnostic report scans your project and lists all detected issues. You can click on any error in the report to navigate directly to the problematic event, making it easier to fix issues quickly.
146+
The diagnostic report scans your project — including scene events and extension function events — and lists all detected issues. You can click on any error in the report to navigate directly to the problematic event, making it easier to fix issues quickly.

0 commit comments

Comments
 (0)