Commit Graph

247 Commits

Author SHA1 Message Date
7290e7d7a5 C#: Fix warnings
- Fix most CS0108 in generated glue
- Suppress CA1001 on `Variant`
2024-03-09 17:05:23 +01:00
1598af5668 Merge pull request #83504 from Repiteo/c#-generator-langword-check
C#: Bindings generator langword check
2024-03-04 13:32:34 +01:00
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
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
be7019de0f C#: Only check for empty deprecation message if deprecated 2024-02-27 10:22:32 -06:00
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
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
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
a0db88335a Implement function to throw on null pointers
• Specifically: checks if ptr == IntPtr.Zero
2023-12-17 08:52:20 -06:00
0935a99bf9 C# - bindings generator langword check 2023-10-17 08:51:24 -05:00
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
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