Commit graph

2741 commits

Author SHA1 Message Date
Gilles Roudière
538c4b62b7 Explain a bit more RPCs options 2023-06-27 11:25:15 +02:00
Rémi Verschelde
af16013905
Merge pull request #78571 from MewPurPur/include-extension-info
Document file extensions of GDScript, CSharpScript, and Shader
2023-06-22 18:32:25 +02:00
MewPurPur
8848c395b6 Add information about file extension to GDScript, CSharpScript, and Shader 2023-06-22 18:56:08 +02:00
Danil Alexeev
84c8946565
GDScript: Remove unnecessary name check in _get_property_list() 2023-06-22 12:41:44 +03:00
Rémi Verschelde
f2ce0b6741
Merge pull request #78521 from jpcerrone/fix_static_vars_refs
Fix errors destroying script with static variables
2023-06-21 21:52:15 +02:00
Rémi Verschelde
faf3faa8c8
Merge pull request #77744 from dalexeev/gds-reset-block-locals-on-exit
GDScript: Reset local variables on exit from block
2023-06-21 21:51:05 +02:00
ocean (they/them)
6c28b8edd3 GDScript: fix regression when checking for virtual function implementation.
Unfortunately it appears the virtual function checks in #77324 are not
trustworthy at runtime, because objects can have scripts attached, but
this information is not always available at compile-time. These checks
need to be removed.

The rest of the PR is still useful, making all method flags available to
the analyzer, so a full revert isn't necessary/desirable.

This reopens #76938, which will need another solution.
2023-06-21 15:13:45 -04:00
jpcerrone
8ce8216d17 Fix errors destroying script with static variables
Fixes #78376
After #78138 'script_list' is now cleared in 'GDScriptLanguage::finish'
Because of that, we can safely remove the removal from that list that
happens on 'GDScript::~GDScript'.
2023-06-21 12:33:21 -03:00
今井きなみ
bf04c55175 Fix lambda parsing continuing on subsequent lines #73273 2023-06-21 12:56:57 +02:00
Yuri Sizov
f1e79e2581 Make container element type comparison safe 2023-06-20 17:04:57 +02:00
Rémi Verschelde
248e5245e4
Merge pull request #73540 from mashumafi/fix-typed-array-add
Fix: Typed arrays aren't working with +
2023-06-20 15:12:39 +02:00
Danil Alexeev
a0577eb23b
GDScript: Fix _get_script_name() function collision for SCU build 2023-06-20 12:03:54 +03:00
Danil Alexeev
5d3f5e8cf2
GDScript: Fix crash in disassembler 2023-06-19 23:50:33 +03:00
Rémi Verschelde
c211c22abc
Merge pull request #78389 from rune-scape/rune-match-stringnames
GDScript: Strings and StringNames match
2023-06-19 21:18:42 +02:00
Rémi Verschelde
ae00187b58
Merge pull request #77129 from dalexeev/gds-fix-static-var-bugs-part-1
GDScript: Fix some bugs with static variables and functions
2023-06-19 21:18:18 +02:00
Rémi Verschelde
5f9175f969
Merge pull request #76954 from Rindbee/return-null-on-fail-load-script
Returns null and does not cache when the source code of the script fails to load
2023-06-19 21:17:47 +02:00
Rémi Verschelde
cfae05094a
Merge pull request #72824 from dalexeev/gds-invalid-char-error
GDScript: Fix invalid character error message
2023-06-19 15:39:58 +02:00
Ben
0803467334
Fix "Go to definition" for GDScript type hints
Fixes #68475.
2023-06-19 15:29:25 +02:00
Fabio Alessandrelli
116f783db7
Merge pull request #76207 from dalexeev/clarify-rpc-docs
Clarify `@rpc` annotation arguments docs
2023-06-18 21:34:34 +02:00
Rémi Verschelde
fcc39d498b
Merge pull request #75051 from AleryBerry/fix-error-message-lua-style
GDScript: Fix error message for LUA-style dictionary
2023-06-18 16:28:36 +02:00
Rémi Verschelde
1a62f1e4fc
Merge pull request #74741 from vnen/variant-not-for-everyone
Allow boolean operators for all Variant types
2023-06-18 16:28:10 +02:00
Rémi Verschelde
4db1d09bf5
Merge pull request #73657 from mashumafi/callable-ctor
Fix: Get constructor as Callable
2023-06-18 16:27:42 +02:00
Rémi Verschelde
1ce2425c0e
Merge pull request #73363 from dalexeev/gds-fix-min-int-not-representable
GDScript: Fix `MIN_INT` not representable as numeric literal
2023-06-18 16:27:16 +02:00
Rémi Verschelde
11ee6fcef0
Merge pull request #68311 from RobertMasek/fix-go-to-definition
Fix functionality of Go To Definition for properties set/get
2023-06-18 16:26:42 +02:00
Danil Alexeev
aebbbda080
GDScript: Fix some bugs with static variables and functions 2023-06-16 22:52:11 +03:00
Rémi Verschelde
49b774e009
Merge pull request #77324 from anvilfolk/oh-no-its-virtual
GDScript: add errors when calling unimplemented virtual functions
2023-06-15 15:26:18 +02:00
Rémi Verschelde
3b4504afea
Merge pull request #75944 from akien-mga/style-modules-includes
Style: Harmonize header includes in modules
2023-06-15 15:26:14 +02:00
Rémi Verschelde
12e8bc558d
Merge pull request #73203 from dalexeev/gds-fix-num-literal
GDScript: Fix repeated `_` are allowed after decimal point
2023-06-15 15:26:09 +02:00
Rindbee
cbce374f68 Returns null and does not cache when the source code of the script fails to load
This usually means that an `ERR_FILE*` error occurred.

