validate_script
Validate GDScript code before writing to disk. Parse content or res:// path, catch hallucinated APIs, and detect class_name conflicts.
Instructions
Parse/compile GDScript WITHOUT writing it. Pass 'content' (source) or 'path' (res://). Returns whether it compiles â use before write_script to catch hallucinated APIs. Scripts whose class_name is already registered validate correctly (v1.9; the old false 'hides a global class' error is fixed); when validating 'content' destined for an existing file, ALSO pass its 'path' so a real cross-file class_name duplicate is still reported as the error it is.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | res:// path â the file to validate, or (with content) the file the content is destined for | |
| content | No |