222 references to SR
Microsoft.Interop.LibraryImportGenerator (222)
Analyzers\AnalyzerDiagnostics.cs (1)
33return new LocalizableResourceString(resourceName, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
Analyzers\ConvertToLibraryImportAnalyzer.cs (4)
26GetResourceString(nameof(SR.ConvertToLibraryImportTitle)), 27GetResourceString(nameof(SR.ConvertToLibraryImportMessage)), 31description: GetResourceString(nameof(SR.ConvertToLibraryImportDescription))); 141GeneratorDiagnosticsBag diagnostics = new(new DiagnosticDescriptorProvider(), new MethodSignatureDiagnosticLocations((MethodDeclarationSyntax)method.DeclaringSyntaxReferences[0].GetSyntax()), SR.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
Analyzers\ConvertToLibraryImportFixer.cs (8)
49(true, true) => SR.Format(SR.ConvertToLibraryImportWithSuffixAddUnsafe, suffix), 50(true, false) => SR.ConvertToLibraryImportAddUnsafe, 51(false, true) => SR.Format(SR.ConvertToLibraryImportWithSuffix, suffix), 52(false, false) => SR.ConvertToLibraryImport 198generatedDeclaration = generatedDeclaration.WithAdditionalAnnotations(WarningAnnotation.Create(SR.ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode)); 244WarningAnnotation.Create(SR.ConvertToLibraryImportMayRequireCustomMarshalling));
Analyzers\CustomMarshallerAttributeAnalyzer.cs (129)
46GetResourceString(nameof(SR.InvalidCustomMarshallerAttributeUsageTitle)), 47GetResourceString(nameof(SR.MarshallerTypeMustSpecifyManagedTypeMessage)), 51description: GetResourceString(nameof(SR.MarshallerTypeMustSpecifyManagedTypeDescription))); 57GetResourceString(nameof(SR.InvalidMarshallerTypeTitle)), 58GetResourceString(nameof(SR.MarshallerTypeMustBeStaticClassOrStructMessage)), 62description: GetResourceString(nameof(SR.MarshallerTypeMustBeStaticClassOrStructDescription))); 68GetResourceString(nameof(SR.InvalidMarshallerTypeTitle)), 69GetResourceString(nameof(SR.ElementMarshallerCannotBeStatefulMessage)), 73description: GetResourceString(nameof(SR.ElementMarshallerCannotBeStatefulDescription))); 79GetResourceString(nameof(SR.InvalidMarshallerTypeTitle)), 80GetResourceString(nameof(SR.TypeMustBeUnmanagedMessage)), 84description: GetResourceString(nameof(SR.TypeMustBeUnmanagedDescription))); 90GetResourceString(nameof(SR.InvalidSignaturesInMarshallerShapeTitle)), 91GetResourceString(nameof(SR.GetPinnableReferenceReturnTypeBlittableMessage)), 95description: GetResourceString(nameof(SR.GetPinnableReferenceReturnTypeBlittableDescription))); 101GetResourceString(nameof(SR.InvalidMarshallerTypeTitle)), 102GetResourceString(nameof(SR.TypeMustHaveExplicitCastFromVoidPointerMessage)), 106description: GetResourceString(nameof(SR.TypeMustHaveExplicitCastFromVoidPointerDescription))); 112GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 113GetResourceString(nameof(SR.StatelessValueInRequiresConvertToUnmanagedMessage)), 117description: GetResourceString(nameof(SR.StatelessValueInRequiresConvertToUnmanagedDescription))); 123GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 124GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsMessage)), 128description: GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsDescription))); 134GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 135GetResourceString(nameof(SR.OutRequiresToManagedMessage)), 139description: GetResourceString(nameof(SR.OutRequiresToManagedDescription))); 145GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 146GetResourceString(nameof(SR.StatelessRequiresConvertToManagedMessage)), 150description: GetResourceString(nameof(SR.StatelessRequiresConvertToManagedDescription))); 156GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 157GetResourceString(nameof(SR.LinearCollectionInRequiresCollectionMethodsMessage)), 161description: GetResourceString(nameof(SR.LinearCollectionInRequiresCollectionMethodsDescription))); 167GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 168GetResourceString(nameof(SR.StatelessLinearCollectionInRequiresCollectionMethodsMessage)), 172description: GetResourceString(nameof(SR.StatelessLinearCollectionInRequiresCollectionMethodsDescription))); 178GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 179GetResourceString(nameof(SR.LinearCollectionOutRequiresCollectionMethodsMessage)), 183description: GetResourceString(nameof(SR.LinearCollectionOutRequiresCollectionMethodsDescription))); 189GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 190GetResourceString(nameof(SR.StatelessLinearCollectionOutRequiresCollectionMethodsMessage)), 194description: GetResourceString(nameof(SR.StatelessLinearCollectionOutRequiresCollectionMethodsDescription))); 200GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 201GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsMessage)), 205description: GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsDescription))); 211GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 212GetResourceString(nameof(SR.CallerAllocFromManagedMustHaveBufferSizeMessage)), 216description: GetResourceString(nameof(SR.CallerAllocFromManagedMustHaveBufferSizeDescription))); 222GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 223GetResourceString(nameof(SR.StatelessLinearCollectionCallerAllocFromManagedMustHaveBufferSizeMessage)), 227description: GetResourceString(nameof(SR.StatelessLinearCollectionCallerAllocFromManagedMustHaveBufferSizeDescription))); 233GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 234GetResourceString(nameof(SR.StatefulMarshallerRequiresFromManagedMessage)), 238description: GetResourceString(nameof(SR.StatefulMarshallerRequiresFromManagedDescription))); 244GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 245GetResourceString(nameof(SR.StatefulMarshallerRequiresToUnmanagedMessage)), 249description: GetResourceString(nameof(SR.StatefulMarshallerRequiresToUnmanagedDescription))); 255GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 256GetResourceString(nameof(SR.StatefulMarshallerRequiresToManagedMessage)), 260description: GetResourceString(nameof(SR.StatefulMarshallerRequiresToManagedDescription))); 266GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 267GetResourceString(nameof(SR.StatefulMarshallerRequiresFromUnmanagedMessage)), 271description: GetResourceString(nameof(SR.StatefulMarshallerRequiresFromUnmanagedDescription))); 277GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 278GetResourceString(nameof(SR.StatefulMarshallerRequiresFreeMessage)), 282description: GetResourceString(nameof(SR.StatefulMarshallerRequiresFreeDescription))); 288GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 289GetResourceString(nameof(SR.FromUnmanagedOverloadsNotSupportedMessage)), 293description: GetResourceString(nameof(SR.FromUnmanagedOverloadsNotSupportedDescription))); 299GetResourceString(nameof(SR.InvalidMarshallerTypeTitle)), 300GetResourceString(nameof(SR.MarshallerTypeMustBeClosedOrMatchArityMessage)), 304description: GetResourceString(nameof(SR.MarshallerTypeMustBeClosedOrMatchArityDescription))); 310GetResourceString(nameof(SR.InvalidMarshallerTypeTitle)), 311GetResourceString(nameof(SR.MarshallerTypeMustBeNonNullMessage)), 315description: GetResourceString(nameof(SR.MarshallerTypeMustBeNonNullDescription))); 321GetResourceString(nameof(SR.InvalidSignaturesInMarshallerShapeTitle)), 322GetResourceString(nameof(SR.FirstParameterMustMatchReturnTypeMessage)), 326description: GetResourceString(nameof(SR.FirstParameterMustMatchReturnTypeDescription))); 332GetResourceString(nameof(SR.InvalidSignaturesInMarshallerShapeTitle)), 333GetResourceString(nameof(SR.ReturnTypesMustMatchMessage)), 337description: GetResourceString(nameof(SR.ReturnTypesMustMatchDescription))); 343GetResourceString(nameof(SR.InvalidSignaturesInMarshallerShapeTitle)), 344GetResourceString(nameof(SR.FirstParametersMustMatchMessage)), 348description: GetResourceString(nameof(SR.FirstParametersMustMatchDescription))); 354GetResourceString(nameof(SR.InvalidSignaturesInMarshallerShapeTitle)), 355GetResourceString(nameof(SR.ElementTypesOfReturnTypesMustMatchMessage)), 359description: GetResourceString(nameof(SR.ElementTypesOfReturnTypesMustMatchDescription))); 365GetResourceString(nameof(SR.InvalidSignaturesInMarshallerShapeTitle)), 366GetResourceString(nameof(SR.ReturnTypeMustBeExpectedTypeMessage)), 370description: GetResourceString(nameof(SR.ReturnTypeMustBeExpectedTypeDescription))); 376GetResourceString(nameof(SR.InvalidManagedTypeTitle)), 377GetResourceString(nameof(SR.ManagedTypeMustBeClosedOrMatchArityMessage)), 381description: GetResourceString(nameof(SR.ManagedTypeMustBeClosedOrMatchArityDescription))); 387GetResourceString(nameof(SR.InvalidManagedTypeTitle)), 388GetResourceString(nameof(SR.ManagedTypeMustBeNonNullMessage)), 392description: GetResourceString(nameof(SR.ManagedTypeMustBeNonNullDescription))); 398GetResourceString(nameof(SR.InvalidMarshalModeTitle)), 399GetResourceString(nameof(SR.MarshalModeMustBeValidEnumValue)), 403description: GetResourceString(nameof(SR.MarshalModeMustBeValidEnumValue))); 416GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 417GetResourceString(nameof(SR.StatelessValueInRequiresConvertToUnmanagedMessage)), 421description: GetResourceString(nameof(SR.StatelessValueInRequiresConvertToUnmanagedDescription))); 427GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 428GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsMessage)), 432description: GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForUnmanagedElementsDescription))); 438GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 439GetResourceString(nameof(SR.StatelessRequiresConvertToManagedMessage)), 443description: GetResourceString(nameof(SR.StatelessRequiresConvertToManagedDescription))); 449GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 450GetResourceString(nameof(SR.StatelessLinearCollectionInRequiresCollectionMethodsMessage)), 454description: GetResourceString(nameof(SR.StatelessLinearCollectionInRequiresCollectionMethodsDescription))); 460GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 461GetResourceString(nameof(SR.StatelessLinearCollectionOutRequiresCollectionMethodsMessage)), 465description: GetResourceString(nameof(SR.StatelessLinearCollectionOutRequiresCollectionMethodsDescription))); 471GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 472GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsMessage)), 476description: GetResourceString(nameof(SR.StatelessLinearCollectionRequiresTwoParameterAllocateContainerForManagedElementsDescription))); 482GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 483GetResourceString(nameof(SR.StatefulMarshallerRequiresFromManagedMessage)), 487description: GetResourceString(nameof(SR.StatefulMarshallerRequiresFromManagedDescription))); 493GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 494GetResourceString(nameof(SR.StatefulMarshallerRequiresToUnmanagedMessage)), 498description: GetResourceString(nameof(SR.StatefulMarshallerRequiresToUnmanagedDescription))); 504GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 505GetResourceString(nameof(SR.StatefulMarshallerRequiresToManagedMessage)), 509description: GetResourceString(nameof(SR.StatefulMarshallerRequiresToManagedDescription))); 515GetResourceString(nameof(SR.CustomMarshallerTypeMustHaveRequiredShapeTitle)), 516GetResourceString(nameof(SR.StatefulMarshallerRequiresFromUnmanagedMessage)), 520description: GetResourceString(nameof(SR.StatefulMarshallerRequiresFromUnmanagedDescription)));
Analyzers\CustomMarshallerAttributeFixer.cs (2)
84return CodeAction.Create(SR.AddMissingCustomTypeMarshallerMembers, ct => Task.FromResult(symbolEditor.ChangedSolution)); 123SR.AddMissingCustomTypeMarshallerMembers,
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (3)
246SR.ResourceManager, 264libraryImportAttr, symbol.Name, SR.InvalidStringMarshallingConfigurationMissingCustomType); 271libraryImportAttr, symbol.Name, SR.InvalidStringMarshallingConfigurationNotCustom);
Analyzers\NativeMarshallingAttributeAnalyzer.cs (9)
27GetResourceString(nameof(SR.InvalidNativeMarshallingAttributeUsageTitle)), 28GetResourceString(nameof(SR.EntryPointTypeMustHaveCustomMarshallerAttributeWithMatchingManagedTypeMessage)), 32description: GetResourceString(nameof(SR.EntryPointTypeMustHaveCustomMarshallerAttributeWithMatchingManagedTypeDescription))); 37GetResourceString(nameof(SR.InvalidNativeMarshallingAttributeUsageTitle)), 38GetResourceString(nameof(SR.EntryPointTypeMustBeNonNullMessage)), 42description: GetResourceString(nameof(SR.EntryPointTypeMustBeNonNullDescription))); 47GetResourceString(nameof(SR.InvalidNativeMarshallingAttributeUsageTitle)), 48GetResourceString(nameof(SR.GenericEntryPointMarshallerTypeMustBeClosedOrMatchArityMessage)), 52description: GetResourceString(nameof(SR.GenericEntryPointMarshallerTypeMustBeClosedOrMatchArityDescription)));
GeneratorDiagnostics.cs (64)
36GetResourceString(nameof(SR.InvalidLibraryImportAttributeUsageTitle)), 37GetResourceString(nameof(SR.InvalidAttributedMethodSignatureMessageLibraryImport)), 41description: GetResourceString(nameof(SR.InvalidAttributedMethodDescriptionLibraryImport))); 47GetResourceString(nameof(SR.InvalidLibraryImportAttributeUsageTitle)), 48GetResourceString(nameof(SR.InvalidAttributedMethodContainingTypeMissingModifiersMessageLibraryImport)), 52description: GetResourceString(nameof(SR.InvalidAttributedMethodDescriptionLibraryImport))); 58GetResourceString(nameof(SR.InvalidLibraryImportAttributeUsageTitle)), 59GetResourceString(nameof(SR.InvalidStringMarshallingConfigurationMessageLibraryImport)), 63description: GetResourceString(nameof(SR.InvalidStringMarshallingConfigurationDescription))); 69GetResourceString(nameof(SR.TypeNotSupportedTitle)), 70GetResourceString(nameof(SR.TypeNotSupportedMessageParameterLibraryImport)), 74description: GetResourceString(nameof(SR.TypeNotSupportedDescriptionLibraryImport))); 80GetResourceString(nameof(SR.TypeNotSupportedTitle)), 81GetResourceString(nameof(SR.TypeNotSupportedMessageReturnLibraryImport)), 85description: GetResourceString(nameof(SR.TypeNotSupportedDescriptionLibraryImport))); 91GetResourceString(nameof(SR.TypeNotSupportedTitle)), 92GetResourceString(nameof(SR.TypeNotSupportedMessageParameterWithDetails)), 96description: GetResourceString(nameof(SR.TypeNotSupportedDescriptionLibraryImport))); 102GetResourceString(nameof(SR.TypeNotSupportedTitle)), 103GetResourceString(nameof(SR.TypeNotSupportedMessageReturnWithDetails)), 107description: GetResourceString(nameof(SR.TypeNotSupportedDescriptionLibraryImport))); 113GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 114GetResourceString(nameof(SR.ConfigurationNotSupportedMessageParameterLibraryImport)), 118description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 124GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 125GetResourceString(nameof(SR.ConfigurationNotSupportedMessageReturnLibraryImport)), 129description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 135GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 136GetResourceString(nameof(SR.MarshalAsConfigurationNotSupportedMessageParameterLibraryImport)), 140description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 146GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 147GetResourceString(nameof(SR.MarshalAsConfigurationNotSupportedMessageReturnLibraryImport)), 151description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 157GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 158GetResourceString(nameof(SR.ConfigurationNotSupportedMessageLibraryImport)), 162description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 168GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 169GetResourceString(nameof(SR.ConfigurationNotSupportedMessageValueLibraryImport)), 173description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 179GetResourceString(nameof(SR.ConfigurationNotSupportedTitleLibraryImport)), 180GetResourceString(nameof(SR.ConfigurationNotSupportedMessageMarshallingInfoLibraryImport)), 184description: GetResourceString(nameof(SR.ConfigurationNotSupportedDescriptionLibraryImport))); 190GetResourceString(nameof(SR.CannotForwardToDllImportTitle)), 191GetResourceString(nameof(SR.CannotForwardToDllImportMessage)), 195description: GetResourceString(nameof(SR.CannotForwardToDllImportDescription))); 201GetResourceString(nameof(SR.RequiresAllowUnsafeBlocksTitleLibraryImport)), 202GetResourceString(nameof(SR.RequiresAllowUnsafeBlocksMessageLibraryImport)), 206description: GetResourceString(nameof(SR.RequiresAllowUnsafeBlocksDescriptionLibraryImport))); 212GetResourceString(nameof(SR.RequiresExplicitSafetyModifierTitleLibraryImport)), 213GetResourceString(nameof(SR.RequiresExplicitSafetyModifierMessageLibraryImport)), 217description: GetResourceString(nameof(SR.RequiresExplicitSafetyModifierDescriptionLibraryImport))); 223GetResourceString(nameof(SR.UnnecessaryMarshallingInfoTitle)), 224GetResourceString(nameof(SR.UnnecessaryParameterMarshallingInfoMessage)), 228description: GetResourceString(nameof(SR.UnnecessaryMarshallingInfoDescription)), 238GetResourceString(nameof(SR.UnnecessaryMarshallingInfoTitle)), 239GetResourceString(nameof(SR.UnnecessaryReturnMarshallingInfoMessage)), 243description: GetResourceString(nameof(SR.UnnecessaryMarshallingInfoDescription)), 253GetResourceString(nameof(SR.SizeOfCollectionMustBeKnownAtMarshalTimeTitle)), 254GetResourceString(nameof(SR.SizeOfCollectionMustBeKnownAtMarshalTimeMessageOutParam)), 263GetResourceString(nameof(SR.SizeOfCollectionMustBeKnownAtMarshalTimeTitle)), 264GetResourceString(nameof(SR.SizeOfCollectionMustBeKnownAtMarshalTimeMessageReturnValue)), 273GetResourceString(nameof(SR.LibraryImportUsageDoesNotFollowBestPracticesTitle)), 274GetResourceString(nameof(SR.LibraryImportUsageDoesNotFollowBestPracticesMessageWithDetails)), 315return new LocalizableResourceString(resourceName, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));
LibraryImportGenerator.cs (2)
269var discardedDiagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), locations, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR)); 313var discardedDiagnostics = new GeneratorDiagnosticsBag(new DiagnosticDescriptorProvider(), pinvokeStub.DiagnosticLocation, SR.ResourceManager, typeof(FxResources.Microsoft.Interop.LibraryImportGenerator.SR));