Commit Graph

1728 Commits

Author SHA1 Message Date
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
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
bb201c5887 Merge pull request #53303 from akien-mga/53295-gdscript-completion-quote-style 2021-10-04 17:17:27 +02:00
4a4995524c Merge pull request #53338 from briansemrau/gdscript-handle-for-with-null-list 2021-10-04 17:11:43 +02:00
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
cb28469281 Allow void as return type for constructors 2021-10-03 21:16:54 +02:00
dc046e5cbe GDScript Check for null list in for loop 2021-10-02 13:53:56 -04:00
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
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
572979d011 Fix empty line hover; fix open non-res:// script 2021-10-01 11:26:26 -04:00
06c1b40b84 Merge pull request #38397 from Calinou/doc-range-backwards-example 2021-10-01 11:58:30 +02:00
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
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
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
7f8e50801e Merge pull request #51818 from MarianoGnu/gdscript2-enum-fixes 2021-09-30 18:35:49 +02:00
27d4e2f09f Merge pull request #53216 from vnen/gdscript-builtin-type-not-id 2021-09-29 17:04:24 +02:00
72c07708e8 GDScript: Don't allow builtin type names as identifiers 2021-09-29 11:23:16 -03:00
991f4d8527 GDScript: Fix assignment with operation for properties 2021-09-29 10:54:16 -03:00
c1f59139b4 Merge pull request #53092 from Razoric480/lsp-report-_init 2021-09-29 15:47:31 +02:00
7468dd65a5 Make LSP report _init instead of Object::new 2021-09-29 08:42:01 -04:00
ea0a9e6ed3 Merge pull request #52800 from akien-mga/gdscript-remove-exp_range 2021-09-29 13:33:59 +02:00
0fa574c051 Fix check for freed object during cast 2021-09-27 19:35:26 +02:00
ee238b2a4d Fix inverted error messages about null object 2021-09-27 13:58:46 +02:00
044daf9b8d Remove duplicate WorkspaceEdit from LSP 2021-09-25 15:17:19 -04:00
14dcb97556 Merge pull request #50378 from Razoric480/apply-edit-40 2021-09-25 20:43:17 +02:00
0abe464162 Merge pull request #52849 from KoBeWi/know_no_binds 2021-09-25 00:10:56 +02:00
7bf5fc709e Remove binds from Signal.connect 2021-09-24 17:07:33 +02:00
679f70c1e1 Merge pull request #52906 from vnen/gdscript-show-error-on-yield 2021-09-21 20:36:39 +02:00
b3b4860d2e Merge pull request #52905 from vnen/gdscript-single-line-declaration 2021-09-21 20:35:36 +02:00
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
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
bab0afc821 GDScript: Allow multiple lines in signal parameters declaration 2021-09-21 13:40:39 -03:00
5107f9190b GDScript: Remove conversion assign mistakenly done when unneeded 2021-09-21 11:58:57 -03:00
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
b458feba24 Merge pull request #51655 from RevoluPowered/improve-gdscript-code-editor-performance
Improve GDScript Editor performance
2021-09-21 15:18:17 +02:00
82c12060b2 Merge pull request #52718 from Calinou/gdscript-add-integration-tests-2 2021-09-21 14:13:24 +02:00
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
05331a5bb9 Prevent local constant default value from incorrect override by a global 2021-09-21 08:40:50 +03:00
d54f2ad7ca Don't generate empty doc sections and reduce code duplication 2021-09-20 20:59:33 -05:00
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
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
424ddcba37 Merge pull request #52792 from vnen/gdscript-subscript-missing-index 2021-09-17 20:16:29 +02:00
7762e8b1c1 Merge pull request #52788 from vnen/gdscript-compare-with-null 2021-09-17 19:35:55 +02:00
651319de11 GDScript: Properly catch error when missing index in subscript 2021-09-17 14:31:51 -03:00
455e142d37 Allow comparing equality between builtin types and null 2021-09-17 12:33:52 -03:00
b8fdeb6467 Merge pull request #51671 from RandomShaper/fix_gdscript_crash
Fix some GDScript bugs
2021-09-17 12:29:40 -03:00
4e69341c01 GDScript: Avoid inferred types from giving hard errors 2021-09-17 11:52:30 -03:00
c6ca09dc6f Add more integration tests to the GDScript test suite
This also fixes a typo in the `bitwise_float_right_operand.gd` test.
2021-09-15 19:57:39 +02:00
a4187c9235 Merge pull request #52706 from vnen/gdscript-ternary-operator-crash
GDScript: Show error when missing expression after ternary else
2021-09-15 17:20:52 +02:00
ed11d03b56 Merge pull request #52705 from vnen/gdscript-error-unary-no-arg
GDScript: Show error on unary operators without argument
2021-09-15 16:43:38 +02:00