Commit graph

2034 commits

Author SHA1 Message Date
Rémi Verschelde
89eb6d372d
Merge pull request #57591 from vnen/gdscript-enum-fixes 2022-02-04 13:49:15 +01:00
bruvzg
244db37508
Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
Anilforextra
adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
George Marques
ceafdf347e
GDScript: Treat enum values as int and enum types as dictionary
Since enums resolve to a dictionary at runtime, calling dictionary
methods on an enum type is a valid use case. This ensures this is true
by adding test cases. This also makes enum values be treated as ints
when used in operations.
2022-02-03 13:32:34 -03:00
George Marques
b013c0d544
GDScript: Allow tests to run on release builds
- Fix compilation issues by disabling warnings on release builds. This
  also strips warnings from expected result before the comparison to
  avoid false mismatches.
- Add a `#debug-only` flag to tests. Must be the first line of the test
  script. Those won't run with release builds. Can be used for test
  cases that rely on checks only available on debug builds.
2022-02-03 13:32:33 -03:00
George Marques
ad6e2e82a9
GDScript: Consolidate behavior for assigning enum types
This makes sure that assigning values to enum-typed variables are
consistent. Same enum is always valid, different enum is always
invalid (without casting) and assigning `int` creates a warning
if there is no casting.

There are new test cases to ensure this behavior doesn't break in
the future.
2022-02-03 13:32:16 -03:00
trollodel
1d6ac42b2a Allow setting the PropertyInfo class_name from GDScript 2022-02-01 11:57:14 +01:00
bruvzg
8e79c5fb8d
Add support for the escaped UTF-16 and UTF-32 Unicode characters in the scripts and expressions. 2022-01-30 20:16:04 +02:00
Rémi Verschelde
e6caaf4c80
Merge pull request #57205 from TechnoPorg/variant-template-cast
Allow method binds to take Object subclasses as arguments
2022-01-27 23:46:37 +01:00
Rémi Verschelde
899cd34426
Merge pull request #57281 from Rubonnek/rename-subsequence 2022-01-27 11:03:13 +01:00
Wilson E. Alvarez
3eb5e0ac50
Rename String::is_subsequence_ofi to String::is_subsequence_ofn 2022-01-26 18:03:56 -05:00
cdemirer
28ac4d8b7d Fix crash with non-constant keys in match statement Dictionary pattern 2022-01-26 04:10:07 +08:00
TechnoPorg
051ef479c9 Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
2022-01-25 09:03:36 -07:00
K. S. Ernest (iFire) Lee
b69b526b7c GDScript cache crashfix. 2022-01-22 17:42:54 -08:00
Rémi Verschelde
e1706be25d
Merge pull request #57052 from KoBeWi/nosort 2022-01-23 00:27:01 +01:00
Rémi Verschelde
b5f524d4c0
Merge pull request #55433 from V-Sekai/prev_operand_nullptr_check
Check for nullptr expression in parse_precedence function
2022-01-22 20:31:45 +01:00
Rémi Verschelde
182a36db47
Merge pull request #55214 from Scony/fix-gdscript-crash-2
Fix GDScript parser crash on 'dollar mixed with assignment' expression
2022-01-22 20:30:54 +01:00
kobewi
f056cb8ebc Don't sort printed Dictionary 2022-01-22 13:45:02 +01:00
Pedro J. Estébanez
7b0ed2aa5e Rename Variant::is_ref() to is_ref_counted() 2022-01-20 18:46:25 +01:00
Rémi Verschelde
846c14eee9
Merge pull request #56739 from strank/master
GDScript: Fix parsing default parameter values from function calls
2022-01-17 21:38:01 +01:00
Rémi Verschelde
4cfade6212
Merge pull request #55995 from Xwdit/enum_fix
Fix enum int comparison
2022-01-17 20:20:16 +01:00
Rémi Verschelde
91909ef801
Merge pull request #55625 from cdemirer/fix-type-guessing-and-gdscript-parser-printing
Fix `--test gdscript-parser` crash
2022-01-17 20:17:02 +01:00
Rémi Verschelde
12ab19fa26
Merge pull request #55616 from cdemirer/master
Fix nested ternary-if codegen
2022-01-17 20:16:26 +01:00
Paulb23
fffeecfd68 Improvments for SyntaxHighlighters
- Fix immedate Funcion in lamba highlight
- Highlight signals as one colour
- Highlight node paths as one colour
- Highlight escape chars in strings
2022-01-15 15:39:55 +00:00
Rémi Verschelde
3efa6644c4
Merge pull request #55541 from KoBeWi/outcognito_scripts 2022-01-14 21:04:13 +01:00
luz paz
858bcd5058 Fix various typos
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inh,inout,leapyear,lod,nd,numer,ois,ony,paket,ro,seeked,sinc,switchs,te,uint,varn,vew`
2022-01-13 23:20:01 -05:00
strank
960a26f6c0 GDScript: Fix parsing default parameter values from function calls 2022-01-13 19:28:39 -05:00
Rémi Verschelde
f0382530a7
Merge pull request #56268 from KoBeWi/🚗complete_setters 2022-01-13 12:40:48 +01:00
kobewi
f524ddebd5 Make script type distinguishable by icon 2022-01-13 12:29:05 +01:00
SaracenOne
64d8b3aef2 Assign member type when parsing setters to prevent
'Compiler bug: unresolved assign' errors
2022-01-11 11:23:17 +00:00
Rémi Verschelde
b3513cffc5
Merge pull request #56326 from NNesh/fix/unknown_default_value_callable
Extended the _make_arguments_hint function to get default values for function arguments in hint
2022-01-10 21:29:13 +01:00
NNesh
374baff747 Fixed <unknown> text for callable default value for a function arguments hint
Format switch

Added a case for constant subscripts

Fixed default value hinting for the enum type

Removed is_null checking for value

Added a case for dictionary
2022-01-10 23:22:35 +05:00
Rémi Verschelde
49482966ec
Merge pull request #55715 from nathanfranke/enum-ordered 2022-01-10 17:19:52 +01:00
Rémi Verschelde
1989120d3f
Merge pull request #56194 from cdemirer/fix-operation-result-type-inference 2022-01-10 17:18:32 +01:00
Rémi Verschelde
4acc819f9b
Merge pull request #56232 from V-Sekai/invalid_explicit_variant_assign_fix 2022-01-10 17:12:56 +01:00
Rémi Verschelde
cc7f634066
Merge pull request #56260 from cdemirer/fix-type-mutation-upon-assignment-with-operation 2022-01-10 17:12:34 +01:00
Rémi Verschelde
c8b4fe3b8d
Merge pull request #56287 from cdemirer/fix-member-property-only-getter-cant-be-set 2022-01-10 17:12:06 +01:00
Rémi Verschelde
1fd5954962
Merge pull request #56288 from cdemirer/fix-member-property-getter-dont-update-subscript-chain-root 2022-01-10 17:10:57 +01:00
Rémi Verschelde
8f8c3f4b4c
Merge pull request #56342 from NNesh/fix/class-completion 2022-01-10 17:07:08 +01:00
Rémi Verschelde
b3d208385f
Merge pull request #56409 from cdemirer/fix-unexpected-copying-when-parameter-is-typed 2022-01-10 17:03:47 +01:00
Ger Hean
609964848d Fix leak when function returning self type
Leak is caused by cyclic reference
2022-01-10 02:14:48 +08:00
NNesh
1a1ee43e3e Fixed completion showing for class members 2022-01-08 01:49:18 +05:00
Rémi Verschelde
393a44b275
Merge pull request #55213 from Scony/fix-gdscript-crash 2022-01-06 20:54:03 +01:00
bruvzg
c69e0d16bc
Fix multiple missing UTF-8 decoding. 2022-01-06 14:35:22 +02:00
Yuri Roubinsky
21cfcaa129 Add a GDScript template for VisualShaderNodeCustom 2022-01-06 12:06:33 +03:00
Rémi Verschelde
6d4ed65f4c
Merge pull request #56483 from vnen/gdscript-warning-annotation
Add annotation to ignore warnings
2022-01-05 09:05:56 +01:00
George Marques
fd643c903d
GDScript: Add annotation to ignore warnings 2022-01-04 09:32:43 -03:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Rémi Verschelde
98b3ba1842
Merge pull request #53957 from fabriceci/new-template-workflow 2022-01-03 20:40:33 +01:00
cdemirer
3033e0f8a2 Fix gdscript-parser crash
Fixes gdscript-parser crashing while printing empty identifiers.
2022-01-03 08:47:18 +08:00
fabriceci
9d5b807059 Improve editor template workflow
Co-Authored-By: jmb462 <jmb462@gmail.com>
2022-01-02 21:52:09 +01:00
luz paz
a124f1effe Fix various typos
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn`
Update editor/import/resource_importer_layered_texture.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update doc/classes/TileSetScenesCollectionSource.xml

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/graph_edit.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/rich_text_label.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Revert previously committed change
2022-01-02 01:03:58 -05:00
cdemirer
511e699fee Fix unexpected Packed Array copying when parameter is typed 2022-01-02 05:43:52 +08:00
cdemirer
bb9469aa65 Fix member properties with getters don't update as subscript chain root 2021-12-28 07:52:44 +08:00
cdemirer
e8305e17ff Fix member properties with only getters can't be set 2021-12-28 07:51:18 +08:00
kobewi
c055c912fb Remove autocomplete_setters_and_getters setting 2021-12-27 00:48:32 +01:00
cdemirer
067b4c8c07 Fix type mutation upon compound assignment 2021-12-27 03:32:22 +08:00
SaracenOne
b22c805dbe Fix 'Compiler bug: unresolved assign' on explicitly annotated variants. 2021-12-25 00:53:57 +00:00
cdemirer
455cc07f90 Fix operation result type inference 2021-12-23 20:45:24 +08:00
Nathan Franke
b5b75cad43
Use OrderedHashMap for enum_values 2021-12-16 21:49:42 -08:00
Xwdit
0430e26e6d Fix enum int comparison
Fix enum int comparison
2021-12-16 16:14:14 +01:00
Gilles Roudière
ab8119b5f6 Avoid a crash in the gdscript analyser 2021-12-14 15:54:25 +01:00
Yuri Roubinsky
566895732c Fix shadowed global identifier warning duplication 2021-12-13 11:54:23 +03:00
Rémi Verschelde
f19a1e28c8
Revert "Fix auto reload scripts on external change" 2021-12-10 22:40:20 +01:00
cdemirer
1cf3f382ba Fix "Lookup Symbol" on global class members
"Lookup Symbol" on global class members now does switch to the relevant script.
2021-12-10 19:56:46 +08:00
Rémi Verschelde
bdf8340e59
Merge pull request #43181 from nathanfranke/string-empty
Replace String comparisons with "", String() to is_empty()
2021-12-10 08:56:31 +01:00
Rémi Verschelde
012b2b5385
Merge pull request #55700 from Razoric480/raz/lsp-extraneous-code 2021-12-09 13:12:49 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Rémi Verschelde
1a8741aaca
Merge pull request #49473 from cptchuckles/fix-auto-reload-scripts 2021-12-09 10:06:22 +01:00
Francois Belair
ad01201f34 Remove extraneous return to LSP 2021-12-07 12:37:11 -05:00
Rémi Verschelde
be975e5d18
Merge pull request #55624 from Razoric480/raz/cs-lsp-signal 2021-12-06 17:46:25 +01:00
Nathan Franke
de7873c2d8
Auto-Increment Debugger Port
Note: This PR also changes the port of the GDScript Language Server from 6008 to 6005. This opens enough ports above the debug port (6007) for this change to be useful.
2021-12-04 15:25:13 -06:00
Francois Belair
66f1b4bf66 Prevent LSP adding signal func to non GDScripts 2021-12-04 10:58:05 -05:00
cdemirer
6204d956b8 Fix nested ternary-if codegen (#55582) 2021-12-04 10:12:02 +08:00
Raul Santos
c3fb5ff359 Fix typo in gdscript_parser 2021-12-03 21:47:27 +01:00
Rémi Verschelde
7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
SaracenOne
3eec759e87 Check for nullptr expression in parse_precedence function 2021-11-29 11:29:15 +00:00
Yuri Roubinsky
ce48604eb7 Enchance descriptions of @GlobalScope/@GDScript 2021-11-25 14:24:09 +03:00
Lightning_A
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Rémi Verschelde
3ba2d17d2f
Merge pull request #54949 from Chaosus/fix_warning 2021-11-23 15:15:36 +01:00
kobewi
4682f22293 Improve various texts 2021-11-23 12:20:57 +01:00
Pawel Lampe
1a15a3adf6 Fix GDScript parser crash on 'dollar mixed with assignment' expression
fixes #53696
2021-11-21 21:18:46 +01:00
Pawel Lampe
4a5d98c987 Fix godot crash on null expression, fixes #53862 2021-11-21 20:58:52 +01:00
Pawel Lampe
86c0e38e8f Fix 'unreachable-code' false-positive, fixes #55154 2021-11-21 15:53:21 +01:00
kobewi
ca4c63d654 Always soft-reload scripts 2021-11-19 17:45:16 +01:00
Rémi Verschelde
6c1bd4d227
Replace Godot docs URL with $DOCS_URL in XML class reference 2021-11-15 13:02:21 +01:00
Yuri Roubinsky
3396b25489 Allow using built-in names for variables, push warnings instead 2021-11-13 21:47:24 +03:00
Rémi Verschelde
88c4380737
Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
kobewi
3b320cd9fe Show built-in script names in the debugger 2021-11-11 20:47:09 +01:00
bruvzg
74b9892f7a [GDScript] Check string literals for Unicode direction control characters. 2021-11-11 15:41:59 +02:00
Rémi Verschelde
e8870ddefc
Merge pull request #54676 from Chaosus/gds_restrict_names 2021-11-10 15:20:44 +01:00
Rémi Verschelde
92ae349668
Merge pull request #54358 from Shawak/feature-allow-root-node-paths-without-quote 2021-11-10 15:19:17 +01:00
Maximilian
c7a8e047cc Allow using $/root node paths
format

fix shadowing

use match instead of comparison

Update gdscript_parser.cpp
2021-11-09 18:46:28 +01:00
Hugo Locurcio
605784f019
Remove hash symbol in front of opcode error messages in GDScript
The hash symbol creates spurious issue references on GitHub if
the message is posted outside a code block, which means some issues
have a lot more references than originally intended.
2021-11-09 12:20:16 +01:00
Rémi Verschelde
236fd3305b
Merge pull request #54473 from briansemrau/no-debug-functions-on-thread 2021-11-08 19:37:48 +01:00
Yuri Roubinsky
95f6f3c756 Prevent identifiers from naming as built-in funcs and global classes 2021-11-08 21:35:31 +03:00
Rémi Verschelde
78ed2c05a2
Merge pull request #54118 from Pineapple/dont-ignore-type-mismatch-in-setter-master 2021-11-08 19:26:27 +01:00
Francois Belair
4995a477ff Fix LSP crash when parsing signal symbols.
If the number of parameters was less than the number of class members, the LSP would cause godot to crash because it was using the index for class members instead of the index for signal parameters.

Fixes #54720 .
2021-11-07 12:20:25 -05:00
Hugo Locurcio
c012fbc8b2
Rename PROPERTY_USAGE_NOEDITOR to PROPERTY_USAGE_NO_EDITOR
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
Rémi Verschelde
5efb11926d
Merge pull request #54346 from mhilbrunner/used-what-instead-of-what 2021-11-02 08:48:58 +01:00
Brian Semrau
d3051b2637 GDScript gracefully handle debug functions from separate thread 2021-11-01 12:13:25 -04:00
Aaron Franke
6772ebcea0
Move the docs for constructors and operators out of methods section 2021-10-29 12:34:57 -05:00
Rémi Verschelde
f7d852b532
Merge pull request #54350 from akien-mga/clang-format-dont-align-operands 2021-10-28 17:10:52 +02:00
Rémi Verschelde
6b090e325a
Merge pull request #53526 from KoBeWi/super_print 2021-10-28 15:47:52 +02:00
Rémi Verschelde
3a6be64c12
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde
3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
Max Hilbrunner
626ca50676 Improve GDScript indentation error message 2021-10-28 13:01:53 +02:00
reduz
d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
Bartłomiej T. Listwon
42cce2891f Don't ignore the type mismatch in setter function 2021-10-22 12:44:33 +02:00
Marcel Admiraal
87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
Rémi Verschelde
4387f9645b
Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
Benjamin Navarro
560d9a4cc0 Fix incorrect debug check for setters
the check read the return type of the setter, which doesn't exist and
lead to a segmentation fault. Now we check the first function parameter.
Probably a bad copy/paste of the getter case
2021-10-18 09:01:16 +02:00
opl-
ad14b80e2a Fix name used instead of doc for GDScript signals 2021-10-17 05:54:27 +02:00
Rémi Verschelde
08d1ce718d
Merge pull request #53856 from vnen/gdscript-setter-crash 2021-10-15 21:35:42 +02:00
George Marques
b0725a3b7d
GDScript: Avoid crash if missing setter signature 2021-10-15 15:53:24 -03:00
Rémi Verschelde
3f888966c0
Merge pull request #53843 from vnen/gdscript-typed-array-subscript-constant
Fix inferred typed array marked as constant
2021-10-15 16:49:29 +02:00
George Marques
540821a264
GDScript: Fix inferred typed array marked as constant 2021-10-15 10:40:50 -03:00
George Marques
84abb9a76c
GDScript: Fix typing for await expression
Don't grab the type of the awaited value unless it's constant (which
makes it synchronous) or call (which always use the proper return type).
2021-10-14 20:30:06 -03:00
George Marques
749d89ae38
GDScript: Remove error when coroutine is called without await
In the case the call happens as a statement, since the return value
isn't used in this case.
2021-10-14 20:12:01 -03:00
George Marques
056a54db7b
GDScript: Properly return value with await on non-coroutine
If the keyword `await` is used without a coroutine, it should still
return the value synchronally.
2021-10-14 19:58:10 -03:00
George Marques
d36213bab8
GDScript: Make sure calls don't use return when not needed 2021-10-14 19:55:45 -03:00
Rémi Verschelde
472ff40f71
Merge pull request #53807 from vnen/dont-share-arrays-and-dicts 2021-10-14 20:42:22 +02:00
George Marques
4c14051b3f
Zero Dictionary and Array variants when changing type with reset
So they don't reference to the old values anymore and instead refer to
a new value.
2021-10-14 11:22:17 -03:00
George Marques
bf322bacdd
Merge pull request #53726 from briansemrau/gd-outer-class
GDScript 2.0: Access outer scope classes
2021-10-14 10:12:52 -03:00
Gilles Roudière
0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Brian Semrau
0ff0f64cd4 GDScript: Access outer scope classes 2021-10-13 22:39:12 -04:00
Rémi Verschelde
e4288bf728
Merge pull request #53720 from vnen/gdscript-typed-array-custom-class 2021-10-12 16:51:50 +02:00
George Marques
34288b24a6
GDScript: Fix typed array with custom classes 2021-10-12 10:41:04 -03:00
George Marques
45f546c1d8
GDScript: Make setter parameter type same as variable type 2021-10-12 09:39:23 -03:00
Yuri Roubinsky
188e08307e
Merge pull request #53647 from Chaosus/gds_fix_builtin_functions_autocompletion 2021-10-11 20:29:43 +03:00
Yuri Roubinsky
e270d1cce3 Fix autocompletion of built-in functions in GDScript 2021-10-11 19:06:17 +03:00
George Marques
a6414b34e9
Merge pull request #53430 from DavidSichma/typed_safe_setter
Made typed member setters safe
2021-10-11 11:16:19 -03:00
George Marques
f930d54140
Merge pull request #53103 from ZuBsPaCe/gdscript-analyze-properties-fix
GDScript: Report property type errors
2021-10-11 11:01:39 -03:00
Yuri Sizov
41e271af6e Remove redundant String operation from GDScript enum exports 2021-10-11 02:11:32 +03:00
mashumafi
575d4e00b6 Enhance and cleanup stringify for Vector 2021-10-09 06:19:25 +00:00
David Sichma
d28f2ee7a5
Only emit typed member setters if safe to do so
Instructions are now only emitted if input type matches expected type.
Otherwise usual setter fallback.
2021-10-08 23:54:55 +02:00
ZuBsPaCe
551ceb590b GDScript: Report property type errors
Inline getters & setters are now FunctionNodes.
Their names are set in the parser, not in the compiler.
GDScript-Analyzer will now run through getter and setter.
Also report wrong type or signature errors regarding getset properties.
Added GDScript tests for getters and setters.
#53102
2021-10-08 22:06:15 +02:00
Max Hilbrunner
5733c13f53
Merge pull request #53536 from Faless/mp/4.x_rpc_config
[Net] Add call_local argument to Node.rpc_config.
2021-10-08 14:15:01 +02:00
George Marques
b010f96c89
Merge pull request #53336 from briansemrau/gdscript-i'm-not-my-own-local-class
[GDScript 2.0] fix script base class self-assignment
2021-10-08 09:10:19 -03:00
Fabio Alessandrelli
54ec66a700 [Net] Rename RPCConfig.sync to call_local.
For consistency with the other user facing changes.
2021-10-08 12:39:09 +02:00
George Marques
3a856b4fcc
GDScript: Use getter return type for the property type
The PropertyInfo hints are more relevant for the inspector. The getter
return type is more reliable and less likely to be incorrect and it is
what's going to be called in the end.
2021-10-07 20:22:19 -03:00
Rémi Verschelde
49e7e049ab
Merge pull request #53422 from KoBeWi/add_LUA_to_Godot 2021-10-07 23:37:37 +02:00
George Marques
082f624ef4
GDScript: Fix method ptrcall on release 2021-10-07 15:08:21 -03:00
kobewi
31012fd060 Change print_line() to use any number of Variants 2021-10-07 16:28:22 +02:00
Rémi Verschelde
6eb2094d4d
Merge pull request #53494 from mhilbrunner/stop-drop-and-dont-lie
Fix outdated no_call_local, use call_remote
2021-10-07 08:29:25 +02:00
George Marques
dfe3a2fad0
GDScript: Set status on parsing steps beforehand
To avoid potential dependency cycles. If any happens it will not get
into infinite recursion anymore and errors will cascade later on.
2021-10-06 21:24:27 -03:00
Max Hilbrunner
44b68f08b4 Fix outdated no_call_local, use call_remote 2021-10-06 23:51:57 +02:00
Rémi Verschelde
98b81ad35c
Merge pull request #53479 from vnen/gdscript-subscript-object-self 2021-10-06 19:48:23 +02:00
Rémi Verschelde
ba0a103e29
Merge pull request #53478 from vnen/gdscript-avoid-hard-inference 2021-10-06 19:31:56 +02:00
George Marques
1f55bd190c
GDScript: Allow subscript on self and object types 2021-10-06 12:01:34 -03:00
George Marques
6bdb28f5e4
GDScript: Avoid hard errors on inferred types
Since inference isn't always correct, they are now treated as unsafe
instead of errors.

This also removes inferred type when a variable is reassigned. Since
it's not aware of branching, the types might become invalid in a later
context.
2021-10-06 11:42:19 -03:00
George Marques
d6c799006a
GDScript: Make all warnings enabled in test generation
The test generation doesn't initialize the language (since it's already
initialized in main), but it still needs the warning enabled so it
matches the actual tests.
2021-10-06 11:39:00 -03:00
Rémi Verschelde
862994a8ef
doc: Update links to latest documentation after content reorganization 2021-10-06 13:48:48 +02:00
kobewi
9e5fdbc79d Fix LUA-style assignment in Dictionary 2021-10-05 12:17:13 +02:00
Brian Semrau
c18a27a9cd GDScript fix wrong base class assignment 2021-10-04 20:38:08 -04:00
George Marques
7725ebf3d2
GDScript: Use path cache when checking preloaded scripts
The path itself might not always be set in some cases, especially when
the script is just created and is already in the resource cache. Using
get_path() in this case gets the correct resource path.

