Commit graph

1910 commits

Author SHA1 Message Date
Ninni Pipping
ff5d8c4a42 Fix "hides member" warnings in csharp_script.cpp 2023-03-25 14:44:12 +01:00
Alex de la Mare
8ab3295e57 Add fine-grained disabling of SourceGenerators
This allows manual testing and/or alternate source generators to
provide functionality without conflict.
2023-03-25 13:46:12 +11:00
RedworkDE
42cf684837 C#: Do not print errors about missing references to intentionally ignored members 2023-03-24 20:21:55 +01:00
Yuri Sizov
8402927d3f Prevent crashing on startup if project has scripted theme types
Also avoid order of operation conflicts by moving C# binding generation hook to main.cpp
2023-03-08 11:17:21 +01:00
Rémi Verschelde
b8126b18dc
Merge pull request #73429 from bruvzg/macos_no_sc
[macOS] Re-add support for the _sc_ inside app bundle.
2023-03-07 08:36:51 +01:00
RedworkDE
6019f497b8 C#: Fix building projects for MSBuild before 17.3 2023-03-06 17:58:20 +01:00
Rémi Verschelde
5dccc940e7
Merge pull request #74375 from raulsntos/dotnet/ignore-explicit-interface-implementations
C#: Ignore explicit interface implementations
2023-03-05 13:39:45 +01:00
Rémi Verschelde
b2622218f9
Merge pull request #74330 from aleksrutins/csharp-identifier-validation
Ensure that C# script names (and therefore class names) are valid identifiers
2023-03-05 13:29:26 +01:00
Rémi Verschelde
afc9d381d5
Merge pull request #74312 from raulsntos/dotnet/godot-project-dir-base64
C#: Encode GodotProjectDir as Base64 to prevent issues with special characters
2023-03-05 13:28:14 +01:00
Raul Santos
f949e94991
C#: Encode GodotProjectDir as Base64 to prevent issues with special characters 2023-03-04 23:33:30 +01:00
Raul Santos
0372bd56b6
C#: Ignore explicit interface implementations 2023-03-04 19:16:48 +01:00
Aleks Rutins
ae8752a731 Validate that C# class names are valid identifiers 2023-03-04 10:30:40 -05:00
RedworkDE
16a2a164fe C#: Get singleton instances using the Core name 2023-03-03 16:30:18 +01:00
Rémi Verschelde
526f115752
Merge pull request #73904 from raulsntos/dotnet/tools-popup
C#: Always show "Create C# solution" option
2023-03-02 11:22:59 +01:00
Rémi Verschelde
880247ad54
Merge pull request #74127 from RedworkDE/net-debug-crash
C#: Fix crash when errors occur before language initialization.
2023-03-02 11:20:26 +01:00
Rémi Verschelde
1c1524a651
Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
RedworkDE
c0ebc28136 C#: Fix crash when errors occur before language initialization. 2023-03-01 00:00:33 +01:00
voidedWarranties
bd5ab9f9b4 Remove unused ScriptLanguage methods 2023-02-26 22:30:56 -08:00
Raul Santos
a1a2fc2255
C#: Always show "Create C# solution" option
Prevents ending up with an empty C# menu.
The option to create the C# solution no longer disappears, to avoid confusing users.
If an user tries to use it when a C# solution already exists they are warned that it will override their sln and csproj files.
2023-02-26 02:56:34 +01:00
Raul Santos
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
RedworkDE
6b050a3502 C#: Fix editor crashing without a message when .NET is not installed 2023-02-23 13:52:45 +01:00
bruvzg
b3c64675cc
[macOS] Replace all Alt/Option+Letter/Number default shortcuts to avoid conflicts with special character input. 2023-02-20 22:02:47 +02:00
RedworkDE
756a48023f C#: Fix line position when opening file in VSCode 2023-02-19 12:43:15 +01:00
bruvzg
174e0837e0
[macOS] Re-add support for the _sc_ inside app bundle. Update docs. 2023-02-17 09:55:56 +02:00
Rémi Verschelde
2527d4ce9b
Merge pull request #73458 from paulloz/csharp/actually-clean-solution
.NET: Clicking "Clean solution" should clean, not build
2023-02-17 00:30:55 +01:00
Rémi Verschelde
5cb32d8476
Merge pull request #73392 from raulsntos/dotnet/vscode-open-solution
C#: Open the solution directory when using VSCode
2023-02-16 18:34:34 +01:00
Paul Joannon
5e3d114829
Clicking "Clean solution" should clean, not build 2023-02-16 11:45:33 +01:00
RedworkDE
fce8a05b58 C#: Fix internal source generator on the 7.0.200 SDK 2023-02-16 11:25:47 +01:00
Raul Santos
d57cb460e2
C#: Open the solution directory when using VSCode
The solution directory used to be the same as the project
directory (`res://`). We now allow specifying a different
path for the solution and the other external editors already
use that (which seems more convenient for multi-project
scenarios).
2023-02-15 20:13:40 +01:00
Rémi Verschelde
49e8a2fb66
Merge pull request #73026 from SirUppyPancakes/sync-context-send
Implement GodotSynchronizationContext.Send
2023-02-12 22:34:18 +01:00
Caleb Kemper
103cb4bee6 Implement GodotSynchronizationContext.Send 2023-02-12 14:12:09 -07:00
Raul Santos
2a1523d751
Build C# csproj instead of the solution 2023-02-10 03:19:30 +01:00
Rémi Verschelde
b53c4dda62
Merge pull request #72849 from RedworkDE/net-export-settings
C#: Rename export settings `mono` -> `dotnet` and remove unused AOT settings
2023-02-08 09:32:41 +01:00
RedworkDE
bf47b62203 C#: Rename export settings mono -> dotnet and remove unused AOT settings 2023-02-07 18:20:23 +01:00
Paul Joannon
c70c82b0fb
Try and match MSBuild and Godot UI languages 2023-02-07 16:48:23 +01:00
Paul Joannon
9bf2a0bcda
Add new settings about MSBuild
- toggle creation of binary logs
- manage log verbosity
- toggle logging in console
2023-02-07 16:48:23 +01:00
Paul Joannon
7cf42dbdee
Add button to open the msbuild logs folder 2023-02-07 16:48:23 +01:00
Paul Joannon
e51a20b714
Rename existing editor settings mono -> dotnet 2023-02-07 16:48:18 +01:00
RedworkDE
fb0adaff9f C#: Fix AppContext.BaseDirectory 2023-02-04 14:35:11 +01:00
Rémi Verschelde
bbff9fd7a4
Merge pull request #71786 from raulsntos/dotnet/array
Sync C# Array with Core
2023-02-04 00:24:06 +01:00
Rémi Verschelde
1ff2204cfe
Merge pull request #72554 from RedworkDE/net-appcontext-basedirectory
C#: Set AppContext.BaseDirectory for editor builds
2023-02-03 15:35:29 +01:00
Rémi Verschelde
5a413894fc
Merge pull request #72635 from RedworkDE/net-nodepath-iequatable
C#: Implement `IEquatable<>` and equality operators in `NodePath`
2023-02-03 15:35:22 +01:00
RedworkDE
ac96af1cc9 C#: Declare IEquatable<> interface for StringName 2023-02-03 00:26:18 +01:00
RedworkDE
7403a3a11b C#: Implement IEquatable<> and equality operators in NodePath
- Implement `IEquatable<>` interface.
- Implement `==` and `!=` operators.
- Override `Equals` and `GetHashCode`.
2023-02-03 00:25:48 +01:00
RedworkDE
b9d1462d2a C#: Set AppContext.BaseDirectory for editor builds 2023-02-02 15:05:11 +01:00
Rémi Verschelde
c5c6f2db89
Merge pull request #72553 from RedworkDE/net-output-directory
C#: Preserve directories in output during export
2023-02-02 13:59:05 +01:00
Rémi Verschelde
0a9e6e478e
Merge pull request #71800 from akien-mga/ci-codespell-action
CI: Add official codespell action with PR annotations
2023-02-01 13:25:23 +01:00
Rémi Verschelde
c461d3880f
Merge pull request #72434 from Treer/master
Qualify Console's namespace to avoid mixup with plugin's objects
2023-02-01 13:24:47 +01:00
Rémi Verschelde
e52213e2fa
More codespell fixes, do more changes from previous ignore list 2023-02-01 12:11:36 +01:00
RedworkDE
70ebb6378c C#: Preserve directories in output during export 2023-02-01 00:37:12 +01:00
Treer
086ce855a8
Update modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs
Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2023-02-01 07:56:20 +11:00
Raul Santos
7eb8325180
Fix C# examples in documentation
- Fix documentation after C# renames.
- Add missing `partial` in C# class declarations.
- Change `delta` parameter type to `double` in C#.
- Ensure parameters match base declaration.
- Use `$` string interpolation in C#.
- Fix invalid or outdated C# code.
- Changed some examples to follow our style guide more closely.
2023-01-31 19:04:07 +01:00
Treer
273df44e1d Qualify Console's namespace to avoid mixup with plugin's objects
Avoid error when a plugin contains a class called "Console":
Godot.SourceGenerators\Godot.SourceGenerators.GodotPluginsInitializerGenerator\GodotPlugins.Game.generated.cs(32,25): error CS0117: 'Console' does not contain a definition for 'Error'
2023-01-31 16:23:17 +11:00
Raul Santos
8166568976
C#: Implement IEquatable in Rid
- Implement `IEquatable` interface.
- Implement `==` and `!=` operators.
- Add `IsValid` method.
- Override `Equals` and `GetHashCode`.
- Fix `ToString` to follow Core.
- Sync documentation with Core.
2023-01-31 04:44:18 +01:00
Rémi Verschelde
312011fade
Fix various typos with codespell
And include #72377.

