Commit Graph

235 Commits

Author SHA1 Message Date
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
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
e43b63ab98 C# - bindings_generator warnings to .editorconfig 2023-09-16 11:55:04 -05:00
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
cbf17b5ac1 C#: Dereference editor types in core documentation 2023-09-01 15:17:13 -05:00
07f6fa8ff9 Merge pull request #80629 from Repiteo/C#-CS0419
C#: Include argument types in generated methods
2023-09-01 16:01:24 +02:00
1d852cb75e Merge pull request #80631 from Repiteo/C#-delegate-docstring
C#: Fixed delegate docstring logic
2023-08-16 09:15:50 +02:00
db1a5dc41a Merge pull request #80630 from Repiteo/C#-paramref
C#: paramref now properly tagged in documentation
2023-08-16 09:15:27 +02:00
f735aa1fc2 C#: Include argument types in generated methods
• Prevents warnings over ambiguous references with Compat.cs
• Fix typo in Compat.cs causing AddCodeCompletionOption documentation to inherit itself
2023-08-14 16:15:49 -05:00
10cc46196b C#: paramref now properly tagged in documentation
• If part of a signal, the old documentation style is used, as it points to a delegate & doesn't have actual parameters to reference
2023-08-14 15:16:52 -05:00
4d7c07a132 C#: Fixed delegate docstring logic
• No longer produces double-summaries
2023-08-14 11:17:47 -05:00
51154a86a1 Implement proxy_name for EnumInterface
• Fixes generated CS1574 warnings
2023-08-14 10:47:14 -05:00
951ea2415b Make EditorInterface accessible as a singleton
- EditorPlugin.get_editor_interface() is removed as redundant.
2023-08-09 16:01:31 +02:00
750f1a66b6 Merge pull request #80303 from raulsntos/dotnet/warnings/CS1572
C#: Fix typo in parameter name in documentation
2023-08-07 14:53:58 +02:00
8018b478ca Merge pull request #79470 from raulsntos/dotnet/singleton-can-be-instances-too
C#: Generate instance types for singletons
2023-08-07 14:47:51 +02:00
faaf27f284 Fix various typos with codespell
Also includes typo fixes from #79993, #80068, #80276, and #80303.