This also adds a null check for safety in case the path is incorrect or
missing, to avoid a crash in the engine.
2021-10-04 20:48:39 -03:00
George Marques
84956fee4b
GDScript: Fix member assignment with operation
It was wrongly updating the assigned value with the result of the
operation.
2021-10-04 14:09:54 -03:00
Rémi Verschelde
bb201c5887
Merge pull request #53303 from akien-mga/53295-gdscript-completion-quote-style 2021-10-04 17:17:27 +02:00
Rémi Verschelde
4a4995524c
Merge pull request #53338 from briansemrau/gdscript-handle-for-with-null-list 2021-10-04 17:11:43 +02:00
Rémi Verschelde
b85dfd990e
GDScript completion: Handle quote style ad-hoc to remove editor dependency
`core` and `scene` shouldn't depend on `editor`, so they can't query this style
setting in `get_argument_options`. But we can handle it after the fact in
GDScript's completion code.

Also cleans up a couple extra unused invalid includes in `core`.
2021-10-04 16:16:05 +02:00
kobewi
cb28469281 Allow void as return type for constructors 2021-10-03 21:16:54 +02:00
Brian Semrau
dc046e5cbe GDScript Check for null list in for loop 2021-10-02 13:53:56 -04:00
Fabio Alessandrelli
366e374f76
Merge pull request #53290 from Faless/mp/4.x_opts_names
[Net] Rename RPC constants and annotation arguments.
2021-10-01 21:35:08 +02:00
Fabio Alessandrelli
24a949ea11 [Net] Rename RPC constants and annotation arguments.
any -> any_peer
sync -> call_local
ordered -> unreliable_ordered

Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER
Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
2021-10-01 18:14:38 +02:00
Francois Belair
572979d011 Fix empty line hover; fix open non-res:// script 2021-10-01 11:26:26 -04:00
Rémi Verschelde
06c1b40b84
Merge pull request #38397 from Calinou/doc-range-backwards-example 2021-10-01 11:58:30 +02:00
Lightning_A
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Hugo Locurcio
810d8f06b7
Add an example on iterating an array backwards
This closes https://github.com/godotengine/godot-docs/issues/3472.
2021-09-30 20:29:57 +02:00
Rémi Verschelde
d2b8560d7a
Revert "GdScript: Use reduced constant expression result when doing binary operations. Fixes #50293"
This reverts commit 6207708607.

