Age | Commit message (Collapse) | Author |
|
The current code style guidelines forbid the use of `auto`.
Some uses of `auto` are still present, such as in UWP code (which
can't be currently tested) and macros (where removing `auto` isn't
easy).
|
|
Fix mismatch between String and StringName in dictionary keys
|
|
Make LSP update the filesystem for changed scripts
|
|
|
|
There was a mixup between String and StringName keys. Now they're
clearly separated. This also means you have to consider which type
you're using for the dictionary keys and how you are accessing them.
|
|
GDScript: Use special stack space for temporaries to reduce type changes
|
|
|
|
|
|
So the stack slots perform less type changes, which is useful for
future optimizations.
|
|
This updates global classes and exposes base member variables.
Fixes #39713
|
|
Blackiris/fix-corrupt-scene-when-export-has-setter
Fix corrupt scene when export var has setter
|
|
|
|
|
|
There's now only 3 addressing modes: stack, constant, and member.
Self, class, and nil are now present respectively in the first 3 stack
slots. Global and class constants are moved to local constants when
compiling. Named globals is only present on editor to use on tool
singletons, so its use now emits a new instruction to copy the global to
the stack.
This allow us to further optimize the VM later by embedding the
addressing modes in the instructions themselves, which is better done
with less permutations.
|
|
This is meant for testing the GDScript implementation, not for testing
user scripts nor testing the engine using scripts.
Tests consists in a GDScript file and a .out file with the expected
output. The .out file format is: expected status (based on the enum
GDScriptTest::TestStatus) on the first line, followed by either an error
message or the resulting output. Warnings are added after the first
line, before the output (or compiler errors) if the parser pass without
any error.
The test script must have a function called `test()` which takes no
argument. Such function will be called by the test runner. The test
should not have any dependency unless it's part of the test too. Global
classes (using `class_name`) are registered before the runner starts, so
those should work if needed.
Use the command `godot --gdscript-generate-tests
godot-source/modules/gdscript/tests/scripts` to update the .out files
with the current output (make sure the output are the expected values
before committing).
The tests themselves are part of the doctest suite so those can be
executed with `godot --test`.
Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
|
|
Fix infinite loop when guessing argument type from parent class
|
|
|
|
|
|
GDScript: Properly validate return type
|
|
When the type cannot be validated at compile time, the runtime must do a
check to ensure type safety is kept, as the code might be assuming the
return type is correct in another place, leading to crashes if the
contract is broken.
|
|
|
|
|
|
|
|
Rename Array.invert() to Array.reverse()
|
|
Fix a few issues with @export in GDScript
|
|
GDScript: Fix array type check on constants
|
|
They mistakenly pointing to the wrong union member (variable instead of
constant).
|
|
|
|
Also fix the enum type in variables to be integer.
|
|
|
|
This ensures that annotations that rely on the datatype (such as
@export) can validated it timely, allowing compound expressions instead
of only literal values.
|
|
GDScript typed arrays
|
|
- Use `Array[type]` for type-hints. e.g.:
`var array: Array[int] = [1, 2, 3]`
- Array literals are typed if their storage is typed (variable
asssignment of as argument in function all). Otherwise they are
untyped.
|
|
Add unit tests for export templates
|
|
|
|
Does the same internally for List and Vector<>, which includes all
PackedArray types.
|
|
fix #47117
|
|
Fixed match test expression for temporaries
|
|
Fixed that a potentially popped temporary was used for the value in
match statements.
|
|
|
|
|
|
equality comparison now writes to right target address
|
|
GDScript export array/dictionary type infer bug fix
|
|
Script editor: Fix two special cases not being checked in code completion
|
|
Add a "not in" operator to GDScript.
|
|
When this code was changed for 4.0, a "break" statement inside a for loop in 3.x was changed to "return".
This means that the two special cases (autoloads and input actions) are never checked.
Removing the return lets these work properly in the editor.
(Also reorder conditionals to short-circuit and avoid expensive methods.)
|
|
GDScript: False positive "Identifier not found" error on signals fixed
|
|
remove invalid codeLensProvider value from lsp
|
|
|
|
Fixed GDScriptLanguageProtocol::notify_client - have 3 arguments, but only 2 are binded
|