Co-authored-by: Wiktor Kocielski <withaust@gmail.com>
2023-01-30 14:22:47 +01:00
Rémi Verschelde
ab70b6ca8a
Merge pull request #72325 from raulsntos/dotnet/fix-72321
C#: Fix `Rotated` and `RotatedLocal`
2023-01-30 13:35:34 +01:00
Raul Santos
54f8fb010c
Sync C# Array with Core
- Add `AddRange` method.
- Add `Fill` method.
- Add `Max` and `Min` methods.
- Add `PickRandom` method.
- Add `Reverse` method.
- Add `RecursiveEqual` method.
- Add `Sort` method.
- Add `Slice` and `GetSliceRange` methods.
- Add `IndexOf` overload that takes an index parameter.
- Add `LastIndexOf` method.
- Add `BinarySearch` method.
- Add/update documentation.
2023-01-30 05:41:53 +01:00
Raul Santos
cc80dda408
C#: Fix Rotated and RotatedLocal
Implementation was interchanged.
2023-01-29 18:43:54 +01:00
Raul Santos
2ef9e2933a
C#: Add Skew to Transform2D and fix InterpolateWith
- Add `Skew` property to `Transform2D`.
- Fix `InterpolateWith` in `Transform2D` to support skewed transforms.
2023-01-29 16:24:41 +01:00
Rémi Verschelde
80f59aa3d9
Merge pull request #72205 from raulsntos/dotnet/proxy-class
Fix lookup of C# types by their engine name
2023-01-28 15:41:28 +01:00
Rémi Verschelde
092bbfc2ea
Merge pull request #71992 from raulsntos/dotnet/rect-alt
C#: Remove `GetArea` and `GetVolume` methods
2023-01-28 15:41:04 +01:00
Raul Santos
65d0d05fa7
Fix lookup of C# types by their engine name 2023-01-27 21:28:15 +01:00
Rémi Verschelde
3c9b7ec26b
Merge pull request #72182 from raulsntos/dotnet/remove-obsolete-stringextensions
C#: Remove obsolete StringExtensions methods
2023-01-27 19:26:39 +01:00
Rémi Verschelde
6462e54acc
Merge pull request #71986 from raulsntos/dotnet/readonly-collections
C#: Implement readonly-ness in Array and Dictionary
2023-01-27 19:26:35 +01:00
Raul Santos
b3af6141a2
C#: Remove GetArea and GetVolume methods
- Remove `GetArea` method in favor of the `Area` property in Rect2{i}.
- Replace `GetVolume` method with a `Volume` property in AABB.
2023-01-27 18:53:23 +01:00
Raul Santos
15066948d7
C#: Remove obsolete StringExtensions methods 2023-01-27 17:15:23 +01:00
Rémi Verschelde
2b55ac445b
Merge pull request #72111 from raulsntos/method-info-metadata
Add `GodotTypeInfo::Metadata` to `MethodInfo`
2023-01-27 15:41:38 +01:00
Raul Santos
1aa54141e6
C#: Implement readonly-ness in Array and Dictionary
- Expose `IsReadOnly` and add `MakeReadOnly` method.
2023-01-27 15:25:34 +01:00
Rémi Verschelde
bd1df0f2e3
Merge pull request #71943 from paulloz/debugger/better-errors-printing
Better error display in debugger panel
2023-01-27 10:32:38 +01:00
Paul Joannon
c93eec4139
Better error display in debugger panel
- Use the right stack frame info as title of the error.
- Use the actual C# exception type as error for exceptions raised from C#.
- Show the right language instead of always **C++ Error**.
2023-01-27 10:01:55 +01:00
Raul Santos
1aceacaa6b
C#: Rename Object to GodotObject 2023-01-27 02:04:18 +01:00
Raul Santos
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
Raul Santos
4788cb35c1
C#: Add global namespace to grouping property info 2023-01-27 01:15:19 +01:00
Rémi Verschelde
2edef2a795
Merge pull request #71825 from RedworkDE/net6-roll-forward
C#: Allow use of .NET 7
2023-01-27 00:13:54 +01:00
Rémi Verschelde
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
Rémi Verschelde
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
Rémi Verschelde
fdd3613de1
Merge pull request #71984 from raulsntos/dotnet/dictionary
Sync C# Dictionary with Core
2023-01-26 23:44:01 +01:00
Rémi Verschelde
239145d9cb
Merge pull request #71946 from raulsntos/dotnet/gd
C#: Sync GD with Core
2023-01-26 23:43:36 +01:00
Rémi Verschelde
bacf594a49
Merge pull request #71583 from raulsntos/dotnet/math
C#: Add float an double overloads to Mathf
2023-01-26 23:43:11 +01:00
Rémi Verschelde
c53066682b
Merge pull request #71787 from raulsntos/dotnet/restore-properties
C#: Restore `Scale` and `Rotation` properties
2023-01-26 23:42:46 +01:00
Rémi Verschelde
fdd02b8827
Merge pull request #71988 from raulsntos/🦭-attributes
Seal C# attributes
2023-01-26 23:42:21 +01:00
Rémi Verschelde
0f840cb214
Merge pull request #72053 from raulsntos/dotnet/sync-context-dispose
C#: Implement disposable pattern and seal `GodotSynchronizationContext` class and related
2023-01-26 23:41:52 +01:00
Rémi Verschelde
63b5adf8a8
Merge pull request #72057 from raulsntos/dotnet/fix-must-be-variant
C#: Annotate API with `[MustBeVariant]`
2023-01-26 23:00:30 +01:00
Rémi Verschelde
2aa532ad6c
Merge pull request #65529 from magian1127/4.0FixDocTag
C# Improve the "Tag" conversion of documents
2023-01-26 22:58:26 +01:00
Raul Santos
cac7a784d6
Add GodotTypeInfo::Metadata to MethodInfo 2023-01-26 15:51:34 +01:00
Raul Santos
256632a07e
C#: Skip documentation syntax in MustBeVariant analyzer 2023-01-25 17:29:08 +01:00
Raul Santos
0a0c730805
C#: Annotate API with MustBeVariant
- Add MustBeVariant attribute to generic parameters that are used in a Variant context
2023-01-25 17:28:59 +01:00
Raul Santos
fc72604bef
C#: Implement disposable pattern and seal GodotSynchronizationContext class and related
- `GodotSynchronizationContext`
  - Implements `IDisposable` to dispose of the disposable field `_queue`.
  - Makes the class sealed.