Previously, using `GDScriptCache::get_full_script()` would ignore errors during loading.
Now, all errors are not ignored.

Judging in which period the error occurred, it can be judged based on the return value:
1. null + err : Error during script loading (load_source_code()).
2. script + err: Error during script parsing.
2023-06-15 21:06:10 +08:00
Rémi Verschelde
25b2f1780a
Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
2023-06-15 14:35:45 +02:00
ocean (they/them)
861743cd04 GDScript: add errors when calling unimplemented virtual functions
This PR does a small refactor of how method flags are handled in the GDScript analyzer.
This way, it adds support for the analyzer to use any of MethodInfo's flags, where previously
it could only use METHOD_FLAG_STATIC and METHOD_FLAG_VARARG.

As a side-effect, this also normalizes behavior between editor and release templates, which fixes #76938.

The tests added also brought a different issue to light, where using `super()` appears to generate a
return variable discarded on calling super's _init(), which doesn't have a return value. This should be
tackled in a different PR, which will have to change the output of this PR's tests.
2023-06-15 07:16:31 -04:00
Rémi Verschelde
3a319daa99
Merge pull request #77351 from anvilfolk/super-discard
GDScript: do not RETURN_VALUE_DISCARDED for `super()` inside `_init()`
2023-06-15 10:39:59 +02:00
rune-scape
fcdd926881 GDScript: Strings and StringNames match 2023-06-14 19:24:28 -07:00
Danil Alexeev
fba8cbe6db
GDScript: Fix repeated _ are allowed after decimal point 2023-06-14 21:47:12 +03:00
Rémi Verschelde
72b8d397d0
GDScript: Further restrict test error output for C++ errors
MSVC and GCC/Clang also have different function names...
2023-06-14 13:28:52 +02:00
Rémi Verschelde
c40adf027d
GDScript: Only include script file path in test error output
Errors originating in C++ files cause unnecessary diffs whenever the engine is updated
(line number changes, etc.) and would cause CI failures due to different formatting
of the file path on Windows (backslashes, worked around here anyway) and when using
SCU builds (`../scu` insert).
2023-06-14 10:54:49 +02:00
Rémi Verschelde
5145098e6e
Merge pull request #78138 from KoBeWi/are_we_clear
Clear SelfList when destroying GDScriptLanguage
2023-06-14 09:25:34 +02:00
Rémi Verschelde
8b62c52d1c
Merge pull request #75419 from vonagam/fix-super-classes-in-array-literals
GDScript: Allow elements of a parent class in a typed array literal
2023-06-14 09:23:32 +02:00
Danil Alexeev
ddd9aa11b3
Clarify @rpc annotation arguments docs 2023-06-13 21:33:48 +03:00
Rémi Verschelde
eb86dabee0
Merge pull request #77151 from dalexeev/gds-fix-call-static-from-non-static
GDScript: Fix calling static func from non-static is allowed
2023-06-13 18:54:19 +02:00
kobewi
c646f7df70 Clear SelfList when destroying GDScriptLanguage 2023-06-12 16:04:26 +02:00
Rémi Verschelde
577ab3c565
Merge pull request #75746 from ajreckof/order_autocomplete
Sort code autocompletion with rules
2023-06-08 18:14:31 +02:00
Danil Alexeev
049a49cac0
GDScript: Fix doc comment parsing (newlines and spaces) 2023-06-05 16:00:46 +03:00
Danil Alexeev
f3bf75fbb4
GDScript: Reset local variables on exit from block 2023-06-02 13:20:19 +03:00
Ninni Pipping
5e3c625e24 Add more info on the nature of NAN 2023-05-30 15:38:10 +02:00
Yuri Sizov
490a76edc8
Merge pull request #76526 from MewPurPur/improve-docs-top-sections-CORE
Overhaul the top sections of the class reference (Core classes)
2023-05-29 17:08:40 +02:00
Haoyu Qiu
3e88c4cd5c Fix extraction of chained tr() calls 2023-05-27 10:38:37 +08:00
ajreckof
006e899bb3 sort code completions with rules
Fixups

Add levenshtein distance for comparisons, remove kind sort order, try to improve as many different use cases as possible

Trying again to improve code completion

Sort code autocompletion options by similarity based on input

To make it really brief, uses a combination `String.similiary`, the category system introduced in a previous PR, and some filtering to yield more predictable results, instead of scattering every completion option at seemingly random.

It also gives much higher priority to strings that contain the base in full, closer to the beginning or are perfect matches.

Also moves CodeCompletionOptionCompare to code_edit.cpp

Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
Co-Authored-By: Eric M <41730826+EricEzaM@users.noreply.github.com>
2023-05-23 05:12:34 +02:00
ocean (they/them)
25c90836fd GDScript: do not warn of return value discarded for super() inside _init()
DO NOT BATCH MERGE WITH #77324, WILL RESULT IN BROKEN CI

Currently, calling super() inside _init() throws a
RETURN_VALUE_DISCARDED warning. The analyzer identifies super() as being a
constructor, which therefore returns an object of the relevant class.
However, super() isn't really a constructor by itself: in this case, it
is _part_ of the constructor, and so doesn't "return" a value.

A test case for this is already in #77324, which contains the warning. I
am duplicating it here, without the warning, and it should conflict with
the other PR.
2023-05-22 09:29:34 -04:00
Rémi Verschelde
06d337af80
Merge pull request #75943 from adamscott/fix-missing-script-type-nullptr-check
Add missing `script_type` `nullptr` check
2023-05-22 13:48:32 +02:00