Skip to content

Commit 9a5fa74

Browse files
authored
Reword diagnostic about which types can use [out], remove unused diagnostics (#90188)
1 parent a67d5f1 commit 9a5fa74

File tree

16 files changed

+60
-340
lines changed

16 files changed

+60
-340
lines changed

src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/GeneratorDiagnostics.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public class Ids
154154
public static readonly DiagnosticDescriptor ParameterTypeNotSupported =
155155
new DiagnosticDescriptor(
156156
Ids.TypeNotSupported,
157-
GetResourceString(nameof(SR.TypeNotSupportedTitle)),
157+
GetResourceString(nameof(SR.TypeNotSupportedTitleCom)),
158158
GetResourceString(nameof(SR.TypeNotSupportedMessageParameterCom)),
159159
Category,
160160
DiagnosticSeverity.Error,
@@ -165,7 +165,7 @@ public class Ids
165165
public static readonly DiagnosticDescriptor ReturnTypeNotSupported =
166166
new DiagnosticDescriptor(
167167
Ids.TypeNotSupported,
168-
GetResourceString(nameof(SR.TypeNotSupportedTitle)),
168+
GetResourceString(nameof(SR.TypeNotSupportedTitleCom)),
169169
GetResourceString(nameof(SR.TypeNotSupportedMessageReturnCom)),
170170
Category,
171171
DiagnosticSeverity.Error,
@@ -176,7 +176,7 @@ public class Ids
176176
public static readonly DiagnosticDescriptor ParameterTypeNotSupportedWithDetails =
177177
new DiagnosticDescriptor(
178178
Ids.TypeNotSupported,
179-
GetResourceString(nameof(SR.TypeNotSupportedTitle)),
179+
GetResourceString(nameof(SR.TypeNotSupportedTitleCom)),
180180
GetResourceString(nameof(SR.TypeNotSupportedMessageParameterWithDetails)),
181181
Category,
182182
DiagnosticSeverity.Error,
@@ -187,7 +187,7 @@ public class Ids
187187
public static readonly DiagnosticDescriptor ReturnTypeNotSupportedWithDetails =
188188
new DiagnosticDescriptor(
189189
Ids.TypeNotSupported,
190-
GetResourceString(nameof(SR.TypeNotSupportedTitle)),
190+
GetResourceString(nameof(SR.TypeNotSupportedTitleCom)),
191191
GetResourceString(nameof(SR.TypeNotSupportedMessageReturnWithDetails)),
192192
Category,
193193
DiagnosticSeverity.Error,

src/libraries/System.Runtime.InteropServices/gen/Common/Resources/Strings.resx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@
840840
<data name="TypeNotSupportedTitle" xml:space="preserve">
841841
<value>Specified type is not supported by source-generated P/Invokes</value>
842842
</data>
843-
<data name="TypeNotSupportedTitle1" xml:space="preserve">
843+
<data name="TypeNotSupportedTitleCom" xml:space="preserve">
844844
<value>Specified type is not supported by source-generated COM</value>
845845
</data>
846846
<data name="UnnecessaryMarshallingInfoDescription" xml:space="preserve">
@@ -874,25 +874,13 @@
874874
<data name="InOutAttributes" xml:space="preserve">
875875
<value>[In] and [Out] attributes</value>
876876
</data>
877-
<data name="InAttributeOnlyNotSupportedOnPinnedParameters" xml:space="preserve">
878-
<value>This parameter is marshalled by pinning and does not support the '[In]' attribute without the '[Out]' attribute.</value>
879-
</data>
880-
<data name="PinnedMarshallingIsInOutByDefault" xml:space="preserve">
881-
<value>This parameter is marshalled by pinning and is '[In, Out]' by default.</value>
882-
</data>
883-
<data name="InRefKindIsNotSupportedOnPinnedParameters" xml:space="preserve">
884-
<value>The 'in' keyword is not supported on parameters that are marshalled by pinning. Use 'ref' or 'out' instead.</value>
885-
</data>
886-
<data name="TypeDoesNotSupportByValueMarshalingAttributes" xml:space="preserve">
887-
<value>'[In]' and '[Out]' attributes are not supported on this type.</value>
888-
</data>
889877
<data name="OutAttributeNotSupportedOnByValueParameters" xml:space="preserve">
890-
<value>The `[Out]` attribute is only supported on array parameters and parameters marshalled by pinning. Consider using 'out' or 'ref' keywords to make the parameter mutable.</value>
878+
<value>The `[Out]` attribute is only supported on array parameters. Consider using 'out' or 'ref' keywords to make the parameter mutable.</value>
891879
</data>
892880
<data name="ComMethodReturningIntWillBeOutParameterMessage" xml:space="preserve">
893881
<value>The return value in the managed definition will be converted to an 'out' parameter when calling the unmanaged COM method. If the return value is intended to be the HRESULT code returned by the unmanaged COM method, use '[PreserveSig]' on the method.</value>
894882
</data>
895883
<data name="ComMethodReturningIntWillBeOutParameterTitle" xml:space="preserve">
896884
<value>The return value in the managed definition will be converted to an additional 'out' parameter at the end of the parameter list when calling the unmanaged COM method.</value>
897885
</data>
898-
</root>
886+
</root>

src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.cs.xlf

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,6 @@
447447
<target state="translated">Atribut „[In]“ není nezbytný, pokud není použit také atribut „[Out]“. Chování atributu „[In]“ bez atributu „[Out]“ je stejné, jako výchozí chování.</target>
448448
<note />
449449
</trans-unit>
450-
<trans-unit id="InAttributeOnlyNotSupportedOnPinnedParameters">
451-
<source>This parameter is marshalled by pinning and does not support the '[In]' attribute without the '[Out]' attribute.</source>
452-
<target state="translated">Tento parametr je zařazován připnutím a nepodporuje atribut [In] bez atributu [Out].</target>
453-
<note />
454-
</trans-unit>
455450
<trans-unit id="InOutAttributeByRefNotSupported">
456451
<source>The '[In]' and '[Out]' attributes are unsupported on parameters passed by reference. Use the 'in', 'ref', or 'out' keywords instead.</source>
457452
<target state="translated">Atributy „[In]“ a „[Out]“ se nepodporují u parametrů předaných odkazem. Použijte místo nich klíčová slova „in“, „ref“ nebo „out“.</target>
@@ -467,11 +462,6 @@
467462
<target state="translated">atributy [In] a [Out]</target>
468463
<note />
469464
</trans-unit>
470-
<trans-unit id="InRefKindIsNotSupportedOnPinnedParameters">
471-
<source>The 'in' keyword is not supported on parameters that are marshalled by pinning. Use 'ref' or 'out' instead.</source>
472-
<target state="translated">Klíčové slovo „in“ není podporováno u parametrů, které jsou zařazeny připnutím. Místo toho použijte „ref“ nebo „out“.</target>
473-
<note />
474-
</trans-unit>
475465
<trans-unit id="InstanceEventDeclaredInInterfaceDescription">
476466
<source>Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces.</source>
477467
<target state="translated">Události nejsou konceptem COM, takže pro události instance na rozhraních COM generovaných zdrojem nebude vygenerován žádný kód spolupráce.</target>
@@ -903,8 +893,8 @@
903893
<note />
904894
</trans-unit>
905895
<trans-unit id="OutAttributeNotSupportedOnByValueParameters">
906-
<source>The `[Out]` attribute is only supported on array parameters and parameters marshalled by pinning. Consider using 'out' or 'ref' keywords to make the parameter mutable.</source>
907-
<target state="translated">Atribut [Out] je podporován pouze u parametrů pole a parametrů zařazených připnutím. Zvažte použití klíčových slov out nebo ref, aby byl parametr měnitelný.</target>
896+
<source>The `[Out]` attribute is only supported on array parameters. Consider using 'out' or 'ref' keywords to make the parameter mutable.</source>
897+
<target state="needs-review-translation">Atribut [Out] je podporován pouze u parametrů pole a parametrů zařazených připnutím. Zvažte použití klíčových slov out nebo ref, aby byl parametr měnitelný.</target>
908898
<note />
909899
</trans-unit>
910900
<trans-unit id="OutRequiresToManagedDescription">
@@ -917,11 +907,6 @@
917907
<target state="translated">Typ {0}určuje, že podporuje zařazování ve směru „Out“, ale neposkytuje metodu ToManaged, která vrací spravovaný typ</target>
918908
<note />
919909
</trans-unit>
920-
<trans-unit id="PinnedMarshallingIsInOutByDefault">
921-
<source>This parameter is marshalled by pinning and is '[In, Out]' by default.</source>
922-
<target state="translated">Tento parametr se zařazuje připnutím a ve výchozím nastavení je [In, Out].</target>
923-
<note />
924-
</trans-unit>
925910
<trans-unit id="RequiresAllowUnsafeBlocksDescriptionCom">
926911
<source>'GeneratedComInterfaceAttribute' and 'GeneratedComClassAttribute' require unsafe code. Project must be updated with '&lt;AllowUnsafeBlocks&gt;true&lt;/AllowUnsafeBlocks&gt;'.</source>
927912
<target state="translated">GeneratedComInterfaceAttribute a GeneratedComClassAttribute vyžadují nebezpečný kód. Projekt se musí aktualizovat na &lt;AllowUnsafeBlocks&gt;true&lt;/AllowUnsafeBlocks&gt;.</target>
@@ -1162,11 +1147,6 @@
11621147
<target state="translated">„{0}“ má přístupnost „{1}“.</target>
11631148
<note />
11641149
</trans-unit>
1165-
<trans-unit id="TypeDoesNotSupportByValueMarshalingAttributes">
1166-
<source>'[In]' and '[Out]' attributes are not supported on this type.</source>
1167-
<target state="translated">Atributy [In] a [Out] nejsou u tohoto typu podporovány.</target>
1168-
<note />
1169-
</trans-unit>
11701150
<trans-unit id="TypeMustBeUnmanagedDescription">
11711151
<source>The unmanaged type for a custom marshaller must be a C# unmanaged type.</source>
11721152
<target state="translated">Nespravovaný typ vlastního zařazovacího modulu musí být nespravovaný typ jazyka C#.</target>
@@ -1234,9 +1214,9 @@
12341214
<target state="translated">Určený typ nepodporují zdrojem generovaná volání P/Invokes.</target>
12351215
<note />
12361216
</trans-unit>
1237-
<trans-unit id="TypeNotSupportedTitle1">
1217+
<trans-unit id="TypeNotSupportedTitleCom">
12381218
<source>Specified type is not supported by source-generated COM</source>
1239-
<target state="translated">Zadaný typ není podporován modelem COM generovaným zdrojem.</target>
1219+
<target state="new">Specified type is not supported by source-generated COM</target>
12401220
<note />
12411221
</trans-unit>
12421222
<trans-unit id="UnmanagedToManagedMissingRequiredMarshaller">

src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.de.xlf

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,6 @@
447447
<target state="translated">Das [In]-Attribut ist nur erforderlich, wenn auch das [Out]-Attribut verwendet wird. Das Verhalten des [In]-Attributs ohne das [Out]-Attribut entspricht dem Standardverhalten.</target>
448448
<note />
449449
</trans-unit>
450-
<trans-unit id="InAttributeOnlyNotSupportedOnPinnedParameters">
451-
<source>This parameter is marshalled by pinning and does not support the '[In]' attribute without the '[Out]' attribute.</source>
452-
<target state="translated">Dieser Parameter wird durch Anheften gemarshallt und unterstützt das [In]-Attribut ohne das [Out]-Attribut nicht.</target>
453-
<note />
454-
</trans-unit>
455450
<trans-unit id="InOutAttributeByRefNotSupported">
456451
<source>The '[In]' and '[Out]' attributes are unsupported on parameters passed by reference. Use the 'in', 'ref', or 'out' keywords instead.</source>
457452
<target state="translated">Die Attribute \"[In]\" und \"[Out]\" werden für Parameter, die als Verweis übergeben werden, nicht unterstützt. Verwenden Sie stattdessen die Schlüsselwörter \"in\", \"ref\" oder \"out\".</target>
@@ -467,11 +462,6 @@
467462
<target state="translated">[In]- und [Out]-Attribute</target>
468463
<note />
469464
</trans-unit>
470-
<trans-unit id="InRefKindIsNotSupportedOnPinnedParameters">
471-
<source>The 'in' keyword is not supported on parameters that are marshalled by pinning. Use 'ref' or 'out' instead.</source>
472-
<target state="translated">Das Schlüsselwort "in" wird für Parameter, die durch Anheften gemarshallt werden, nicht unterstützt. Verwenden Sie stattdessen "ref" oder "out".</target>
473-
<note />
474-
</trans-unit>
475465
<trans-unit id="InstanceEventDeclaredInInterfaceDescription">
476466
<source>Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces.</source>
477467
<target state="translated">Ereignisse sind kein Konzept in COM, daher wird kein Interopcode für Instanzereignisse auf von der Quelle generierten COM-Schnittstellen generiert.</target>
@@ -903,8 +893,8 @@
903893
<note />
904894
</trans-unit>
905895
<trans-unit id="OutAttributeNotSupportedOnByValueParameters">
906-
<source>The `[Out]` attribute is only supported on array parameters and parameters marshalled by pinning. Consider using 'out' or 'ref' keywords to make the parameter mutable.</source>
907-
<target state="translated">Das [Out]-Attribut wird nur für Arrayparameter und Parameter unterstützt, die durch Anheften gemarshallt werden. Erwägen Sie die Verwendung der Schlüsselwörter "out" oder "ref", um den Parameter änderbar zu machen.</target>
896+
<source>The `[Out]` attribute is only supported on array parameters. Consider using 'out' or 'ref' keywords to make the parameter mutable.</source>
897+
<target state="needs-review-translation">Das [Out]-Attribut wird nur für Arrayparameter und Parameter unterstützt, die durch Anheften gemarshallt werden. Erwägen Sie die Verwendung der Schlüsselwörter "out" oder "ref", um den Parameter änderbar zu machen.</target>
908898
<note />
909899
</trans-unit>
910900
<trans-unit id="OutRequiresToManagedDescription">
@@ -917,11 +907,6 @@
917907
<target state="translated">Der Typ \"{0}\" gibt an, dass das Marshalling in der Out-Richtung unterstützt wird. Er stellt jedoch keine ToManaged-Methode bereit, die den verwalteten Typ zurückgibt.</target>
918908
<note />
919909
</trans-unit>
920-
<trans-unit id="PinnedMarshallingIsInOutByDefault">
921-
<source>This parameter is marshalled by pinning and is '[In, Out]' by default.</source>
922-
<target state="translated">Dieser Parameter wird durch Anheften gemarshallt und ist standardmäßig "[In, Out]".</target>
923-
<note />
924-
</trans-unit>
925910
<trans-unit id="RequiresAllowUnsafeBlocksDescriptionCom">
926911
<source>'GeneratedComInterfaceAttribute' and 'GeneratedComClassAttribute' require unsafe code. Project must be updated with '&lt;AllowUnsafeBlocks&gt;true&lt;/AllowUnsafeBlocks&gt;'.</source>
927912
<target state="translated">'GeneratedComInterfaceAttribute' und 'GeneratedComClassAttribute' erfordern unsicheren Code. Das Projekt muss mit '&lt;AllowUnsafeBlocks&gt;wahr&lt;/AllowUnsafeBlocks&gt;' aktualisiert werden.</target>
@@ -1162,11 +1147,6 @@
11621147
<target state="translated">'{0}' verfügt über Barrierefreiheit '{1}'.</target>
11631148
<note />
11641149
</trans-unit>
1165-
<trans-unit id="TypeDoesNotSupportByValueMarshalingAttributes">
1166-
<source>'[In]' and '[Out]' attributes are not supported on this type.</source>
1167-
<target state="translated">Die Attribute "[In]" und "[Out]" werden für diesen Typ nicht unterstützt.</target>
1168-
<note />
1169-
</trans-unit>
11701150
<trans-unit id="TypeMustBeUnmanagedDescription">
11711151
<source>The unmanaged type for a custom marshaller must be a C# unmanaged type.</source>
11721152
<target state="translated">Der nicht verwaltete Typ für einen benutzerdefinierten Marshaller muss ein nicht verwalteter C#-Typ sein.</target>
@@ -1234,9 +1214,9 @@
12341214
<target state="translated">Der angegebene Typ wird von quellgenerierten P/Invokes nicht unterstützt.</target>
12351215
<note />
12361216
</trans-unit>
1237-
<trans-unit id="TypeNotSupportedTitle1">
1217+
<trans-unit id="TypeNotSupportedTitleCom">
12381218
<source>Specified type is not supported by source-generated COM</source>
1239-
<target state="translated">Der angegebene Typ wird vom quellgenerierten COM nicht unterstützt.</target>
1219+
<target state="new">Specified type is not supported by source-generated COM</target>
12401220
<note />
12411221
</trans-unit>
12421222
<trans-unit id="UnmanagedToManagedMissingRequiredMarshaller">

0 commit comments

Comments
 (0)