Check identifiers (const variables and unnamed enums) and named
enums when parsing dictionary literals whether the keys are not
duplicated.
In case of duplicate key is encountered, highlight the line with it
and print error message:
`Duplicate key "foo" found in Dictionary literal`
This commit is a logical continuation of the commit dab73c7 which
implemented such checks only for literal keys (which fixed#7034).
Apart from that, this commit also fixes the issue with the error
message itself, which was shown one line below the duplicated key
in case it was the last one in the dictionary literal and there
was no hanging comma.
Also, the format of the error message has been changed so that now
the error message also contains the value of the key which is duplicated.
Instead of `Duplicate key found in Dictionary literal`, it now prints
`Duplicate key "<value>" found in Dictionary literal`
Fixes#50971
A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input.
The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe.
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".
Backported from #70885.
This is achieved by skipping initializer call while creating an instance
of a GDScript. This is implemented by passing -1 as an argument count
to `_new` and interpreting any value below 0 to mean that the initializer
should not be called during instantiation, because internal members of
an instance are going to be overridden afterwards.
Implement a special case for allowing "pass" keyword in one-liner class
declaration, to be consistent with Python style.
```
class TestClass: pass
```
This commit fixes#56703
* GDScriptLanguage::complete_code already adds parentheses to function calls, and does this a lot smarter than the language server right now.
* Instead of the previous naive approach we now reuse the same logic as the internal editor.
* For this to have any effect we also have to send the `insertText` field already during the completionRequest and not only during resolve.
(cherry picked from commit bbb07ff8cb)
Backports features and bugfixes from current Godot 4.0 to 3.5 and brings functions and codebase of both version largely in sync to make tutorials more compatible and future backports easier.
Rewrites the definition of how the function works.
Reworks the style of the examples and adds a negative range example.
Changes the while loop to a range loop in the array backwards example.
(cherry picked from commit b2841ce194)