summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #91412 from ↵Rémi Verschelde2024-05-0216-4/+155
|\ | | | | | | | | | | dalexeev/gds-fix-non-static-access-in-static-context GDScript: Fix access non-static members in static context
| * GDScript: Fix access non-static members in static contextDanil Alexeev2024-05-0116-4/+155
| |
* | Merge pull request #91364 from vnen/gdscript-implicit-ready-base-firstRémi Verschelde2024-05-022-0/+21
|\ \ | | | | | | | | | GDScript: Call implicit ready on base script first
| * | GDScript: Call implicit ready on base script firstGeorge Marques2024-05-022-0/+21
| | | | | | | | | | | | | | | | | | | | | It is generally expected that the base class is called before the inherited clas. This commit implements this behavior for the implicit ready function (`@onready` annotation) to make it consistent with the expectations.
* | | [GDScript] Correctly report invalid read-only accessA Thousand Ships2024-05-013-3/+3
| |/ |/|
* | Merge pull request #91192 from vnen/gdscript-validated-native-static-callsRémi Verschelde2024-05-012-0/+9
|\ \ | | | | | | | | | GDScript: Perform validated calls with static methods
| * | GDScript: Perform validated calls with static methodsGeorge Marques2024-04-252-0/+9
| | | | | | | | | | | | | | | | | | When the types are validated at compile time, this type of call runs faster. It is already used for instance methods, this adds this optimization to native static methods as well.
* | | Merge pull request #89647 from AThousandShips/read_only_dictRémi Verschelde2024-05-012-0/+10
|\ \ \ | |_|/ |/| | | | | [Core] Fix property access on read-only `Dictionary`
| * | [Core] Fix property access on read-only `Dictionary`A Thousand Ships2024-04-222-0/+10
| | |
* | | GDScript: Fix object iterator opcodesDanil Alexeev2024-04-262-0/+79
| |/ |/|
* | GDScript: Fix test `reset_uninit_local_vars.gd` failureDanil Alexeev2024-04-241-3/+3
| |
* | Merge pull request #89990 from dalexeev/gds-reset-uninit-local-varsRémi Verschelde2024-04-242-0/+25
|\ \ | | | | | | | | | GDScript: Fix uninitialized local variables not being reset
| * | GDScript: Fix uninitialized local variables not being resetDanil Alexeev2024-03-302-0/+25
| | |
* | | Merge pull request #89884 from HolonProduction/tests-batch-2Rémi Verschelde2024-04-2337-0/+52
|\ \ \ | |_|/ |/| | | | | Completion Tests: Add script to owner
| * | Completion Tests: Add script to ownerHolonProduction2024-03-2537-0/+52
| | |
* | | Merge pull request #90794 from ↵Rémi Verschelde2024-04-184-52/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | vnen/gdscript-no-unused-constant-warning-with-underscore GDScript: Suppress unused constant warning with underscore
| * | | GDScript: Suppress unused constant warning with underscoreGeorge Marques2024-04-184-52/+9
| | | | | | | | | | | | | | | | | | | | | | | | The warning message mentions that local constants prefixed with `_` does not generate the warning. This commit actually implements this warning suppression.
* | | | GDScript: Warn when enum variable has no defaultGeorge Marques2024-04-163-0/+17
|/ / / | | | | | | | | | | | | The default will always be set to `0`, so if it's not a valid value in the enum, the warning is shown.
* | | Merge pull request #89472 from dalexeev/gds-fix-bin-tokenizer-continuation-linesRémi Verschelde2024-04-152-0/+14
|\ \ \ | | | | | | | | | | | | GDScript: Fix continuation lines in `GDScriptTokenizerBuffer`
| * | | GDScript: Fix continuation lines in `GDScriptTokenizerBuffer`Danil Alexeev2024-04-102-0/+14
| | | |
* | | | GDScript: Allow casting enum to intGeorge Marques2024-04-122-0/+11
| | | | | | | | | | | | | | | | | | | | An enum value is always an integer so the cast is valid. The code here now consider this case to avoid giving an error message.
* | | | Fix multiline array/dictionary match statementsAiden Storey2024-04-124-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently array and dictionary expressions cannot be spread over multiple lines in match statements. Adding mutliline push/pop while parsing the pattern for bracket and brace enables the ability for these to be multiline. This enables more complex patterns to be matched without exceeding line limits. Fixes #90372
* | | | Merge pull request #90448 from vnen/gdscript-infer-string-formatRémi Verschelde2024-04-102-0/+8
|\ \ \ \ | | | | | | | | | | | | | | | GDScript: Infer type with string format operator
| * | | | GDScript: Infer type with string format operatorGeorge Marques2024-04-102-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the left value type is known to be String, assume the format operator (`%`) will return a string, since it works with any type in the right hand side. This is also used by type inference even if the right hand type is unknown at compile time.
* | | | | Merge pull request #90442 from vnen/gdscript-dont-warn-using-default-builtinRémi Verschelde2024-04-107-4/+38
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | GDScript: Don't warn on unassigned for builtin-typed variables
| * | | | GDScript: Don't warn on unassigned for builtin-typed variablesGeorge Marques2024-04-107-4/+38
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the type of a variable is a built-in Variant type, then it will automatically be assigned a default value based on the type. This means that the explicit initialization may be unnecessary. Thus this commit removes the warning in such case. This also changes the meaning of the unassigned warning to happen when the variable is used before being assigned, not when it has zero assignments.
* | | | Merge pull request #89382 from dcaoc03/masterRémi Verschelde2024-04-094-0/+22
|\ \ \ \ | | | | | | | | | | | | | | | Fix enum autocompletion for core classes
| * | | | Fixed enum autocompletion for core classes (Issue #88858)Diogo Costa2024-03-154-0/+22
| | | | | | | | | | | | | | | | | | | | Minor fix consisted in the use of [[fallthrough]] macro
* | | | | Merge pull request #84043 from dalexeev/gds-fix-unsafe-cast-warningRémi Verschelde2024-04-0918-0/+146
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | GDScript: Fix `UNSAFE_CAST` warning
| * | | | GDScript: Fix `UNSAFE_CAST` warningDanil Alexeev2023-10-2718-0/+146
| | | | |
* | | | | Add tests for signal await with parameterskobewi2024-04-082-0/+29
| |_|_|/ |/| | |
* | | | [Core] Disconnect one-shot signals before calling callbacksA Thousand Ships2024-03-204-0/+40
| |_|/ |/| | | | | | | | | | | This prevents infinite recursion with one-shot connections emitting themselves
* | | Merge pull request #87680 from AThousandShips/the_angry_countRémi Verschelde2024-03-132-0/+129
|\ \ \ | | | | | | | | | | | | Add methods to get argument count of methods
| * | | Add methods to get argument count of methodsA Thousand Ships2024-03-102-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added to: * `Callable`s * `Object`s * `ClassDB` * `Script(Instance)`s
* | | | GDScript: Fix `@warning_ignore` annotation issuesDanil Alexeev2024-03-1219-25/+284
|/ / /
* | | Merge pull request #82952 from AbelToy/gds-export-arrayRémi Verschelde2024-03-0610-5/+324
|\ \ \ | | | | | | | | | | | | Allow `@export`ed Arrays to set property hints for their elements
| * | | Support Array and PackedArray in @export_*Abel Toy2024-03-0610-5/+324
| | | |
* | | | [GDScript] Fix some test file pathsA Thousand Ships2024-03-0414-0/+0
| | | |
* | | | Merge pull request #86973 from HolonProduction/tests-batch-1Rémi Verschelde2024-03-0471-5/+664
|\ \ \ \ | | | | | | | | | | | | | | | Add tests for `get_node` autocompletion
| * | | | CleanupHolonProduction2024-03-015-5/+0
| | | | |
| * | | | Debugging additionsHolonProduction2024-03-012-3/+4
| | | | |
| * | | | Add test for `get_node` autocompletionHolonProduction2024-03-0171-5/+668
| |/ / /
* / / / GDScript: Adjust STATIC_CALLED_ON_INSTANCE warning to not default to the ↵20kdc2024-03-012-9/+29
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | native type, and to not trigger on self-calls Not defaulting to the native type rationale: Defaulting to the native type is less than useful, as: * There are very few native types that are extensible and have static methods. * Defaulting to the native type does not account for a method being script-defined. While the "real fix" would be to carefully track the source of the method, the get_function_signature method is already complicated enough. This will at least ensure the resulting code should always be valid. Not triggering on self-calls rationale: Found in PR comment https://github.com/godotengine/godot/pull/85918#issuecomment-1935864459 ``` static func example(): pass func example2(): example() # self-call on static function ``` Disabling this warning on self-calls is: * Consistent with other languages * Important for anonymous classes (where the output code is unusable)
* | | Core: Add `Callable.create` static method for `Variant` callablesDanil Alexeev2024-02-292-2/+11
| | |
* | | Merge pull request #82122 from dalexeev/gds-add-export-hidden-annotationRémi Verschelde2024-02-2714-103/+152
|\ \ \ | |_|/ |/| | | | | GDScript: Add `@export_storage` annotation
| * | GDScript: Add `@export_storage` annotationDanil Alexeev2023-12-1914-103/+152
| |/
* | Merge pull request #88020 from emre0altan/match-null-crashes-GDScript-compilerRémi Verschelde2024-02-232-0/+8
|\ \ | | | | | | | | | GDScript: Set `has_type` false if it is `BUILTIN` but `Variant::NIL`
| * | set has_type false if it is BUILTIN but Variant::NILemre0altan2024-02-112-0/+8
| | |
* | | GDScript: Reintroduce binary tokenization on exportGeorge Marques2024-02-083-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds back a function available in 3.x: exporting the GDScript files in a binary form by converting the tokens recognized by the tokenizer into a data format. It is enabled by default on export but can be manually disabled. The format helps with loading times since, the tokens are easily reconstructed, and with hiding the source code, since recovering it would require a specialized tool. Code comments are not stored in this format. The `--test` command can also include a `--use-binary-tokens` flag which will run the GDScript tests with the binary format instead of the regular source code by converting them in-memory before the test runs.
* | | GDScript: Add `is not` operatorDanil Alexeev2024-02-042-0/+17
|/ /