Co-authored-by: betalars <contact@betalars.de>
Co-authored-by: spaceyjase <429978+spaceyjase@users.noreply.github.com>
Co-authored-by: Swarkin <102416174+Swarkin@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-08-07 13:09:47 +02:00
23f7f24e8a C#: Add hard-coded singletons to avoid breaking compat
Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2023-08-06 19:02:53 +02:00
6b713b1682 C#: Generate instance types for singletons 2023-08-06 00:48:22 +02:00
958a6cd953 C#: Fix typo in parameter name in documentation 2023-08-05 20:00:49 +02:00
ed301a4078 Merge pull request #79249 from raulsntos/dotnet/dont-ignore-call-error
C#: Print error when MethodBind/Callable call fails
2023-08-02 12:16:15 +02:00
77e5e195f5 C#: Print error when MethodBind/Callable call fails 2023-07-28 19:18:08 +02:00
12e4aa93b3 C#: Document generated members
Documents generated members and tries to discourage users from calling/overriding internal methods that only exist to be used by the engine.
2023-07-09 14:26:15 +02:00
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
1c1d1a1e2e Fix crash when using base types of extension-based types from C# 2023-06-12 18:29:52 +02:00
aa5dfff3f0 Merge pull request #77410 from dsnopek/object-pointer-pointer-encoding
Standardize Object ptrcall encoding on `Object **`
2023-06-07 13:31:49 +02:00
0484993121 C#: Add [Obsolete] attribute to deprecated members 2023-06-06 12:23:23 +02:00
77733faede Attempt to standardize Object ptrcall encoding on Object ** 2023-05-25 21:46:22 -05:00
45659ce2d9 Fix C# glue generation for enums with negative values 2023-05-12 21:53:42 +02:00
692ad70fd7 C#: Do not use DocCache when generating glue code 2023-04-20 15:35:14 +02:00
42cf684837 C#: Do not print errors about missing references to intentionally ignored members 2023-03-24 20:21:55 +01:00
16a2a164fe C#: Get singleton instances using the Core name 2023-03-03 16:30:18 +01:00
3730d8e343 C#: Check if a class is a singleton using the Core name
Use the name of the class in Core, rather than the C# rename, when checking if a class is registered as a singleton.
2023-02-24 18:02:31 +01:00
2b55ac445b Merge pull request #72111 from raulsntos/method-info-metadata
Add `GodotTypeInfo::Metadata` to `MethodInfo`
2023-01-27 15:41:38 +01:00
1aceacaa6b C#: Rename Object to GodotObject 2023-01-27 02:04:18 +01:00
a968e51414 C#: Renames to follow .NET naming conventions
Renamed C# types and members to use PascalCase and follow .NET naming conventions.
2023-01-27 02:04:17 +01:00
0d1b5f8832 Merge pull request #71356 from raulsntos/dotnet/get
C#: Lookup signals and methods in Get method
2023-01-27 00:13:13 +01:00
4f572d1587 Merge pull request #71535 from raulsntos/dotnet/pointers-are-yabai
C#: Skip methods with pointer parameters
2023-01-26 23:44:28 +01:00
2aa532ad6c Merge pull request #65529 from magian1127/4.0FixDocTag
C# Improve the "Tag" conversion of documents
2023-01-26 22:58:26 +01:00
cac7a784d6 Add GodotTypeInfo::Metadata to MethodInfo 2023-01-26 15:51:34 +01:00
35bfce2afd C# Improve the "Tag" conversion of documents
[codeblocks] for Keep only the [CSharp] part.
[param] is changed to <c>.
[b] for bold text.
[i] for italic text.
4.0 now uses variant, so [variant] to <see cref="Godot.Variant"/>.
since Rider does not support [u], only comments have been modified.
2023-01-24 18:40:48 +08:00
ab5e532f1a C#: Skip methods with pointer parameters 2023-01-17 04:32:05 +01:00
47e355f965 C#: Make property accessors internal 2023-01-16 15:15:26 +01:00
a6ba914f15 C#: Lookup signals and methods in Get method
Allows to retrieve `Callable`s and `Signal`s using `Get` like it works in GDScript.
2023-01-13 22:19:25 +01:00
59e8fc1edf C#: Add [Flags] attribute to core bitfield enums 2023-01-09 16:13:28 +01:00
d95794ec8a One Copyright Update to rule them all
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".
2023-01-05 13:25:55 +01:00
24e4ac9167 C#: Rename ConvertToX methods
- Renamed `ConvertToX` to `ConvertToNativeX`.
- Renamed `ConvertToXObject` to `ConvertToX`.
- Renamed `ConvertToXManaged` to `ConvertToX`.
- Fix `Signal` name in bindings generator and csharp script.
2022-12-23 19:40:32 +01:00
b8e1d6585c Merge pull request #69971 from neikeq/csharp-vararg-ret-premature-free
C#: Fix premature free of returned Variant in vararg methods
2022-12-14 23:27:40 +01:00
833b252ce7 C#: Fix premature free of returned Variant in vararg methods
Notably, this fixes obscure issues after calling `script.New()` when
the returned instance is a `RefCounted`.
2022-12-12 17:54:28 +01:00
1ab4f26cc4 C#: Fix bindings generator for methods that return signals 2022-12-12 17:04:03 +01:00
17b2838f39 C#: Cleanup Variant marshaling code in source/bindings generators
This change aims to reduce the number of places that need to be changed
when adding or editing a Godot type to the bindings.

Since the addition of `Variant.From<T>/As<T>` and
`VariantUtils.CreateFrom<T>/ConvertTo<T>`, we can now replace a lot of
the previous code in the bindings generator and the source generators
that specify these conversions for each type manually.

The only exceptions are the generic Godot collections (`Array<T>` and
`Dictionary<TKey, TValue>`) which still use the old version, as that
one cannot be matched by our new conversion methods (limitation in the
language with generics, forcing us to use delegate pointers).

The cleanup applies to:

- Bindings generator:
  - `TypeInterface.cs_variant_to_managed`
  - `TypeInterface.cs_managed_to_variant`
- Source generators:
  - `MarshalUtils.AppendNativeVariantToManagedExpr`
  - `MarshalUtils.AppendManagedToNativeVariantExpr`
  - `MarshalUtils.AppendVariantToManagedExpr`
  - `MarshalUtils.AppendManagedToVariantExpr`
2022-12-02 14:47:12 +01:00