Commit graph

177 commits

Author SHA1 Message Date
George Marques
81c7cae567
GDScript: Don't get invalid dictionary key during completion
We try to get the value out of a dictionary in order to establish its
type for completion purposes. However, if the dictionary or the key
is not a constant, we cannot safely get the actual value, so we skip
this and just try to infer from static typing.

Getting the value directly with `Variant::get()` generate errors if the
base is a Dictionary and the key is of an invalid type. So before trying
to get it we use the Dictionary validator to make sure it we can safely
try to get the key.
2025-07-24 15:02:40 -03:00
Aaron Franke
1085200f51
GDScript: Replace abstract keyword with @abstract annotation
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2025-06-23 12:24:45 -07:00
Danil Alexeev
e2d4469dc2
GDScript: Add missing type conversions in for range 2025-06-11 20:45:47 +03:00
Thaddeus Crews
0f05e91889
Merge pull request #82808 from dalexeev/gds-vararg
GDScript: Add support for variadic functions
2025-06-09 17:08:48 -05:00
Danil Alexeev
a13fbc6e3e
GDScript: Optimize non-constant for-range 2025-06-09 22:04:39 +03:00
Danil Alexeev
ee121ef80e
GDScript: Add support for variadic functions 2025-06-09 21:53:05 +03:00
Thaddeus Crews
86415f1732
Merge pull request #99150 from dalexeev/gds-fix-callable-call-errror-text
GDScript: Fix `Callable` call error text
2025-06-09 12:31:39 -05:00
Danil Alexeev
a7cf2069d5
GDScript: Add abstract methods
Co-authored-by: ryanabx <ryanbrue@hotmail.com>
2025-06-09 20:11:58 +03:00
Pedro J. Estébanez
6841b45552 Add tests for resource duplication 2025-05-26 17:05:04 +02:00
Malcolm Anderson
d8db03e31a Fix a few GDScript warning messages for grammar and consistency
Regenerate test results

Improve warning message for `INT_AS_ENUM_WITHOUT_CAST`

Improve `REDUNDANT_AWAIT` message and regenerate tests

Allow warning message for UNASSIGNED_VARIABLE_OP_ASSIGN to display specific operator

Remove "being" from some messages to make them consistent and clearer

Update expected test results

Use Variant::get_operator_name for determining string representation of operator instead of big switch-case

Update tests

Update modules/gdscript/gdscript_warning.cpp

Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>

