Commit graph

859 commits

Author SHA1 Message Date
Rémi Verschelde c0eb347946
Merge pull request #91557 from AThousandShips/dotnet_doc_fix
[C#] Unexpose `GodotSharp`
2024-05-21 11:22:40 +02:00
Marius Hanl 32be459e54 Fix ContextMenu Copy Error is off in MSBuild Panel 2024-05-15 22:55:05 +02:00
Gaoyao Massimo Hu e3270113ca
Remove useless isFirstEntry and useless source.Append("else ") 2024-05-14 07:44:56 +01:00
Gaoyao Massimo Hu 06b716d8b3
Fix C# Hint NodeType and ResourceType HintString 2024-05-08 16:22:52 +01: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
Rémi Verschelde 9ef50524d0
Merge pull request #91696 from akien-mga/style-file-format
Style: Trim trailing whitespace and ensure newline at EOF
2024-05-08 12:31:32 +02:00
Rémi Verschelde 7d03b1de0b
Style: Trim trailing whitespace and ensure newline at EOF
Found by apply the file_format checks again via #91597.
2024-05-08 10:12:46 +02:00
Paul Joannon c2d72a691f
Specify a runtime rollforward for OpenVisualStudio
Use `LatestMajor`

Fixes #91638
2024-05-07 19:40:25 +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
A Thousand Ships aff2e47bff
[C#] Unexpose GodotSharp
This class seems to have been exposed accidentally, and breaks
documentation on non-mono builds, requiring hacks
2024-05-04 14:09:42 +02:00
Rémi Verschelde 9ed8399514
Merge pull request #91509 from akien-mga/dotnet-fix-generating-glue-in-project-folder
.NET: Prevent generating mono glue in project folder
2024-05-04 11:52:32 +02:00
Rémi Verschelde 629e91acff
Merge pull request #91479 from Repiteo/dotnet/sln-csproj-attributes
C#: Fix attributes for `sln`/`csproj` files
2024-05-04 11:52:29 +02:00
Thaddeus Crews 64f2e8b64f
Dotnet: Fix attributes for sln/csproj files 2024-05-03 12:21:51 -05: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
Rémi Verschelde 4eaafc8fa8
Merge pull request #91375 from paulloz/dotnet/prevent-generator-crash-on-exported-unconstructed-generic-arrays
C#: Fix generator crash w/ generic arrays
2024-05-02 12:46:42 +02:00
Raul Santos 1510f88ae1
C#: Ignore late bound methods in MustBeVariantAnalyzer
If symbol is late bound (as is the case when using `dynamic`) we can't obtain the symbol to analyze the usage of `[MustBeVariant]`.
2024-05-01 03:18:21 +02:00
Paul Joannon aba787393f
C#: Fix generator crash w/ generic arrays 2024-04-30 22:22:09 +02:00
Konstantin Kretov 2b46e009fa
Fill copyright field in .csproj files
This ensures that nuget packages will have both license and copyright fields filled.
2024-04-26 11:41:04 +02:00
Rémi Verschelde 1a6e4ce906
Merge pull request #90002 from raulsntos/dotnet/expose-property-accessors
C#: Make internal properties and property accessors public (but hidden)
2024-04-22 12:51:42 +02:00
bruvzg bf558adcdd
[.NET] Disable output embedding on macOS, move it to the advanced options on other platforms. 2024-04-09 17:47:39 +03:00
Nông Văn Tình 316f253558 Show errors when solution file is missing in C# project
Fixes: #86591

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2024-04-07 00:25:34 +07:00
AyOhEe e18fb27d70
Fixed "Create C# solution" dialog
Flipped the title and dialog text to how they should be. It seemed that the title was being put in the dialog text, and vice versa.
2024-04-01 23:01:40 +01: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
Jason Hunter bdbd9995f8
Add property UsingGodotNETSdk to Godot.NET.Sdk
The Godot.NET.Sdk (for C# use) should define the property `UsingGodotNETSdk` in its [SDK.props](a07dd0d6a5/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props).  

## Why
Defining this property allows shared build configuration (e.g. Directory.Build.targets or other imported msbuild files) to detect deterministically when they are operating within the scope of a project controlled by Godot.NET.Sdk.  This enables shared build configuration that may span many different projects within a folder to have Godot.NET.Sdk-specific configuration that only applies to Godot projects.

## Why named UsingGodotNETSdk
This naming scheme is common practice in Microsoft Dotnet SDKs.  For example, the property `UsingMicrosoftNETSdk` is defined by the default SDK, `UsingMicrosoftTraversalSdk` is defined by [Microsoft.Build.Traversal](363532de5b/src/Traversal/Sdk/Sdk.props (L10)), `UsingMicrosoftNoTargetsSdk` by [Microsoft.Build.NoTargets](363532de5b/src/NoTargets/Sdk/Sdk.props (L10)), and so on.  The property `UsingMicrosoftNETSdk` is even used in the implementation of Godot.NET.Sdk for conditional logic of the type predicted here.

Note that these "Using*" properties are _additive_ in the sense that more than one can be defined for a given project (as SDKs can effectively be built upon other SDKs, using them as components).  So, it is normal and appropriate for both `UsingMicrosoftNETSdk` and `UsingGodotNETSdk` to be simultaneously defined within the same project.
2024-03-18 09:48:52 -07:00
Thaddeus Crews 3b3e2374c9
clang-tidy: Enforce modernize-use-nullptr 2024-03-12 10:59:53 -05: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 6315429999
Merge pull request #89007 from paulloz/dotnet/fix-interpolated-string-scriptpropertydefval
[.NET] Fix interpolated strings in ScriptPropertyDefVal
2024-03-04 13:33:25 +01:00
Rémi Verschelde 5d3369e095
Merge pull request #85153 from Repiteo/scons-improve-logs
SCons: Add two new `COMSTR` environment variables
2024-03-04 13:32:38 +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
Thaddeus Crews 0ce9b6fd1d
Add two new COMSTR environment variables 2024-03-01 12:44:03 -06:00
Paul Joannon 42233284b1
Fix interpolated strings in ScriptPropertyDefVal 2024-03-01 11:24:46 +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
Rémi Verschelde 730ef374b4
Merge pull request #88652 from RobProductions/fix-hover-margin
Fix editor hover style margins when Draw Extra Borders is enabled
2024-02-27 10:17:34 +01: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
Matt Enad f75cffcd46 Fix hover style margin with extra borders enabled
The content margins for FlatMenuButton and RunBarButton are now handled correctly when the "Draw Extra Borders" user option is enabled
2024-02-21 21:36:48 -05:00
Rémi Verschelde c6d091e0f3
Merge pull request #87253 from van800/van800/analyser
Provide a roslyn analyzers corresponding to the GD0001 and GD0002
2024-02-21 15:22:54 +01:00
Ivan Shakhov 00dc19585b provide analyser corresponding to the GD0001 and GD0002, add ClassPartialModifierAnalyzerFix, and tests
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-02-21 12:35:28 +03:00
Rémi Verschelde aeaec000fc
Merge pull request #88495 from paulloz/dotnet/test-and-fix-exports-diagnostics
[.NET] Test and fix exports diagnostics
2024-02-21 07:43:08 +01:00
Rémi Verschelde 00f6c97610
Merge pull request #80343 from raulsntos/dotnet/warnings/RS2008
C#: Add analyzer release tracking
2024-02-20 23:59:39 +01:00
Rémi Verschelde 1aab6e96b9
Merge pull request #87133 from Repiteo/dotnet/enforce-globalization-rules
C#: Enforce globalization code quality rules
2024-02-20 20:04:30 +01:00
Rémi Verschelde 9e9dcdbba4
Merge pull request #86378 from RobProductions/update-hover-styling
Add hover highlight to main editor buttons
2024-02-20 19:34:40 +01:00
Thaddeus Crews 000d12d237
C#: Enforce Globalization code quality rules 2024-02-20 11:15:12 -06:00
Paul Joannon 88ad4e6c24
Add tests and fix exports diagnostics
- Add tests for the following diagnostics: GD0101, GD0102, GD0103, GD0104, GD0105, GD0106, GD0107.
- Fix GD0101 not being reported any more (was filtering static classes before reporting).
- Fix GD0107 not preventing `Node` members from being exported from not-`Node` types.
2024-02-20 11:24:41 +01:00
Raul Santos f685c69bd4
C#: Add analyzer release tracking
Fixes diagnostic RS2008.
2024-02-19 19:47:40 +01:00
Ivan Shakhov 703c34a788 Bump Rider.PathLocator nuget version, which provides a fix for detecting Rider installations 2024-02-19 21:04:28 +03:00
Raul Santos fe280ef9ae
C#: Various fixes to generic scripts
- Report a diagnostic when there are multiple classes that match the script file name in the same script since that will result in a duplicate path key in the bimap and it's not allowed.
- Fix InspectorPlugin to handle empty paths in case the project was built with a previous version of Godot that used empty paths for generic scripts.
- Add tests for the new diagnostic GD0003.
2024-02-19 06:33:13 +01:00
Rémi Verschelde 9f48330c3f
Merge pull request #88469 from paulloz/dotnet/cleaner-diagnostic-rules
[.NET] Clean diagnostic rules
2024-02-19 00:08:30 +01:00