summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #85603 from eldidou/speed-up-get-must-clear-dependenciesYuri Sizov2023-12-161-25/+16
|\ | | | | | | Speed up `GDScript::get_must_clear_dependencies()`
| * Speed up GDScript::get_must_clear_dependencies()eldidou2023-12-091-25/+16
| | | | | | | | | | | | | | | | get_must_clear_dependencies() has a N^3*log(N) time complexity, and this can very quickly slow down the quitting process as more gdscripts are added in a project. This change improves it to N^2*log(N). Instead of using all the inverted dependencies, we do the same with all (non-inverted) dependencies, which is N times faster. Fixes #85435
* | Remove unnecessary assignmentsWilson E. Alvarez2023-12-131-2/+1
|/ | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
* Merge pull request #85373 from DmitriySalnikov/update_singletonsRémi Verschelde2023-12-041-0/+13
|\ | | | | | | Fix updating cached singletons when reloading GDScripts
| * Update cached singletons when reloading GDScriptsDmitriySalnikov2023-11-301-0/+13
| |
* | Fix GDScript thread-exit routine assuming thread-enter was calledPedro J. Estébanez2023-11-271-0/+6
|/
* Fixup thread-owned lambda bookkeeping on thread exit (take 2)Pedro J. Estébanez2023-11-231-13/+74
|
* Revert recently added approach to cross-thread lambda survivalPedro J. Estébanez2023-11-221-91/+11
| | | | | | Commits reverted: - 1ed69191483002ee62ec5b4d5adb16d3bc315ef3 - 271511726b02848783904429c8dde857f6266429
* Fix leak in the bookkeeping of GDScript lambdasPedro J. Estébanez2023-11-211-8/+10
|
* Merge pull request #84659 from RandomShaper/fix_lambda_cross_threadRémi Verschelde2023-11-121-13/+91
|\ | | | | | | Fix lambda cross-thread dynamics
| * Fixup thread-owned lambda bookkeeping on thread exitPedro J. Estébanez2023-11-101-13/+91
| |
* | Assign temporary path to preloaded resourceskobewi2023-11-101-0/+5
|/
* GDScript: Lambda hot reloadingrune-scape2023-10-171-0/+40
| | | | Co-authored-by: Adam Scott <ascott.ca@gmail.com>
* Merge pull request #83123 from astillich/82998-propagate-base-class-exportsRémi Verschelde2023-10-161-6/+13
|\ | | | | | | Fix modifying base script exports not propagating to derived scripts
| * Fix editing exports in a base script not propagating the change to the ↵Alexander Stillich2023-10-161-6/+13
| | | | | | | | | | | | opened property editor This patch fixes the user having to navigate away from the selected node which has the derived script attached and back to see the changes of the base script exports reflected in the property editor.
* | Core: Fix `Object::has_method()` for script static methodsDanil Alexeev2023-10-041-0/+4
| |
* | GDScript: Improve highlighting of typesDanil Alexeev2023-10-031-53/+45
|/
* Merge pull request #82186 from dalexeev/gds-fix-property-duplicationYuri Sizov2023-09-281-8/+10
|\ | | | | | | GDScript: Fix duplication of inherited script properties
| * GDScript: Fix duplication of inherited script propertiesDanil Alexeev2023-09-231-8/+10
| |
* | GDScript: Implement pattern guards for match statementGeorge Marques2023-09-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Within a match statement, it is now possible to add guards in each branch: var a = 0 match a: 0 when false: print("does not run") 0 when true: print("but this does") This allows more complex logic for deciding which branch to take.
* | [Modules] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-261-2/+2
|/
* Merge pull request #81201 from anvilfolk/rpcRémi Verschelde2023-09-121-16/+0
|\ | | | | | | GDScript: Fix subclass methods not inheriting RPC info
| * GDScript: fix subclass methods not inheriting RPC infoocean (they/them)2023-09-111-16/+0
| |
* | GDScript: Fix `get_*_list()` methods return incorrect infoDanil Alexeev2023-09-041-92/+35
|/
* Fix Object::notification orderMarkus Sauermann2023-08-301-3/+11
| | | | | | | | | | | | | | Previously the `p_reversed` parameter didn't influence the order in a correct way. Also script overridden _notification functions were not called in the correct order. To fix this some `notification` functions had to add a `p_reversed` parameter. This made it necessary to adjust cpp-bindings. Co-authored-by: David Snopek <dsnopek@gmail.com>
* Merge pull request #75778 from KoBeWi/_vpRémi Verschelde2023-08-291-1/+22
|\ | | | | | | Expose `_validate_property()` for scripting
| * Expose _validate_property() for scriptingkobewi2023-08-281-1/+22
| |
* | Add a script method to get its class iconYuri Sizov2023-08-241-7/+7
|/ | | | Co-authored-by: Danil Alexeev <danil@alexeev.xyz>
* Add error message when a GDScript resource fails to load.ocean (they/them)2023-07-311-0/+5
| | | | | | | Currently, GDScripts who are only loaded through `ResourceLoader::load()`, like Autoloads, do not have a pathway to announce there is an error in their code. This contributes to significant confusion in error projects when autoloads are involved. At least partially closes #78230.
* Support threads in the script debuggerJuan Linietsky2023-07-261-23/+18
| | | | | | | | | | * This implementation adds threads on the side of the client (script debugger). * Some functions of the debugger are optimized. * The profile is also now thread safe using atomics. * The editor can switch between multiple threads when debugging. This PR adds threaded support for the script language debugger. Every thread has its own thread local data and it will connect to the debugger using multiple thread IDs. This means that, now, the editor can receive multiple threads entering debug mode at the same time.
* GDScript: solve `_populate_class_members()` cyclic dependency problemocean (they/them)2023-07-081-1/+1
|
* GDScript: Remove unnecessary name check in `_get_property_list()`Danil Alexeev2023-06-221-3/+5
|
* Fix errors destroying script with static variablesjpcerrone2023-06-211-1/+1
| | | | | | | Fixes #78376 After #78138 'script_list' is now cleared in 'GDScriptLanguage::finish' Because of that, we can safely remove the removal from that list that happens on 'GDScript::~GDScript'.
* GDScript: Fix `_get_script_name()` function collision for SCU buildDanil Alexeev2023-06-201-2/+26
|
* Merge pull request #77129 from dalexeev/gds-fix-static-var-bugs-part-1Rémi Verschelde2023-06-191-102/+177
|\ | | | | | | GDScript: Fix some bugs with static variables and functions
| * GDScript: Fix some bugs with static variables and functionsDanil Alexeev2023-06-161-102/+177
| |
* | Merge pull request #76954 from Rindbee/return-null-on-fail-load-scriptRémi Verschelde2023-06-191-10/+2
|\ \ | |/ |/| | | Returns null and does not cache when the source code of the script fails to load
| * Returns null and does not cache when the source code of the script fails to loadRindbee2023-06-151-10/+2
| | | | | | | | | | | | | | | | | | | | | | This usually means that an `ERR_FILE*` error occurred. Previously, using `GDScriptCache::get_full_script()` would ignore errors during loading. Now, all errors are not ignored. Judging in which period the error occurred, it can be judged based on the return value: 1. null + err : Error during script loading (load_source_code()). 2. script + err: Error during script parsing.
* | Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-10/+14
|/ | | | | | | | | | | | | | | | | | | | This applies our existing style guide, and adds a new rule to that style guide for modular components such as platform ports and modules: Includes from the platform port or module ("local" includes) should be listed first in their own block using relative paths, before Godot's "core" includes which use "absolute" (project folder relative) paths, and finally thirdparty includes. Includes in `#ifdef`s come after their relevant section, i.e. the overall structure is: - Local includes * Conditional local includes - Core includes * Conditional core includes - Thirdparty includes * Conditional thirdparty includes
* Clear SelfList when destroying GDScriptLanguagekobewi2023-06-121-0/+2
|
* GDScript: Fix template_debug compilation with TOOLS/DEBUG macro mismatchRémi Verschelde2023-04-281-2/+2
|
* Add support for static variables in GDScriptGeorge Marques2023-04-271-6/+121
| | | | | | | | | | Which allows editable data associated with a particular class instead of the instance. Scripts with static variables are kept in memory indefinitely unless the `@static_unload` annotation is used or the `static_unload()` method is called on the GDScript. If the custom function `_static_init()` exists it will be called when the class is loaded, after the static variables are set.
* Improve and fix GDScript documentation generation & behaviorocean (they/them)2023-04-211-166/+11
| | | | | | Removes documentation generation (docgen) from the GDScript compiler to its own file. Adds support for GDScript enums and signal parameters and quite a few other assorted fixes and improvements.
* GDScript: Change parser representation of class extendsDmitrii Maganov2023-03-131-3/+3
|
* Prevent cache corruption when saving resources in the editorYuri Sizov2023-03-081-2/+4
|
* Remove unused `ScriptLanguage` methodsvoidedWarranties2023-02-261-5/+0
|
* Merge pull request #72867 from vnen/gdscript-limit-call-depthYuri Sizov2023-02-171-1/+1
|\ | | | | GDScript: Add limit to call depth
| * GDScript: Add limit to call depthGeorge Marques2023-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | The hard limit is set at 2048 depth which seems sensible between legitimate recursive calls while still avoiding a crash because of a stack overflow in most of the cases. Note that it is still possible to reach the stack limit and get an overflow before reaching a call depth. This is intended as a half-way measure to stop crashing in most cases, since there's no reliable nor portable way to check the amount of stack memory left.
* | GDScript: Remove `treat_warnings_as_errors` project settingDanil Alexeev2023-02-101-1/+0
|/
* Merge pull request #65910 from KoBeWi/gdsusRémi Verschelde2023-02-031-2/+12
|\ | | | | Cleanup function state connections when destroying instance