Update tests... again
2025-05-06 20:28:01 -07:00
Danil Alexeev
2b30f23595
GDScript: Fix Callable call error text 2025-05-02 18:30:35 +03:00
Nolkaloid
c1cdaf7b16
Add gdscript tests for callv with const arrays 2025-04-10 23:13:01 +02:00
HolonProduction
676e4c9013 GDScript: Cancel suspended functions when reloading a script 2025-03-06 11:34:40 +01:00
Danil Alexeev
7d65d0a908
GDScript: Add @warning_ignore_start and @warning_ignore_restore annotations 2024-12-06 15:37:02 +03:00
Rémi Verschelde
682c5c7d49
GDScript: Fix failing tests due to collision with #99490 formatting change 2024-11-29 23:10:02 +01:00
Rémi Verschelde
b3a44a5567
Merge pull request #99490 from dalexeev/gds-tests-track-multiple-errors
GDScript: Support tracking multiple analyzer and runtime errors in tests
2024-11-29 22:02:02 +01:00
Rémi Verschelde
f2f48aaf36
Fix stringification of Projection 2024-11-25 21:10:32 +01:00
kobewi
e210313045 Fix stringification of Vector4 2024-11-22 21:44:30 +01:00
Danil Alexeev
f86dcd4e67
GDScript: Support tracking multiple analyzer and runtime errors in tests 2024-11-21 22:09:50 +03:00
Chaosus
0524e29b5c Fix crash when division by zero/modulo by zero happen on vectors 2024-11-21 20:24:43 +03:00
girdenis-p
413490c270 Fix analyzer pushing SHADOWED_VARIABLE warning for members shadowed in subclasses
This fixes a bug in the analyzer where it did not push the SHADOWED_VARIABLE_BASE_CLASS
warning for members shadowed by variable in subclass. It does this by comparing the class
which contains the shadowed member with the class containing the variable, and pushing
SHADOWED_VARIABLE only if the classes are the same. Additionally, SHADOWED_VARIABLE_BASE_CLASS
can take an extra symbol which helps to specify the line for non native base class.
2024-11-06 15:04:14 +00:00
Thaddeus Crews
363c0b5fec
Merge pull request #47502 from KoBeWi/add_0
Always add decimal when converting float to string
2024-10-31 20:14:39 -05:00
Danil Alexeev
4dc568856a
GDScript: Rework GDScriptUtilityFunctions macros 2024-10-25 17:46:38 +03:00
kobewi
5c0f2414cd Always add decimal when printing float 2024-10-23 15:00:21 +02:00
rune-scape
d3ad99d3d1 GDScriptNativeClass: Allow getting static function as callable 2024-09-23 10:56:53 -07:00
Rémi Verschelde
f7daa0fb2f
Merge pull request #96856 from RandomShaper/selfdestruct_correctness
Object: Let debug lock handle callee destruction within call chain gracefully
2024-09-16 13:35:06 +02:00
Pedro J. Estébanez
bb77520599 Object: Add tests about the safety of tail destruction 2024-09-16 09:58:47 +02:00
Thaddeus Crews
b3d7960df4
Core: Fix operator[] for typed dictionaries 2024-09-12 11:10:17 -05:00
Thaddeus Crews
9853a69144
Implement typed dictionaries 2024-09-04 10:27:26 -05:00
Rémi Verschelde
13a90e938f
Merge pull request #70096 from rune-scape/stringname-dict
StringName Dictionary keys
2024-09-03 17:38:06 +02:00
rune-scape
154049ce17 StringName Dictionary keys
also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
2024-08-29 13:39:27 -07:00
Danil Alexeev
c1322d41e6
GDScript: Replace assert() with Utils.check() in tests 2024-08-28 17:41:52 +03:00
Rémi Verschelde
b2facc018a
Merge pull request #94730 from dalexeev/gds-fix-while-locals-clearing
GDScript: Fix locals clearing after exiting `while` block
2024-07-26 13:44:09 +02:00
A Thousand Ships
8f3e2c96eb
[Core] Fix Variant::construct of Object
Variant type was not updated correctly causing leaks in ref-counted
2024-07-25 12:25:29 +02:00
Danil Alexeev
5350e1beaa
GDScript: Fix locals clearing after exiting while block 2024-07-25 12:10:37 +03:00
Danil Alexeev
8c82fd15d2
GDScript: Fix incorrect setter call for reference types 2024-07-24 10:37:35 +03:00
Rémi Verschelde
c2b91e2986
Merge pull request #94327 from HolonProduction/underscore_identifier
GDScript: Restore support for `Token::UNDERSCORE` in identifiers
2024-07-17 11:44:01 +02:00
Rémi Verschelde
aefd91ae42
Merge pull request #94138 from vnen/gdscript-simple-setter-chain-call-setter
GDScript: Call setter on simple setter chain without getter
2024-07-17 11:43:15 +02:00
HolonProduction
06e732c3ed GDScript: Restore support for Token::UNDERSCORE in identifiers 2024-07-15 10:04:11 +02:00
George Marques
87c90a573c
GDScript: Call setter on simple setter chain without getter
Fixes a bug where a member variable was being set directly before
calling the setter.
2024-07-09 13:01:59 -03:00
Rémi Verschelde
92320c9b73
Merge pull request #94025 from dalexeev/gds-fix-implicit-cast-typed-array-param
GDScript: Fix implicit cast to typed array when passing parameter
2024-07-09 16:47:20 +02:00
Rémi Verschelde
daba91d8c6
Merge pull request #93897 from akien-mga/vformat-better-error-message
Core: Improve `vformat` error reporting on `sprintf` failure
2024-07-09 00:03:17 +02:00
A Thousand Ships
f68ab70a6a
[GDScript] Fix get_method for lambda self Callables 2024-07-08 18:01:54 +02:00
Danil Alexeev
b4cb7ec2bb
GDScript: Fix implicit cast to typed array when passing parameter 2024-07-07 13:43:09 +03:00
A Thousand Ships
aa28782be3
[GDScript] Fix get_argument_count for lambda Callables 2024-07-05 13:53:56 +02:00
Rémi Verschelde
496b7b8482
Core: Improve vformat error reporting on sprintf failure
And fix a few occurrences of formatting errors that led me to this.
2024-07-04 10:54:55 +02:00
Danil Alexeev
18d8838051
GDScript: Fix subscript resolution on constant non-metatype GDScript base 2024-05-30 17:37:05 +03:00
Danil Alexeev
4b692959de
GDScript: Fix lambdas capturing non-local variables 2024-05-22 10:07:31 +03:00
Danil Alexeev
76b2d85c9f
GDScript: Fix some export annotation issues 2024-05-13 17:49:06 +03:00
Rémi Verschelde
7d03b1de0b
Style: Trim trailing whitespace and ensure newline at EOF
Found by apply the file_format checks again via #91597.
2024-05-08 10:12:46 +02:00