- `GodotTaskScheduler`
  - Implements `IDisposable` to dispose of the disposable property `Context`.
  - Makes the class sealed.
- `Dispatcher`
  - Dispose of previous `GodotTaskScheduler` instances before creating a new one.
2023-01-25 17:04:41 +01:00
Aaron Franke
2a65f6812b
Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for script
Co-authored-by: Yakov Borevich <j.borevich@gmail.com>
2023-01-24 16:37:50 -06:00
Aaron Franke
2bc0bcbd26
PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE" 2023-01-24 16:05:07 -06:00
Raul Santos
47ca2f2e09
C#: Sync GD with Core
- Add overloads to print methods that take a single `string`.
- Use `StringBuilder` to append print parameters.
- Remove `PrintStack` method.
- Add `ErrorString`.
- Remove `Str` method.
- Add exception to `Range` when step is 0.
- Add `VarToBytesWithObjects` and `BytesToVarWithObjects`.
- Remove optional boolean parameter from `VarToBytes` and `BytesToVar`.
- Move `InstanceFromId` to `Godot.Object`.
- Add `Godot.Object.IsInstanceIdValid`.
- Update documentation.
2023-01-24 19:18:38 +01:00
Raul Santos
e7b719b7ec
Seal C# attributes 2023-01-24 18:42:25 +01:00
Raul Santos
95ef4dc84f
Sync C# Dictionary with Core
- Implement `ICollection` methods explicitly.
- Add `Merge` method.
- Add `RecursiveEqual` method.
- Update documentation.
2023-01-24 17:19:52 +01:00
Raul Santos
8b07f95ba0
C#: Add float an double overloads to Mathf
- Add `float` and `double` overloads to all methods of `Mathf`.
This allows the methods to be usable with `float`, `double` or `real_t`.
- Use `System.MathF` in the `float` overloads which may result in
better performance.
- Constants remain as `real_t` for the time being.
- Add aggresive inlining for methods that wrap `System.Math` calls.
2023-01-24 15:01:26 +01:00
Magian
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
Raul Santos
b29193945d
C#: Move LinearToDb and DbToLinear to Mathf 2023-01-23 20:20:54 +01:00
Rémi Verschelde
5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
RedworkDE
3f1241cb82 C#: Allow use of .NET 7
The editor will use .NET 7 if it is installed and fall back to .NET 6 otherwise.
Exported projects will use .NET 7 or .NET 6 depending on the value of TargetFramework in the csproj.
2023-01-21 23:11:37 +01:00
Juan Linietsky
dddd8d43f6 Support script global resource name in EditorFileSystem
* Works for binary and text files.
* Makes EditorQuickOpen work with custom resources again.
* Information is cached and easily accessible.

Properly fixes #66179. Supersedes #66215 and supersedes #62417

**WARNING**: This required breaking backwards binary compatibility (.res and .scn files). Files saved after this PR is merged will no longer open in any earlier versions of Godot.
2023-01-21 14:19:27 +01:00
Raul Santos
04996df61e
C#: Restore Scale and Rotation properties 2023-01-21 04:59:13 +01:00