It broke a GDScript test (which didn't exist back when the PR was made,
so was missed prior to the merge).

It choked on:
```
prints("a", test_instance.a, test_instance.a == Named.VALUE_A)
```
With:
```
Invalid operands "VALUE_A (enum value)" and "int" for "==" operator.
```
2021-09-30 18:57:59 +02:00
Rémi Verschelde
7f8e50801e
Merge pull request #51818 from MarianoGnu/gdscript2-enum-fixes 2021-09-30 18:35:49 +02:00
Rémi Verschelde
27d4e2f09f
Merge pull request #53216 from vnen/gdscript-builtin-type-not-id 2021-09-29 17:04:24 +02:00
George Marques
72c07708e8
GDScript: Don't allow builtin type names as identifiers 2021-09-29 11:23:16 -03:00
George Marques
991f4d8527
GDScript: Fix assignment with operation for properties 2021-09-29 10:54:16 -03:00
Rémi Verschelde
c1f59139b4
Merge pull request #53092 from Razoric480/lsp-report-_init 2021-09-29 15:47:31 +02:00
Francois Belair
7468dd65a5 Make LSP report _init instead of Object::new 2021-09-29 08:42:01 -04:00
Rémi Verschelde
ea0a9e6ed3
Merge pull request #52800 from akien-mga/gdscript-remove-exp_range 2021-09-29 13:33:59 +02:00
Pedro J. Estébanez
0fa574c051 Fix check for freed object during cast 2021-09-27 19:35:26 +02:00
Pedro J. Estébanez
ee238b2a4d Fix inverted error messages about null object 2021-09-27 13:58:46 +02:00
Francois Belair
044daf9b8d Remove duplicate WorkspaceEdit from LSP 2021-09-25 15:17:19 -04:00
Rémi Verschelde
14dcb97556
Merge pull request #50378 from Razoric480/apply-edit-40 2021-09-25 20:43:17 +02:00
Rémi Verschelde
0abe464162
Merge pull request #52849 from KoBeWi/know_no_binds 2021-09-25 00:10:56 +02:00
kobewi
7bf5fc709e Remove binds from Signal.connect 2021-09-24 17:07:33 +02:00
Rémi Verschelde
679f70c1e1
Merge pull request #52906 from vnen/gdscript-show-error-on-yield 2021-09-21 20:36:39 +02:00
Rémi Verschelde
b3b4860d2e
Merge pull request #52905 from vnen/gdscript-single-line-declaration 2021-09-21 20:35:36 +02:00
George Marques
262d6c6bef
GDScript: Show specific error when "yield" is used
To help people porting code, it gives a hint to use "await" instead of a
generic error.
2021-09-21 14:38:14 -03:00
George Marques
e5ebc9710d
GDScript: Allow classes declaration to be done in single line
Incidentally, allow multiple statements in single line functions when
using semicolon as a terminator.
2021-09-21 14:14:46 -03:00
George Marques
bab0afc821
GDScript: Allow multiple lines in signal parameters declaration 2021-09-21 13:40:39 -03:00
George Marques
5107f9190b
GDScript: Remove conversion assign mistakenly done when unneeded 2021-09-21 11:58:57 -03:00
Yuri Roubinsky
26e3b3908d
Merge pull request #52852 from Chaosus/gds_fix_constants
Prevent local constant default value from incorrect overriding by a global constant in GDScript autocompletion
2021-09-21 16:44:46 +03:00
Rémi Verschelde
b458feba24
Merge pull request #51655 from RevoluPowered/improve-gdscript-code-editor-performance
Improve GDScript Editor performance
2021-09-21 15:18:17 +02:00
Rémi Verschelde
82c12060b2
Merge pull request #52718 from Calinou/gdscript-add-integration-tests-2 2021-09-21 14:13:24 +02:00
Gordon MacPherson
1881b3adc5
Improve GDScript Editor and Improve latency
Improvements:
- GDScript Highlighter is faster by 25% as keys are smaller (hashes instead of strings)
- Removes message queue from _apply_settings_change to allow resize to work correctly
- Some performance fixes are pending still

