Commit graph

2523 commits

Author SHA1 Message Date
Rémi Verschelde
b6a8b8e8f7
Merge pull request #72212 from anvilfolk/gdtestnames
Add option to print filenames in GDScript unit testing
2023-01-31 10:53:28 +01:00
ocean (they/them)
199e5dbb1e Add option to print filenames in GDScript unit testing 2023-01-30 22:20:45 -05:00
Rémi Verschelde
dc7fb30485
Merge pull request #72400 from vnen/gdscript-match-release-consistency
GDScript: Fix match branches return check on release
2023-01-30 20:27:12 +01:00
George Marques
65407dd42d
GDScript: Fix match branches return check on release
The check for existence of `return` only existed on debug builds for
match branches. This could lead on an invalid error after exporting. Now
this is checked on relase too, so it works the same as the editor.
2023-01-30 15:18:36 -03:00
Dmitrii Maganov
011b3895db GDScript: Fix vararg method calls with exact arguments 2023-01-30 19:38:07 +02:00
Rémi Verschelde
af57bdb193
Merge pull request #72305 from dalexeev/gfs-fix-export-enum
GDScript: Fix `@export_enum` works only with `int`
2023-01-30 14:47:12 +01:00
Danil Alexeev
be4f36b87e
Remove @GDScript.str (duplicate of @GlobalScope.str) 2023-01-30 14:29:07 +03:00
Danil Alexeev
d4b78c352f
GDScript: Fix @export_enum works only with int 2023-01-30 12:30:37 +03:00
Rémi Verschelde
a2817eca03
Merge pull request #72175 from dalexeev/gds-fix-export-group-annotations
GDScript: Fix broken export group annotations
2023-01-30 10:00:54 +01:00
MinusKube
2b60d9d6e1 Fix unreachable code warning for elif block 2023-01-29 20:29:23 +01:00
Haoyu Qiu
5a283bdbcd Allow unicode identifier in GDScript syntax highlighter 2023-01-29 13:17:05 +08:00
Rémi Verschelde
a3dae9e548
Merge pull request #72285 from vnen/gdscript-variable-match
GDScript: Allow variables in match patterns
2023-01-29 02:45:48 +01:00
Rémi Verschelde
9420116f6c
Merge pull request #72286 from vnen/gdscript-native-static-call-crash
GDScript: Avoid calling non-static methods on native classes
2023-01-29 02:23:55 +01:00
Rémi Verschelde
4011a0915e
Merge pull request #71844 from vonagam/fix-constant-conversions
GDScript: Fix constant conversions
2023-01-29 02:18:57 +01:00
George Marques
aee7b7363b
GDScript: Avoid calling non-static methods on native classes 2023-01-28 20:33:01 -03:00
George Marques
c68b2358d5
GDScript: Allow variables in match patterns
To restore an ability available in 3.x and reduce compatibility changes.
2023-01-28 19:53:27 -03:00
Dmitrii Maganov
31e0ae2012 GDScript: Fix constant conversions 2023-01-29 00:01:53 +02:00
Dmitrii Maganov
6194a7e0fa GDScript: Fix implicit conversions for function returns 2023-01-28 23:56:07 +02:00
Rémi Verschelde
218bef90af
GDScript: Fix test from #69163 after annotations change 2023-01-28 17:01:19 +01:00
Rémi Verschelde
cc6e8379d4
Merge pull request #69163 from vonagam/variant-safe-lines
GDScript: Fix wrong marking of some lines related to Variant as unsafe
2023-01-28 15:40:19 +01:00
Danil Alexeev
1d68ce2cce
GDScript: Fix broken export group annotations 2023-01-27 16:25:15 +03:00
Dmitrii Maganov
abe6d67232 GDScript: Fix test for read-only state of constants 2023-01-27 05:28:08 +02:00
Rémi Verschelde
a5c211641f
Merge pull request #71634 from dalexeev/gds-annotations-analyzer
GDScript: Allow constant expressions in annotations
2023-01-26 01:07:00 +01:00
Rémi Verschelde
944b44243d
Merge pull request #72008 from vonagam/fix-property-access-unsafe-mark
GDScript: Fix marking of line with unsafe property access as unsafe
2023-01-26 01:04:57 +01:00
Danil Alexeev
b004f8180e
GDScript: Allow constant expressions in annotations 2023-01-25 18:43:56 +03:00
George Marques
e93266b9ff
Merge pull request #71120 from jordigcs/ternary
Closes https://github.com/godotengine/godot/issues/71065
2023-01-25 12:23:11 -03:00
Rémi Verschelde
41e5f5b093
Merge pull request #71349 from vonagam/disallow-infer-on-weak
GDScript: Disallow type inference with untyped initializer
2023-01-25 14:42:20 +01:00
Dmitrii Maganov
3c308f42e2 GDScript: Fix marking of line with unsafe property access as unsafe 2023-01-25 01:45:40 +02:00
jordi
bb9a00889a Add hint for identifiers renamed since Godot 3 2023-01-24 12:33:55 -06:00
Danil Alexeev
13215638a9
Clarify error message about script-level annotation 2023-01-24 13:10:45 +03:00
George Marques
ba9491f870
Merge pull request #70948 from vnen/gdscript-ptr-method-name-in-debug 2023-01-23 12:24:15 -03:00
Rémi Verschelde
81fe3715b8
Merge pull request #71914 from vnen/gdscript-no-continue-match
GDScript: Remove function of `continue` for match statement
2023-01-23 15:35:55 +01:00
George Marques
80e06b29e7
GDScript: Add names for disassembling function pointers
When instructions use function pointers, it's not possible to retrieve
their original names in the disassembly. This stores the names in
vectors (in debug builds) so they can be shown.
2023-01-23 11:04:31 -03:00
Rémi Verschelde
5726bf578d
Merge pull request #71676 from vnen/gdscript-unicode-identifiers
Add support for Unicode identifiers in GDScript and Expression
2023-01-23 10:24:33 +01:00
George Marques
9462ae4783
GDScript: Remove function of continue for match statement
The keyword is confusing and rarely is used in the intended way. It is
removed now in favor of a future feature (pattern guards) to avoid
breaking compatibility later.
2023-01-22 18:45:24 -03:00
George Marques
7548e043fc
Add support for Unicode identifiers in GDScript
This is using an adapted version of UAX#31 to not rely on the ICU
database (which isn't available in builds without TextServerAdvanced).
It allows most characters used in diverse scripts but not everything.
2023-01-21 13:39:40 -03:00
Rémi Verschelde
ebd0b40f6e
Merge pull request #71687 from reduz/support-script-class-name-in-efs
Support script global resource name in EditorFileSystem
2023-01-21 16:54:23 +01:00
Juan Linietsky
dddd8d43f6 Support script global resource name in EditorFileSystem
* Works for binary and text files.
* Makes EditorQuickOpen work with custom resources again.
* Information is cached and easily accessible.

Properly fixes #66179. Supersedes #66215 and supersedes #62417

**WARNING**: This required breaking backwards binary compatibility (.res and .scn files). Files saved after this PR is merged will no longer open in any earlier versions of Godot.
2023-01-21 14:19:27 +01:00
Adam Wardell
e9d8c261a5 call update_exports from LSP didSave function
exports in the inspector were not properly appearing when a gdscript was saved using an external IDE
this commit adds a call to GDScript::UpdateExports toward the end of GDScriptTextDocument::didSave
2023-01-20 19:16:53 -08:00
George Marques
7e5c2f945d
Remove references to compiled GDScript in export
This feature was removed from GDScript so it should not be present on
the interface nor in the saved export presets.
2023-01-20 15:09:07 -03:00
jordi
2e488072d0 Allow standalone ternary expressions 2023-01-19 14:27:57 -06:00
Adam Scott
807b7ed557 Update @icon definition to add a note 2023-01-18 19:48:01 -05:00
ocean (they/them)
4854e723be Fix unnammed enum crash regression 2023-01-18 09:35:48 -05:00
Rémi Verschelde
4005fc4b8d
Merge pull request #71279 from vonagam/fix-iterator-number-type
GDScript: Fix typing of iterator in for loop
2023-01-16 22:21:26 +01:00
Rémi Verschelde
1c3653e083
Merge pull request #67774 from aaronfranke/script-annotations
Make script annotations be placed before `class_name` and `extends`
2023-01-16 22:20:44 +01:00
Rémi Verschelde
585a934454
Merge pull request #71434 from adamscott/fix-reduce-identifier-from-base-class-script-retrieval
Fix cyclic reference errors while reducing identifiers
2023-01-16 22:15:21 +01:00
George Marques
629796c333
Merge pull request #69970 from poohcom1/fix/autocomplete-custom-class
Fixes https://github.com/godotengine/godot/issues/69941
2023-01-16 09:44:23 -03:00
Adam Scott
48e041458f Fix cyclic reference errors while reducing identifiers.
Co-authored-by: Dmitrii Maganov <vonagam@gmail.com>
2023-01-15 19:19:25 -05:00
poohcom1
2e53bf3d36 Fix code-completion suggesting non-static members
In GDScript code-completion:
 - Fixes class symbols not being marked as meta
 - Remove signal in static contexts

Fixes #69928
2023-01-16 00:41:20 +07:00
poohcom1
aa4bceff3e Add identifier completion for custom classes.
Previously, custom class would only auto-complete for types in GDScript.
This applies it to identifiers as well.
2023-01-16 00:25:24 +07:00
Yuri Sizov
4c1f11944e Update all outdated online documentation links 2023-01-14 19:38:00 +03:00
Yuri Rubinsky
9bd5ef1836 Fix GDScript script templates to use a PascalCase style for _CLASS_ 2023-01-14 16:21:05 +03:00
Dmitrii Maganov
a1e0281b45 GDScript: Disallow type inference with untyped initializer 2023-01-13 20:51:29 +02:00
Rémi Verschelde
ef01b49227
Merge pull request #71329 from vnen/gdscript-fix-enum-value-resolution
GDScript: Fix infinite recursion in resolution of enum values
2023-01-13 18:02:58 +01:00
Rémi Verschelde
4c2dea108e
Merge pull request #70540 from vaartis/multiline-arrays-dictionaries
Implement export_multiline support for Array[String] and Dictionary
2023-01-13 18:01:55 +01:00
Dmitrii Maganov
40613ebd21 GDScript: Fix typing of iterator in for loop 2023-01-13 15:36:11 +02:00
George Marques
3a5e41293c
GDScript: Fix infinite recursion in resolution of enum values 2023-01-13 10:17:30 -03:00
Rémi Verschelde
aaa5158ff9
Merge pull request #70733 from vonagam/fix-assigning-untyped
GDScript: Fix some issues with assignments that involve untyped things
2023-01-12 20:08:55 +01:00
Rémi Verschelde
40b9c246b6
Merge pull request #71197 from adamscott/add-default-virtual-path-gdscript
Add default virtual `gdscript://` path to `GDScript` instances
2023-01-12 17:56:09 +01:00
Rémi Verschelde
def592114f
Merge pull request #70700 from vonagam/fix-abstract-extends
GDScript: Fix extending abstract classes, forbid their construction
2023-01-12 17:19:51 +01:00
Dmitrii Maganov
274d49790d GDScript: Fix extending abstract classes, forbid their construction 2023-01-12 17:47:10 +02:00
Adam Scott
e3e55b29ce Add default virtual gdscript:// path to GDScript instances 2023-01-12 10:27:38 -05:00
Dmitrii Maganov
ef81b344be GDScript: Fix wrong marking of some lines related to Variant as unsafe 2023-01-12 17:21:33 +02:00
Dmitrii Maganov
38c214d483 GDScript: Fix some issues with assignments that involve untyped things 2023-01-12 17:07:45 +02:00
Rémi Verschelde
c6f4c0ac54
Merge pull request #70899 from adamscott/fix-vector-inf
Fix parse error using Vector{2,3,4}.INF
2023-01-12 15:59:01 +01:00
Dmitrii Maganov
5980abbcec GDScript: Fix getting type from PropertyInfo for Variant arguments 2023-01-12 16:47:06 +02:00
George Marques
75515e4303
Merge pull request #70987 from vonagam/fix-parameter-conversion-assign 2023-01-12 11:34:13 -03:00
George Marques
7319fa6082
Merge pull request #70713 from vonagam/fix-unnamed-enum-outer-conflicts 2023-01-12 11:22:01 -03:00
Dmitrii Maganov
0f184379de GDScript: Fix small inconsistencies with resolve_datatype 2023-01-12 15:52:55 +02:00
George Marques
66fda2aeea
GDScript: Fix temp values being written without proper clear
Temporary values in the stack were not being properly cleared when the
return value of calls were discarded, which can cause memory issues
especially for reference types like PackedByteArray.
2023-01-11 14:24:23 -03:00
Rémi Verschelde
5eb161a9c8
Merge pull request #70595 from adamscott/add-gdscript-editorconfig
Add GDScript `.editorconfig` rules
2023-01-11 01:10:10 +01:00
George Marques
04d0e851ea
GDScript: Fix use of conversion assign for variant values 2023-01-10 20:01:11 -03:00
Adam Scott
44d1d72af1 Add GDScript .editorconfig rules
- Uniformize `.gd` unit test files indentation to tabs (where needed)
2023-01-10 12:25:35 -05:00
Rémi Verschelde
c894edd4cb
Merge pull request #71140 from vonagam/fix-const-index-subscript-type
GDScript: Fix type for index subscript on constant
2023-01-10 07:58:29 +01:00
Dmitrii Maganov
ff505c9875 GDScript: Fix type for index subscript on constant 2023-01-10 07:10:00 +02:00
Adam Scott
fb175d92da Fix GDScript base and outer classes, signals and functions lookup order
- Add outer class lookup test
- Add signal lookup test

Co-authored-by: Dmitrii Maganov <vonagam@gmail.com>
2023-01-09 20:12:10 -05:00
Rémi Verschelde
d3fc9d9e41
Merge pull request #71051 from vonagam/consts-are-deep-start
GDScript: Begin making constants deep, not shallow or flat
2023-01-09 23:22:59 +01:00
Rémi Verschelde
509da86205
Merge pull request #69590 from anvilfolk/enums
GDScript enum fixes & refactor
2023-01-09 23:10:37 +01:00
ocean (they/them)
366ec895b1 Assorted enum and native type fixes 2023-01-09 11:08:07 -05:00
Rémi Verschelde
df952a32f8
Merge pull request #71107 from vnen/gdscript-fix-nil-address-assign
GDScript: Don't use the NIL address to hold return value of functions
2023-01-09 14:22:16 +01:00
Rémi Verschelde
c2f7c2d31a
Merge pull request #70655 from vonagam/fix-assert-multiline
GDScript: Fix multiline and trailing comma for assert
2023-01-09 14:19:37 +01:00
George Marques
a1309f1f42
GDScript: Allow using await on calls to void functions 2023-01-09 09:55:05 -03:00
George Marques
a3816434a6
GDScript: Don't use the NIL address to hold return value of functions
This prevents that the NIL address is filled with another value, which
causes problems for some instructions that read from NIL.
2023-01-09 09:20:18 -03:00
Rémi Verschelde
b6be2ac621
Merge pull request #71028 from adamscott/make-gdscript-clear-less-prone-to-heap-use-after-free
Resolve `GDScript::clear()` `heap-use-after-free` ASAN errors
2023-01-09 09:22:39 +01:00
Adam Scott
c45b9245ae Fix parse error using Vector{2,3,4}.INF 2023-01-08 16:14:40 -05:00
Dmitrii Maganov
71f7c8a9d3 GDScript: Fix multiline and trailing comma for assert 2023-01-08 20:18:46 +02:00
Dmitrii Maganov
5e2ac1a31e GDScript: Begin making constants deep, not shallow or flat 2023-01-08 07:29:10 +02:00
jordi
d5e1b4a857 Force double quotes for NodePaths with apostrophes 2023-01-07 20:23:26 -06:00
Adam Scott
d22199990e Resolve GDScript::clear() heap-use-after-free ASAN errors 2023-01-07 11:51:36 -05:00
Rémi Verschelde
163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
Dmitrii Maganov
532ffc30bd GDScript: Fix typing of lambda functions 2023-01-06 16:38:22 +02:00
Dmitrii Maganov
a8c2f8a0e1 GDScript: Fix missing conversion for default argument values 2023-01-06 11:49:06 +02:00
Dmitrii Maganov
10e364bf43 GDScript: Fix array as default value for parameter 2023-01-06 06:25:55 +02:00
Dmitrii Maganov
a1d06749f1 Unify typing of variables, constants and parameters in GDScript 2023-01-06 01:10:04 +02:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Rémi Verschelde
fc4a734373
Merge pull request #70838 from reduz/gdscript-vm-optimization
Optimizations for GDScript VM
2023-01-05 12:57:31 +01:00
Rémi Verschelde
dc3175e4cd
Merge pull request #70810 from adamscott/cache-gdscript-even-when-error
Cache script when reloading even if there's errors
2023-01-04 11:41:11 +01:00
Rémi Verschelde
8203e09330
Merge pull request #70859 from vonagam/fix-preload-native-type
GDScript: Fix wrong native type for preloaded class
2023-01-03 23:22:23 +01:00
Rémi Verschelde
26bed8aa85
Merge pull request #70875 from MewPurPur/stop-highlighting-invalid-node-refs
Stop NodeRef highlighting if you start with a number
2023-01-03 16:17:13 +01:00
VolTer
52cfd4551d Stop highlighting node refs if they are invalid identifiers 2023-01-03 16:00:16 +02:00