1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00
Commit Graph

281 Commits

Author SHA1 Message Date
Thaddeus Crews
1cb3cfaa8e Style: Convert namespaces to PascalCase 2025-03-23 19:10:24 -05:00
Thaddeus Crews
a9065db5ad Merge pull request #104130 from KoBeWi/are_tools_enabled_when_tools_are_enabled
Remove `TOOLS_ENABLED` checks from `editor/`
2025-03-17 10:52:25 -05:00
Raul Santos
2213545fc5 [.NET] Deprecate compat methods that reference deprecated types 2025-03-14 21:33:33 +01:00
kobewi
7cb2fb189a Remove TOOLS_ENABLED checks from editor/ 2025-03-14 18:13:16 +01:00
Thaddeus Crews
b377562b52 Merge pull request #91660 from AThousandShips/methodinfo_vec
[Core] Use `Vector` for `MethodInfo::arguments`
2025-03-14 10:06:13 -05:00
Aaron Franke
6c9087fb5a Fix missing Vector4(i) and Projection in C# bindings generator 2025-03-13 19:04:47 -07:00
A Thousand Ships
d9721954e6 [Core] Use Vector for MethodInfo::arguments 2025-03-10 13:57:53 +01:00
A Thousand Ships
331a43a9d8 Add String::remove_char(s) methods for performance and convenience 2025-03-10 13:19:28 +01:00
A Thousand Ships
5113022dfe Clean up some uses of String::substr
Cases where the end position is either equvalent to the default or past
the end of the string.
2025-03-07 14:50:38 +01:00
Raul Santos
5a53ec55ec [.NET] Add Obsolete attribute to signal trampolines and emitter functions
If a signal is deprecated, make sure we also add the `[Obsolete]` attribute to that signal's trampoline and emitter functions.
2025-01-24 02:18:28 +01:00
Raul Santos
975369fceb [.NET] Fix EmitSignal with typed array parameters
Signals with typed arrays were generating EmitSignal methods with untyped array parameters.
2024-12-20 06:51:09 +01:00
Thaddeus Crews
57d08dbec3 C#: Fix warnings caught by new problem-matchers
• Restore MSVC problem matcher for Linux builds
2024-12-10 14:04:35 -06:00
Lukas Tenbrink
b5c31ebb41 Add contains_char() for single-character 'contains' calls. 2024-12-06 20:23:35 +01:00
Danil Alexeev
03b05cf9ac Core: Fix built-in enum constant bindings 2024-11-22 14:03:21 +03:00
A Thousand Ships
68f638cf02 Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
kobewi
5c0f2414cd Always add decimal when printing float 2024-10-23 15:00:21 +02:00
Thaddeus Crews
cb3c01a5fe Merge pull request #97588 from TML233/generated-raise-signal
[C#] Change generated On{SignalName} to EmitSignal{SignalName}
2024-10-21 16:39:12 -05:00
DE YU
d4695e84a4 Add ReadOnlySpan API Overloads
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-10-09 23:14:38 +08:00
TML
fa48ed9945 Change generated On{SignalName} to EmitSignal{SignalName} 2024-09-28 22:10:33 +08:00
Rémi Verschelde
543fa16b4c Merge pull request #68233 from raulsntos/dotnet/raise-events
C#: Generate strongly-typed method to raise signal events and fix event accessibility
2024-09-27 13:53:11 +02:00
Raul Santos
da37998dc8 C#: Generate On{EventName} method to raise signal events 2024-09-26 20:10:53 +02:00
Rémi Verschelde
ea8d20d35b Merge pull request #96955 from Delsin-Yu/generator-based-CreateManagedForGodotObjectBinding
[.NET] Replace Reflection-Based implementation with Generated one in `CreateManagedForGodotObjectBinding`
2024-09-23 16:13:49 +02:00
Rémi Verschelde
c65ab71230 Merge pull request #94953 from raulsntos/dotnet/signals-with-typed-arrays
C#: Generate signal delegates with typed arrays
2024-09-23 12:27:45 +02:00
DE YU
307224927c Replace Reflection-Based implementation with Generated one
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-09-22 18:01:14 +08:00
Matt Enad
d6c0a53ecf Add error messages to binding generator 2024-09-19 13:31:05 -04:00
Raul Santos
aaffab8afb Add metadata for char16_t and char32_t
We don't seem to expose any API that uses `char16_t` yet, but I added it anyway since we make the type info for it.

I didn't add anything for `wchar_t` because we are not making a type info so maybe we don't have a need for it yet, it could be added in the future.

To prevent breaking compatibility with the C# bindings, we ignore the `char32_t` metadata and still use `System.Int64`.
2024-09-12 02:15:55 +02:00
Thaddeus Crews
9853a69144 Implement typed dictionaries 2024-09-04 10:27:26 -05:00
Daylily-Zeleen
3d575801ce Allow ClassDB to create a Object without postinitialization for GDExtension. 2024-08-20 20:19:02 +08:00
Raul Santos
f3841d644e C#: Generate signal delegates with typed arrays
Signals with typed arrays were generating C# delegates with untyped arrays.
2024-07-30 18:39:03 +02:00
A Thousand Ships
a0dbdcc3ab Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
A Thousand Ships
955d5affa8 Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
Rémi Verschelde
baec8da3b3 .NET: Prevent generating mono glue in project folder
Fixes #83128.
2024-05-03 14:24:35 +02:00
K. S. Ernest (iFire) Lee
f9b488508c Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
Raul Santos
7d08e8727b C#: Make internal properties and property accessors public (but hidden)
Instead of making the accessors `internal` which can break binary compat, make them `public` but hide them with EB never so they don't show up in IntelliSense.

Also, do the same for properties with the `PROPERTY_USAGE_INTERNAL` flag. These properties were not meant to be exposed to scripting, but since they've been public before all we can do now is hide them.
2024-03-29 20:36:04 +01:00
Paul Joannon
7290e7d7a5 C#: Fix warnings
- Fix most CS0108 in generated glue
- Suppress CA1001 on `Variant`
2024-03-09 17:05:23 +01:00
Rémi Verschelde
1598af5668 Merge pull request #83504 from Repiteo/c#-generator-langword-check
C#: Bindings generator langword check
2024-03-04 13:32:34 +01:00
Rémi Verschelde
a64cb8eff3 Merge pull request #88570 from paulloz/dotnet/warnings-editorconfig-cleanup
[.NET] Better `.editorconfig` setup in `modules/mono/`
2024-02-27 21:23:03 +01:00
Paul Joannon
139a5df821 Cleanup C# projects, code quality & style
New rules:
- Do not silence CA1805 any more
- Limit where we silence CA1707, CA1711, CA1720
- Enforce severity=warning for IDE0040
- Enforce Allman style braces
- Enforce naming conventions (IDE1006 is still severity=suggestion)

Fixes:
- Fix REFL045, CS1572, CS1573
- Suppress CS0618 when generating `InvokeGodotClassMethod`
- Fix indent when generating GD_constants.cs
- Temporarily silence CS1734 in generated code
- Fix a lot of naming rule violations

Misc.:
- Remove ReSharper comments for RedundantNameQualifier
- Remove suppression attributes for RedundantNameQualifier
- Remove severity=warnings for CA1716, CA1304 (already included in the level of analysis we run)
2024-02-27 20:11:24 +01:00
Thaddeus Crews
be7019de0f C#: Only check for empty deprecation message if deprecated 2024-02-27 10:22:32 -06:00
Raul Santos
40b7dd0cf3 C#: Add deprecated message to generated bindings
Uses the `DocData` deprecated message in the C# `[Obsolete]` attribute added to deprecated members.
2024-02-23 20:30:36 +01:00
Rémi Verschelde
563e385810 Merge pull request #87526 from zaevi/fix_csharp_gc
C#: Fix incorrect GC handle for non-instantiable types.
2024-01-26 11:47:25 +01:00
Paul Joannon
46b3096570 Clean a bunch of C# warnings
- `[Obsolete]` tag generated in the middle of documentation comments
- Potential `null` values in generators
- Obsolete call to `GetEditorInterface()`
- We don't want `Godot.Collections.Array` to end with `Collection`
- A few culture specifications and use of `AsSpan` instead of `SubString` in `StringExtensions`
- Disable CA1716 in GodotSharp
2024-01-26 09:38:33 +01:00
Zae
201e946741 C#: Fix incorrect GC handle for non-instantiable types. 2024-01-25 02:40:08 +08:00
Thaddeus Crews
a0db88335a Implement function to throw on null pointers
• Specifically: checks if ptr == IntPtr.Zero
2023-12-17 08:52:20 -06:00
Thaddeus Crews
0935a99bf9 C# - bindings generator langword check 2023-10-17 08:51:24 -05:00
Yuri Sizov
cc0eebd9d8 Validate code tags for class and member references
This commit also adds means to manually disable warnings
in `code` tags where it's a false positive with the new
`skip-lint` attribute.

Warnings are now enabled on CI to prevent future errors.
2023-10-03 15:48:31 +02:00
Rémi Verschelde
017541bcec Merge pull request #80527 from raulsntos/dotnet/generate-compat-methods-from-classdb
C#: Generate and use compat methods
2023-09-26 13:44:52 +02:00
Raul Santos
5f6082a96b C#: Generate and use compat methods
- Implements `ClassDB::get_method_list_with_compatibility` to retrieve all methods from a class including compat methods.
- C# bindings generator now also generates compat methods.
- All generated C# methods now use `ClassDB::get_method_with_compatibility`.
2023-09-19 20:35:11 +02:00
Thaddeus Crews
e43b63ab98 C# - bindings_generator warnings to .editorconfig 2023-09-16 11:55:04 -05:00
Rémi Verschelde
2e71e5516e Merge pull request #80632 from Repiteo/C#-editor-docstring
C#: Dereference editor types in core documentation
2023-09-02 14:28:35 +02:00