Note: this resolves the code editor behaving badly when resizing in debug builds
2021-09-21 13:56:47 +02:00
Yuri Roubinsky
05331a5bb9 Prevent local constant default value from incorrect override by a global 2021-09-21 08:40:50 +03:00
Aaron Franke
d54f2ad7ca
Don't generate empty doc sections and reduce code duplication 2021-09-20 20:59:33 -05:00
John J. Donna II
be6da39b8a
LSP: Add support for custom host setting
You can now configure host in the `language_server` settings in the editor
settings.
2021-09-20 13:09:51 +02:00
Rémi Verschelde
ae3b26da7b
GDScript: Remove reference to remove @export_exp_range
It was removed in 75688772b3 to be replaced
by `@export_range` with an `"exp"` hint string.
2021-09-17 22:54:43 +02:00
Rémi Verschelde
424ddcba37
Merge pull request #52792 from vnen/gdscript-subscript-missing-index 2021-09-17 20:16:29 +02:00
Rémi Verschelde
7762e8b1c1
Merge pull request #52788 from vnen/gdscript-compare-with-null 2021-09-17 19:35:55 +02:00
George Marques
651319de11
GDScript: Properly catch error when missing index in subscript 2021-09-17 14:31:51 -03:00
George Marques
455e142d37
Allow comparing equality between builtin types and null 2021-09-17 12:33:52 -03:00