From 7e491623e49288c510be83541821c83bb281f9b3 Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:15:44 +1100 Subject: [PATCH 1/2] fix: Resolve duplicate GeneratedCodeAttribute error and enhance XML documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem Users reported CS0579 "Duplicate 'GeneratedCodeAttribute' attribute" errors when using Splat.DependencyInjection.SourceGenerator v2.1.1 alongside ReactiveUI.SourceGenerators v2.5.1. This occurred because both partial class declarations of `SplatRegistrations` (in Splat.DI.g.cs and Splat.DI.Reg.g.cs) were applying the `[GeneratedCodeAttribute]` attribute, causing a compilation error. ## Changes ### Bug Fixes - **Fixed duplicate attribute error**: Removed `[GeneratedCodeAttribute]` from the generated `Splat.DI.Reg.g.cs` file. The attribute now only appears once on the partial class in `Splat.DI.g.cs`, eliminating the CS0579 error - **Fixed RegisterConstant signature**: Added `where T : class` constraint to match Splat's API, preventing CS0452 type constraint errors ### Documentation Improvements - **Enhanced XML documentation in Constants.cs**: All registration methods now include: - Detailed `` descriptions explaining transient vs singleton behavior - Complete `` documentation for generic type parameters - Proper `` tags with clear explanations - `` references to related types - `` sections explaining analyzer diagnostics and attribute behavior - **Added XML documentation to generated code**: The generated `Splat.DI.Reg.g.cs` now includes: - Class-level documentation explaining the partial class structure - Method-level documentation for `SetupIOCInternal` with parameter descriptions - `` references for better IntelliSense navigation ### Testing & Project Organization - Reorganized test structure: Moved test projects to `src/tests/` for better organization - Added TestApp: Created `Splat.DI.SourceGenerator.TestApp` to reproduce and verify the duplicate attribute issue with real-world scenarios - Added regression tests: New test `GenerateSetupIOCMethod_DoesNotIncludeDuplicateGeneratedCodeAttribute` ensures the attribute only appears once - Updated 393 snapshot tests to reflect the improved generated code format ## Impact - ✅ Resolves compatibility issues with ReactiveUI.SourceGenerators and other source generators - ✅ Improves developer experience with comprehensive IntelliSense documentation - ✅ Better code maintainability with properly documented generated code - ✅ All 834 tests passing ## Breaking Changes None. This is a bug fix release with backward-compatible improvements. --- src/Directory.Packages.props | 4 + src/Splat.DI.SourceGenerator.slnx | 5 +- .../LS.CI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.CI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...ITypeArgument_Test1#Splat.DI.g.verified.cs | 144 ------------- ...ITypeArgument_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../LS.CIntPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.CIntPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../LS.CIntSetPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.CIntSetPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPILM_Test1_N#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPILM_Test1_P#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPILM_Test2_N#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPILM_Test2_P#Splat.DI.g.verified.cs | 144 ------------- ...ntractParameter=_EP#Splat.DI.g.verified.cs | 144 ------------- ...ontractParameter=_N#Splat.DI.g.verified.cs | 144 ------------- ...ontractParameter=_P#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.CMPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- .../LS.CNPPIF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- .../LS.CNPPIF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- .../LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- .../LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../LS.CPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.CPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...arDependencyF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...arDependencyF_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ....EConstructor_Test1#Splat.DI.g.verified.cs | 144 ------------- ....EConstructor_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...yInLSingleton_Test1#Splat.DI.g.verified.cs | 144 ------------- ...yInLSingleton_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../LS.IRegMx_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.IRegMx_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../LS.LPmRegL_Test1#Splat.DI.g.verified.cs | 144 ------------- .../LS.LPmRegL_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...orNoAttrF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- ...ructorNoAttrF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...orNoAttrF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- ...ructorNoAttrF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...ttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs | 18 -- ...rNoAttrNonDIP_Test1#Splat.DI.g.verified.cs | 144 ------------- ...ttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs | 18 -- ...rNoAttrNonDIP_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...uctorWithAttr_Test1#Splat.DI.g.verified.cs | 144 ------------- ...uctorWithAttr_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...thMAttrsF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- ...orWithMAttrsF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...thMAttrsF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- ...orWithMAttrsF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...Registrations_Test1#Splat.DI.g.verified.cs | 144 ------------- ...Registrations_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...gleton_TestContract#Splat.DI.g.verified.cs | 144 ------------- .../R.CI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.CI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...ITypeArgument_Test1#Splat.DI.g.verified.cs | 144 ------------- ...ITypeArgument_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../R.CIntPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.CIntPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../R.CIntSetPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.CIntSetPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../R.CMPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.CMPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- .../R.CNPPIF_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- .../R.CNPPIF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- .../R.CNPPSetIF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- .../R.CNPPSetIF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../R.CPI_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.CPI_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...arDependencyF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...arDependencyF_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...nstructor_Test1#Splat.DI.Reg.g.verified.cs | 19 -- ....EConstructor_Test1#Splat.DI.g.verified.cs | 144 ------------- ...nstructor_Test2#Splat.DI.Reg.g.verified.cs | 19 -- ....EConstructor_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 19 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ..._MTypePms_Test1#Splat.DI.Reg.g.verified.cs | 19 -- ...Type_MTypePms_Test1#Splat.DI.g.verified.cs | 144 ------------- ..._MTypePms_Test2#Splat.DI.Reg.g.verified.cs | 19 -- ...Type_MTypePms_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 19 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...edGeneric_Test1#Splat.DI.Reg.g.verified.cs | 19 -- ...NestedGeneric_Test1#Splat.DI.g.verified.cs | 144 ------------- ...edGeneric_Test2#Splat.DI.Reg.g.verified.cs | 19 -- ...NestedGeneric_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 19 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ..._SingleTypePm_Test1#Splat.DI.g.verified.cs | 144 ------------- ..._SingleTypePm_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...bleDependency_Test1#Splat.DI.g.verified.cs | 144 ------------- ...bleDependency_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- .../R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs | 20 -- .../R.IRegMx_Test1#Splat.DI.g.verified.cs | 144 ------------- .../R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs | 20 -- .../R.IRegMx_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 20 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...stantNotRegLF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...stantNotRegLF_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...orNoAttrF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- ...ructorNoAttrF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...orNoAttrF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- ...ructorNoAttrF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...ttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs | 18 -- ...rNoAttrNonDIP_Test1#Splat.DI.g.verified.cs | 144 ------------- ...ttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs | 18 -- ...rNoAttrNonDIP_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...uctorWithAttr_Test1#Splat.DI.g.verified.cs | 144 ------------- ...uctorWithAttr_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...thMAttrsF_Test1#Splat.DI.Reg.g.verified.cs | 18 -- ...orWithMAttrsF_Test1#Splat.DI.g.verified.cs | 144 ------------- ...thMAttrsF_Test2#Splat.DI.Reg.g.verified.cs | 18 -- ...orWithMAttrsF_Test2#Splat.DI.g.verified.cs | 144 ------------- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 18 -- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...Registrations_Test1#Splat.DI.g.verified.cs | 144 ------------- ...Registrations_Test2#Splat.DI.g.verified.cs | 144 ------------- ..._contractParameter=#Splat.DI.g.verified.cs | 144 ------------- ...ntract_TestContract#Splat.DI.g.verified.cs | 144 ------------- .../CodeGeneration/CodeGenerator.cs | 16 +- .../Constants.cs | 106 +++++++--- .../ConsoleLogger.cs | 17 ++ ...nerators.BindableDerivedListAttribute.g.cs | 19 ++ ....ReactiveUISourceGeneratorsExtensions.g.cs | 23 +++ ...UI.SourceGenerators.IViewForAttribute.g.cs | 61 ++++++ ...erators.ObservableAsPropertyAttribute.g.cs | 52 +++++ ...enerators.ReactiveCollectionAttribute.g.cs | 19 ++ ...ceGenerators.ReactiveCommandAttribute.g.cs | 44 ++++ ...iveUI.SourceGenerators.AccessModifier.g.cs | 57 +++++ ...UI.SourceGenerators.ReactiveAttribute.g.cs | 51 +++++ ...ceGenerators.IReactiveObjectAttribute.g.cs | 19 ++ ...s.WinForms.RoutedControlHostAttribute.g.cs | 23 +++ ...inForms.ViewModelControlHostAttribute.g.cs | 23 +++ ...rosoft.CodeAnalysis.EmbeddedAttribute.g.cs | 17 ++ .../Splat.DI.Reg.g.cs | 33 +++ .../Splat.DI.g.cs | 193 +++++++++++++++++ .../ILogger.cs | 17 ++ .../IService.cs | 17 ++ .../Program.cs | 47 +++++ .../ServiceImplementation.cs | 17 ++ .../ServiceWithDependency.cs | 31 +++ .../Splat.DI.SourceGenerator.TestApp.csproj | 26 +++ .../AnalyzerHelpersTests.cs | 0 .../AnalyzerTestHelper.cs | 0 .../CodeFixTestHelper.cs | 0 .../ConstructorAnalyzerTests.cs | 0 .../ConstructorCodeFixProviderTests.cs | 0 .../PropertyAnalyzerTests.cs | 0 .../PropertyCodeFixProviderTests.cs | 0 ....DependencyInjection.Analyzer.Tests.csproj | 2 +- .../TestUtilities.cs | 0 .../CodeGeneratorTests.cs | 0 .../DiagnosticWarningsTests.cs | 0 .../EquatableArrayTests.cs | 0 .../GeneratorCodeGenerationTests.cs | 30 ++- ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../LS.CI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../LS.CI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...eArgument_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...ITypeArgument_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...eArgument_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...ITypeArgument_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CIntPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CIntPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CIntSetPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CIntSetPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ....CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPILM_Test1_N#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ....CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPILM_Test1_P#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ....CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPILM_Test2_N#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ....CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPILM_Test2_P#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ctParameter=_EP#Splat.DI.Reg.g.verified.cs | 11 +- ...ntractParameter=_EP#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...actParameter=_N#Splat.DI.Reg.g.verified.cs | 11 +- ...ontractParameter=_N#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...actParameter=_P#Splat.DI.Reg.g.verified.cs | 11 +- ...ontractParameter=_P#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CMPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ .../LS.CNPPIF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ .../LS.CNPPIF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ .../LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ .../LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../LS.CPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../LS.CPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.CPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...pendencyF_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...arDependencyF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...pendencyF_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...arDependencyF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...nstructor_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ....EConstructor_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...nstructor_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ....EConstructor_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...Singleton_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...yInLSingleton_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...Singleton_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...yInLSingleton_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.IRegMx_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.IRegMx_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...S.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.LPmRegL_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...S.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../LS.LPmRegL_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...orNoAttrF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ ...ructorNoAttrF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...orNoAttrF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ ...ructorNoAttrF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ ...rNoAttrNonDIP_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ ...rNoAttrNonDIP_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...rWithAttr_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...uctorWithAttr_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...rWithAttr_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...uctorWithAttr_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...thMAttrsF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ ...orWithMAttrsF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...thMAttrsF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ ...orWithMAttrsF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...strations_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...Registrations_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...strations_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...Registrations_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...on_TestContract#Splat.DI.Reg.g.verified.cs | 11 +- ...gleton_TestContract#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ .../MetadataExtractorTests.cs | 0 .../Models/ConstructorParameterTests.cs | 0 .../Models/EquatableArrayTests.cs | 0 .../Models/PropertyInjectionTests.cs | 0 .../Models/RegistrationInfoTests.cs | 0 .../ModuleInitializer.cs | 0 ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...eArgument_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...ITypeArgument_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...eArgument_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...ITypeArgument_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CIntPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CIntPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CIntSetPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CIntSetPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CMPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CMPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CMPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CMPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ .../R.CNPPIF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ .../R.CNPPIF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ .../R.CNPPSetIF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ .../R.CNPPSetIF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CPI_Test1#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CPI_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.CPI_Test2#Splat.DI.Reg.g.verified.cs | 11 +- .../R.CPI_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...pendencyF_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...arDependencyF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...pendencyF_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...arDependencyF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...nstructor_Test1#Splat.DI.Reg.g.verified.cs | 28 +++ ....EConstructor_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...nstructor_Test2#Splat.DI.Reg.g.verified.cs | 28 +++ ....EConstructor_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 28 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ..._MTypePms_Test1#Splat.DI.Reg.g.verified.cs | 28 +++ ...Type_MTypePms_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ..._MTypePms_Test2#Splat.DI.Reg.g.verified.cs | 28 +++ ...Type_MTypePms_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 28 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...edGeneric_Test1#Splat.DI.Reg.g.verified.cs | 28 +++ ...NestedGeneric_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...edGeneric_Test2#Splat.DI.Reg.g.verified.cs | 28 +++ ...NestedGeneric_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 28 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...gleTypePm_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ..._SingleTypePm_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...gleTypePm_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ..._SingleTypePm_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ependency_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...bleDependency_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ependency_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...bleDependency_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs | 29 +++ .../R.IRegMx_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- .../R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs | 29 +++ .../R.IRegMx_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 29 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tNotRegLF_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...stantNotRegLF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tNotRegLF_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...stantNotRegLF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...mNotRegLF_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...mNotRegLF_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...orNoAttrF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ ...ructorNoAttrF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...orNoAttrF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ ...ructorNoAttrF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ ...rNoAttrNonDIP_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ ...rNoAttrNonDIP_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...rWithAttr_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...uctorWithAttr_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...rWithAttr_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...uctorWithAttr_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...thMAttrsF_Test1#Splat.DI.Reg.g.verified.cs | 27 +++ ...orWithMAttrsF_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...thMAttrsF_Test2#Splat.DI.Reg.g.verified.cs | 27 +++ ...orWithMAttrsF_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 27 +++ ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...strations_Test1#Splat.DI.Reg.g.verified.cs | 11 +- ...Registrations_Test1#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...strations_Test2#Splat.DI.Reg.g.verified.cs | 11 +- ...Registrations_Test2#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...tractParameter=#Splat.DI.Reg.g.verified.cs | 11 +- ..._contractParameter=#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ ...deAnalysis.EmbeddedAttribute.g.verified.cs | 2 +- ...ct_TestContract#Splat.DI.Reg.g.verified.cs | 11 +- ...ntract_TestContract#Splat.DI.g.verified.cs | 194 ++++++++++++++++++ .../RegisterLazySingletonTests.cs | 0 .../RegisterTests.cs | 0 .../RoslynHelpersTests.cs | 0 ...encyInjection.SourceGenerator.Tests.csproj | 2 +- .../TestBase.cs | 0 .../TestHelper.cs | 0 616 files changed, 28512 insertions(+), 19898 deletions(-) delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs delete mode 100644 src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/ConsoleLogger.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/ILogger.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/IService.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Program.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/ServiceImplementation.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/ServiceWithDependency.cs create mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/AnalyzerHelpersTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/AnalyzerTestHelper.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/CodeFixTestHelper.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/ConstructorAnalyzerTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/ConstructorCodeFixProviderTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/PropertyAnalyzerTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/PropertyCodeFixProviderTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj (82%) rename src/{ => tests}/Splat.DependencyInjection.Analyzer.Tests/TestUtilities.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/CodeGeneratorTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/DiagnosticWarningsTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/EquatableArrayTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs (92%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs (66%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs (66%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs (64%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs (68%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs (68%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs (68%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs (74%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs (74%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs (74%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs (74%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs (68%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs (75%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs (75%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs (74%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs (62%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs (62%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs (61%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs (64%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs (64%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs (64%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs (78%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs (78%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs (61%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs (61%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs (60%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs (81%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs (81%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs (80%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs (75%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/MetadataExtractorTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/Models/ConstructorParameterTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/Models/EquatableArrayTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/Models/PropertyInjectionTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/Models/RegistrationInfoTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs (60%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs (60%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs (58%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs (66%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs (66%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs (63%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs (65%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs (65%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs (63%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs (65%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs (65%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs (63%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs (73%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs (73%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs (70%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs (65%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs (65%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs (63%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs (69%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs (69%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs (67%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs (57%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs (57%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs (56%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs (54%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs (55%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs (53%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs (75%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs (75%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs (73%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs (54%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs (54%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs (52%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs (76%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs (74%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs (93%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs (66%) create mode 100644 src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/RoslynHelpersTests.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj (85%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/TestBase.cs (100%) rename src/{ => tests}/Splat.DependencyInjection.SourceGenerator.Tests/TestHelper.cs (100%) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index d717e1d..9d981af 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -28,5 +28,9 @@ + + + + diff --git a/src/Splat.DI.SourceGenerator.slnx b/src/Splat.DI.SourceGenerator.slnx index 2804aaa..e543ca2 100644 --- a/src/Splat.DI.SourceGenerator.slnx +++ b/src/Splat.DI.SourceGenerator.slnx @@ -21,7 +21,8 @@ - - + + + diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 7b5cb31..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.TestConcrete(), "Test1"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 311551e..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.TestConcrete(), "Test2"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 086f440..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.TestConcrete()); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 9bf44fa..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.Cache(), "Test1"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index e47b996..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.Cache(), "Test2"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index ef1b6e1..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.Cache()); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 3d8b9ee..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.Repository>(), "Test1"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 72939b1..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.Repository>(), "Test2"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 4aaa84e..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.Repository>()); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 7b22236..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.TestConcrete1(), "Test1"); - resolver.Register(() => new global::Test.TestConcrete2(), "Test1"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index cb1c61a..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.TestConcrete1(), "Test2"); - resolver.Register(() => new global::Test.TestConcrete2(), "Test2"); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index 5455520..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::Test.TestConcrete1()); - resolver.Register(() => new global::Test.TestConcrete2()); } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs deleted file mode 100644 index de8a8b3..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//HintName: Splat.DI.Reg.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { } - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs deleted file mode 100644 index 69daa86..0000000 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs +++ /dev/null @@ -1,144 +0,0 @@ -//HintName: Splat.DI.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Extension methods for the Splat DI source generator. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a class with its concrete class. - /// - /// The threading mode. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - /// The threading mode. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a class with its concrete class. - /// - public static void Register() - { - } - - - /// - /// Registers a class with its concrete class. - /// - /// Optional contract. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy class with its concrete class. - /// - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy class with its concrete class. - /// - /// Optional contract. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Proxy for the Splat SetService. - /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Proxy for the Splat SetService. - /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Registers the registrations. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Registers the registrations. - /// - /// The resolver to register with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Makes the property get added by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Makes this the constructor used by the DI engine. - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator/CodeGeneration/CodeGenerator.cs b/src/Splat.DependencyInjection.SourceGenerator/CodeGeneration/CodeGenerator.cs index a65cdbf..145d7e0 100644 --- a/src/Splat.DependencyInjection.SourceGenerator/CodeGeneration/CodeGenerator.cs +++ b/src/Splat.DependencyInjection.SourceGenerator/CodeGeneration/CodeGenerator.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Immutable; -using System.Reflection; using System.Text; using Splat.DependencyInjection.SourceGenerator.Models; @@ -15,8 +14,6 @@ namespace Splat.DependencyInjection.SourceGenerator.CodeGeneration; /// internal static class CodeGenerator { - private static readonly AssemblyName _assemblyName = typeof(Generator).Assembly.GetName(); - /// /// Generates the SetupIOCInternal method. /// @@ -29,7 +26,7 @@ internal static string GenerateSetupIOCMethod( { var sb = new StringBuilder(); - sb.Append($$""" + sb.Append(""" // #nullable enable annotations @@ -40,9 +37,18 @@ internal static string GenerateSetupIOCMethod( namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("{{_assemblyName.Name}}", "{{_assemblyName.Version}}")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { """); diff --git a/src/Splat.DependencyInjection.SourceGenerator/Constants.cs b/src/Splat.DependencyInjection.SourceGenerator/Constants.cs index 15aa374..f8c7e28 100644 --- a/src/Splat.DependencyInjection.SourceGenerator/Constants.cs +++ b/src/Splat.DependencyInjection.SourceGenerator/Constants.cs @@ -34,103 +34,138 @@ internal static class Constants namespace {{NamespaceName}} { /// - /// Extension methods for the Splat DI source generator. + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. /// [global::System.CodeDom.Compiler.GeneratedCodeAttribute("{{_assemblyName.Name}}", "{{_assemblyName.Version}}")] internal static partial class {{ClassName}} { /// - /// Registers a class with its concrete class. + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. /// + /// The interface or base type to register. + /// The concrete type that implements . public static void Register() { } /// - /// Registers a class with its concrete class. + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. /// - /// Optional contract. + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. public static void Register(string contract) { } /// - /// Registers a class with its concrete class. + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. /// + /// The interface or base type to register. + /// The concrete type that implements . public static void RegisterLazySingleton() { } /// - /// Registers a class with its concrete class. + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. /// - /// The threading mode. + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) { } /// - /// Registers a class with its concrete class. + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. /// - /// Optional contract. + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. public static void RegisterLazySingleton(string contract) { } /// - /// Registers a class with its concrete class. + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. /// - /// Optional contract. - /// The threading mode. + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) { } /// - /// Registers a class with its concrete class. + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. /// + /// The type to register. public static void Register() { } /// - /// Registers a class with its concrete class. + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. /// - /// Optional contract. + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. public static void Register(string contract) { } /// - /// Registers a lazy class with its concrete class. + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. /// + /// The type to register. public static void RegisterLazySingleton() { } /// - /// Registers a lazy class with its concrete class. + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. /// - /// Optional contract. + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. public static void RegisterLazySingleton(string contract) { } /// - /// Proxy for the Splat SetService. + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . /// - public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); /// - /// Proxy for the Splat SetService. + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . /// - /// Optional contract. - public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); /// - /// Registers the registrations. + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. /// public static void SetupIOC() { @@ -138,9 +173,10 @@ public static void SetupIOC() } /// - /// Registers the registrations. + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. /// - /// The resolver to register with. + /// The instance to register dependencies with. public static void SetupIOC(Splat.IDependencyResolver resolver) { SetupIOCInternal(resolver); @@ -151,16 +187,30 @@ public static void SetupIOC(Splat.IDependencyResolver resolver) } /// - /// Makes the property get added by the DI engine. + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] internal sealed class DependencyInjectionPropertyAttribute : System.Attribute { } /// - /// Makes this the constructor used by the DI engine. + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] internal sealed class DependencyInjectionConstructorAttribute : System.Attribute { diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/ConsoleLogger.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/ConsoleLogger.cs new file mode 100644 index 0000000..081df60 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/ConsoleLogger.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace TestApp; + +/// +/// Provides a console-based implementation of . +/// +public class ConsoleLogger : ILogger +{ + /// + /// Logs a message to the console output with a [LOG] prefix. + /// + /// The message to log to the console. + public void Log(string message) => Console.WriteLine($"[LOG] {message}"); +} diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs new file mode 100644 index 0000000..a1ff8ff --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveAttribute. +/// +/// +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)] +internal sealed class BindableDerivedListAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs new file mode 100644 index 0000000..cd8302f --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs @@ -0,0 +1,23 @@ +// +#pragma warning disable +#nullable enable + +using global::ReactiveUI; +using global::Splat; + +namespace ReactiveUI.SourceGenerators +{ + /// + /// Source-generated registration extensions for ReactiveUI views. + /// + internal static class ReactiveUISourceGeneratorsExtensions + { + [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "2.6.0.0")] + public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) + { + if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); + } + } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs new file mode 100644 index 0000000..5bc3ccc --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// IViewForAttribute. +/// +/// +/// +/// Initializes a new instance of the class. +/// +/// Type of the view model. +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IViewForAttribute : global::System.Attribute +{ + /// + /// Gets the Splat registration type for Splat IViewFor registration. + /// Registers IViewFor in the Splat service locator. + /// + public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; + + /// + /// Gets the Splat registration type for Splat View Model registration. + /// Registers the ViewModel (T) in the Splat service locator. + /// + public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; +} + +/// +/// IViewForAttribute. +/// +/// +/// +/// Initializes a new instance of the class. +/// +/// Type of the view model, ensure to use the full type name including namespace. +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute +{ + /// + /// Gets the Splat registration type for Splat IViewFor registration. + /// Registers IViewFor in the Splat service locator. + /// + public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; + + /// + /// Gets the Splat registration type for Splat View Model registration. + /// Registers the ViewModel (T) in the Splat service locator. + /// + public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs new file mode 100644 index 0000000..5116d6d --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ObservableAsPropertyAttribute. +/// +/// +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ObservableAsPropertyAttribute : global::System.Attribute +{ + /// + /// Gets the name of the property. + /// + /// + /// The name of the property. + /// + public string? PropertyName { get; init; } + + /// + /// Gets the Readonly state of the OAPH property. + /// + /// + /// The is read only of the OAPH property. + /// + public bool ReadOnly { get; init; } = true; + + /// + /// Gets the AccessModifier of the OAPH property. + /// + /// + /// The AccessModifier of the OAPH property, protected if true. + /// + public bool UseProtected { get; init; } = false; + + /// + /// Gets the Initial value of the OAPH property. + /// + /// + /// The initial value of the OAPH property. + /// + public string? InitialValue { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs new file mode 100644 index 0000000..93c50ee --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveAttribute. +/// +/// +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCollectionAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs new file mode 100644 index 0000000..eb37e34 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveCommand Attribute. +/// +/// +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveCommandAttribute : global::System.Attribute +{ + /// + /// Gets the can execute method or property. + /// + /// + /// The name of the CanExecute Observable of bool. + /// + public string? CanExecute { get; init; } + + /// + /// Gets the output scheduler. + /// + /// + /// The output scheduler. + /// + public string? OutputScheduler { get; init; } + + /// + /// Gets the AccessModifier of the ReactiveCommand property. + /// + /// + /// The AccessModifier of the property. + /// + public PropertyAccessModifier AccessModifier { get; init; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs new file mode 100644 index 0000000..4628975 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// AccessModifier. +/// +internal enum AccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, + Init, +} + +/// +/// Property Access Modifier. +/// +internal enum PropertyAccessModifier +{ + Public, + Protected, + Internal, + Private, + InternalProtected, + PrivateProtected, +} + +/// +/// InheritanceModifier. +/// +internal enum InheritanceModifier +{ + None, + Virtual, + Override, + New, +} + +internal enum SplatRegistrationType +{ + None, + LazySingleton, + Constant, + PerRequest, +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs new file mode 100644 index 0000000..b18e2ed --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs @@ -0,0 +1,51 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// ReactiveAttribute. +/// +/// +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] +internal sealed class ReactiveAttribute : global::System.Attribute +{ + /// + /// Initializes a new instance of the class. + /// + public ReactiveAttribute(params string[] alsoNotify) + { + AlsoNotify = alsoNotify; + } + + /// + /// Gets the AccessModifier of the set property. + /// + /// + /// The AccessModifier of the set property. + /// + public AccessModifier SetModifier { get; init; } + + /// + /// Gets the InheritanceModifier of the property. + /// + public InheritanceModifier Inheritance { get; init; } + + /// + /// Use Required attribute to indicate that the property is required. + /// + public bool UseRequired { get; init; } + + /// + /// Gets the AlsoNotify properties to raise change notifications for. + /// + public string[]? AlsoNotify { get; } +} +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs new file mode 100644 index 0000000..03df987 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators; + +/// +/// IReactiveObject Attribute. +/// +/// +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveObjectGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class IReactiveObjectAttribute : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs new file mode 100644 index 0000000..700f72a --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators.WinForms; + +/// +/// RoutedControlHostAttribute. +/// +/// +/// +/// Initializes a new instance of the class. +/// +/// Type of the view model. +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.RoutedControlHostGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class RoutedControlHostAttribute(string? baseType) : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs new file mode 100644 index 0000000..1699d42 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// +#pragma warning disable +#nullable enable +namespace ReactiveUI.SourceGenerators.WinForms; + +/// +/// ViewModelControlHostAttribute. +/// +/// +/// +/// Initializes a new instance of the class. +/// +/// Type of the view model. +[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ViewModelControlHostGenerator", "2.6.0.0")] +[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +internal sealed class ViewModelControlHostAttribute(string? baseType) : global::System.Attribute; +#nullable restore +#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs new file mode 100644 index 0000000..a02d1f0 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs @@ -0,0 +1,17 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Microsoft.CodeAnalysis +{ + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] + [System.Diagnostics.Conditional("NEVER_DEFINED")] + internal sealed class EmbeddedAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs new file mode 100644 index 0000000..f710541 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs @@ -0,0 +1,33 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::TestApp.ServiceImplementation()); + resolver.Register(() => new global::TestApp.ConsoleLogger()); + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::TestApp.ServiceWithDependency(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::TestApp.ILogger' not registered with Splat resolver."))); + resolver.Register>(() => lazy); + resolver.Register(() => lazy.Value); + } } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs new file mode 100644 index 0000000..a774c28 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs @@ -0,0 +1,193 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/ILogger.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/ILogger.cs new file mode 100644 index 0000000..d9b6c2c --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/ILogger.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace TestApp; + +/// +/// Defines a logger contract for writing log messages. +/// +public interface ILogger +{ + /// + /// Logs a message to the output. + /// + /// The message to log. + void Log(string message); +} diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/IService.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/IService.cs new file mode 100644 index 0000000..8d78a1f --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/IService.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace TestApp; + +/// +/// Defines a service contract for retrieving messages. +/// +public interface IService +{ + /// + /// Gets a message from the service. + /// + /// A string containing the service message. + string GetMessage(); +} diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Program.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Program.cs new file mode 100644 index 0000000..9e68ec4 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Program.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using Splat; + +namespace TestApp; + +/// +/// Entry point for the Splat DI Source Generator test application. +/// This application demonstrates the source generator's ability to work alongside ReactiveUI.SourceGenerators +/// without causing duplicate GeneratedCodeAttribute errors (CS0579). +/// +public static class Program +{ + /// + /// Main entry point for the application. + /// + /// Command-line arguments passed to the application. + public static void Main(string[] args) + { + // Register dependencies using source generator + SplatRegistrations.Register(); + SplatRegistrations.Register(); + SplatRegistrations.RegisterLazySingleton(); + + // Setup IOC + SplatRegistrations.SetupIOC(); + + // Test resolution + var service = Locator.Current.GetService(); + var logger = Locator.Current.GetService(); + var serviceWithDep = Locator.Current.GetService(); + + if (service != null) + { + Console.WriteLine(service.GetMessage()); + } + + if (serviceWithDep != null) + { + serviceWithDep.DoWork(); + } + + Console.WriteLine("TestApp completed successfully!"); + } +} diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/ServiceImplementation.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/ServiceImplementation.cs new file mode 100644 index 0000000..20a138f --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/ServiceImplementation.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace TestApp; + +/// +/// Provides a concrete implementation of . +/// +public class ServiceImplementation : IService +{ + /// + /// Gets a greeting message from the service. + /// + /// A string containing "Hello from DI!". + public string GetMessage() => "Hello from DI!"; +} diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/ServiceWithDependency.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/ServiceWithDependency.cs new file mode 100644 index 0000000..86112dd --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/ServiceWithDependency.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2019-2026 ReactiveUI Association Incorporated. All rights reserved. +// ReactiveUI Association Incorporated licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace TestApp; + +/// +/// A service that demonstrates constructor dependency injection. +/// +public class ServiceWithDependency +{ + private readonly ILogger _logger; + + /// + /// Initializes a new instance of the class. + /// + /// The logger instance to use for logging operations. + /// Thrown when is null. + public ServiceWithDependency(ILogger logger) + { + _logger = logger ?? throw new System.ArgumentNullException(nameof(logger)); + } + + /// + /// Performs work and logs the operation using the injected logger. + /// + public void DoWork() + { + _logger.Log("Working..."); + } +} diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj b/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj new file mode 100644 index 0000000..e9c5c94 --- /dev/null +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj @@ -0,0 +1,26 @@ + + + + Exe + net10.0 + enable + enable + true + Generated + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/AnalyzerHelpersTests.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/AnalyzerHelpersTests.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/AnalyzerHelpersTests.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/AnalyzerHelpersTests.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/AnalyzerTestHelper.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/AnalyzerTestHelper.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/AnalyzerTestHelper.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/AnalyzerTestHelper.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/CodeFixTestHelper.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/CodeFixTestHelper.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/CodeFixTestHelper.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/CodeFixTestHelper.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/ConstructorAnalyzerTests.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/ConstructorAnalyzerTests.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/ConstructorAnalyzerTests.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/ConstructorAnalyzerTests.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/ConstructorCodeFixProviderTests.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/ConstructorCodeFixProviderTests.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/ConstructorCodeFixProviderTests.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/ConstructorCodeFixProviderTests.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/PropertyAnalyzerTests.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/PropertyAnalyzerTests.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/PropertyAnalyzerTests.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/PropertyAnalyzerTests.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/PropertyCodeFixProviderTests.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/PropertyCodeFixProviderTests.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/PropertyCodeFixProviderTests.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/PropertyCodeFixProviderTests.cs diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj b/src/tests/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj similarity index 82% rename from src/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj index 1191d0d..40ab772 100644 --- a/src/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj +++ b/src/tests/Splat.DependencyInjection.Analyzer.Tests/Splat.DependencyInjection.Analyzer.Tests.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/src/Splat.DependencyInjection.Analyzer.Tests/TestUtilities.cs b/src/tests/Splat.DependencyInjection.Analyzer.Tests/TestUtilities.cs similarity index 100% rename from src/Splat.DependencyInjection.Analyzer.Tests/TestUtilities.cs rename to src/tests/Splat.DependencyInjection.Analyzer.Tests/TestUtilities.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/CodeGeneratorTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/CodeGeneratorTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/CodeGeneratorTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/CodeGeneratorTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/DiagnosticWarningsTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/DiagnosticWarningsTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/DiagnosticWarningsTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/DiagnosticWarningsTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/EquatableArrayTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/EquatableArrayTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/EquatableArrayTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/EquatableArrayTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs similarity index 92% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs index 94cbe10..8cdaa39 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/GeneratorCodeGenerationTests.cs @@ -185,19 +185,18 @@ public async Task GenerateSetupIOCMethod_Empty_GeneratesCorrectStructure() } /// - /// Tests that GenerateSetupIOCMethod includes GeneratedCodeAttribute with version. + /// Tests that the extension methods file (Constants.ExtensionMethodText) includes GeneratedCodeAttribute with version. + /// This is the ONLY place where GeneratedCodeAttribute should appear on the SplatRegistrations partial class. /// /// A task representing the asynchronous test operation. [Test] - public async Task GenerateSetupIOCMethod_IncludesGeneratedCodeAttribute() + public async Task ExtensionMethodText_IncludesGeneratedCodeAttribute() { - var transients = ImmutableArray.Empty; - var lazySingletons = ImmutableArray.Empty; - - var result = CodeGenerator.GenerateSetupIOCMethod(transients, lazySingletons); + var result = Constants.ExtensionMethodText; await Assert.That(result).Contains("[global::System.CodeDom.Compiler.GeneratedCodeAttribute("); await Assert.That(result).Contains("Splat.DependencyInjection.SourceGenerator"); + await Assert.That(result).Contains("internal static partial class SplatRegistrations"); } /// @@ -311,4 +310,23 @@ public async Task GenerateLazySingletonRegistration_WithContract_GeneratesCorrec var result = sb.ToString(); await Assert.That(result).Contains(", \"MyContract\""); } + + /// + /// Tests that GenerateSetupIOCMethod does NOT include GeneratedCodeAttribute to avoid duplication. + /// The GeneratedCodeAttribute should only appear once on the partial class (in Splat.DI.g.cs), + /// not on both partial class declarations, which would cause CS0579 duplicate attribute error. + /// + /// A task representing the asynchronous test operation. + [Test] + public async Task GenerateSetupIOCMethod_DoesNotIncludeDuplicateGeneratedCodeAttribute() + { + var transients = ImmutableArray.Empty; + var lazySingletons = ImmutableArray.Empty; + + var result = CodeGenerator.GenerateSetupIOCMethod(transients, lazySingletons); + + // The GeneratedCodeAttribute should NOT be in the Splat.DI.Reg.g.cs output + // It should only be in Splat.DI.g.cs (from Constants.ExtensionMethodText) + await Assert.That(result).DoesNotContain("[global::System.CodeDom.Compiler.GeneratedCodeAttribute("); + } } diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs similarity index 66% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs index 90466b2..5ef6cfa 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs similarity index 66% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs index 5f37ba5..2782b48 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 64% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs index 388156a..5e73a74 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs index fa407a3..878cfcc 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs index ffaf091..0921d88 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 68% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs index 094ee73..f1b7b92 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs index 2a0a0ef..7642dcf 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs index f53a27a..180d4e3 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 68% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs index 142245f..e7588e8 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs index 2a0a0ef..7642dcf 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs index f53a27a..180d4e3 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 68% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs index 142245f..e7588e8 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs index 3acac0e..9c5f4fb 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_EP#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs index c8b3311..e1ade15 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_N#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs index f810303..cda4f55 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test1_P#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs index 5295a02..37eae07 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_EP#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs index 14a8231..47c75c2 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_N#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs index 8b89f90..45147bf 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_Test2_P#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs similarity index 74% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs index a4c2b44..b76219f 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_EP#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs similarity index 74% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs index 9f6af3a..b1f1114 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_N#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs similarity index 74% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs index e6def11..fc8fae4 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPILM_contractParameter=_P#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs index 57ad02c..ba369cf 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs index 3513373..f67b3d4 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 74% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs index 437a651..a3a8fe8 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CMPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPIF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs index 2a0a0ef..7642dcf 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs index f53a27a..180d4e3 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 68% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs index 142245f..e7588e8 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs similarity index 75% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs index f132ac4..c556b51 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs similarity index 75% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs index 45da524..7901854 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 74% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs index 63abae5..5dfaf76 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs index 2fce028..681888e 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs index de14154..693a587 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs index 48e7632..6916495 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.EConstructor_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs similarity index 62% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs index 7adfaec..8bec524 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.ServiceA(), "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs similarity index 62% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs index 1ac4a26..dd23f27 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.ServiceA(), "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 61% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs index a5e6986..147ae98 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.ServiceA()); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IEnumerableDependencyInLSingleton_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs similarity index 64% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs index 7b05c3e..a9a83c7 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs similarity index 64% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs index e878bfb..8598d6c 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 64% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs index 2770c2d..59d2403 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.IRegMx_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs similarity index 78% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs index 0cf6cd2..4f4b0a3 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService>("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "Test1" + " not registered with Splat resolver."), ServiceProperty2 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' with contract " + "Test1" + " not registered with Splat resolver."), ServiceProperty3 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs similarity index 78% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs index c7d5736..eea3e84 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService>("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "Test2" + " not registered with Splat resolver."), ServiceProperty2 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' with contract " + "Test2" + " not registered with Splat resolver."), ServiceProperty3 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs index bc09e64..5292978 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService>() ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' not registered with Splat resolver."), ServiceProperty2 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' not registered with Splat resolver."), ServiceProperty3 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' not registered with Splat resolver.") }); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.LPmRegL_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs similarity index 61% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs index 1089d51..e26f8d1 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs similarity index 61% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs index 961d876..577ef31 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 60% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs index 33b3c15..e3efca8 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs similarity index 81% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs index b72e113..0caa6f8 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs similarity index 81% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs index baa64e9..450e3d4 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 80% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs index f547788..2ad149e 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { { diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs similarity index 75% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs index 9bd39ac..9b136be 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.Service1(), "TestContract"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/LS.PIWithContractInLSingleton_TestContract#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/MetadataExtractorTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/MetadataExtractorTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/MetadataExtractorTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/MetadataExtractorTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/Models/ConstructorParameterTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/ConstructorParameterTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/Models/ConstructorParameterTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/ConstructorParameterTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/Models/EquatableArrayTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/EquatableArrayTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/Models/EquatableArrayTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/EquatableArrayTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/Models/PropertyInjectionTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/PropertyInjectionTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/Models/PropertyInjectionTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/PropertyInjectionTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/Models/RegistrationInfoTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/RegistrationInfoTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/Models/RegistrationInfoTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Models/RegistrationInfoTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs similarity index 60% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs index 446e16b..3750265 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")), "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs similarity index 60% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs index f4bf4aa..389bc7b 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")), "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 58% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs index 5bd4d26..420cd0a 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver."))); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs similarity index 66% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs index ec3c13a..e8b0cc9 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs similarity index 66% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs index 895ea8d..e52cf71 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 63% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs index e91602b..dfad494 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver.")) { ServiceProperty = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' not registered with Splat resolver.") }); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPITypeArgument_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 65% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs index 836ed98..55a34b5 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 65% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs index 405e13a..e0c1e06 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 63% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs index a963dfb..6c3394c 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver.")) { ServiceProperty = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' not registered with Splat resolver.") }); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 65% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs index 836ed98..55a34b5 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 65% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs index 405e13a..e0c1e06 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 63% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs index a963dfb..6c3394c 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver.")) { ServiceProperty = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' not registered with Splat resolver.") }); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CIntSetPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 73% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs index 641279a..ee4d21f 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "Test1" + " not registered with Splat resolver."), ServiceProperty2 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' with contract " + "Test1" + " not registered with Splat resolver."), ServiceProperty3 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 73% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs index 67b79b2..9f2b9d5 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "Test2" + " not registered with Splat resolver."), ServiceProperty2 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' with contract " + "Test2" + " not registered with Splat resolver."), ServiceProperty3 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 70% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs index 0f380ba..0df4966 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' not registered with Splat resolver."), ServiceProperty2 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' not registered with Splat resolver."), ServiceProperty3 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' not registered with Splat resolver.") }); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CMPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPIF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CNPPSetIF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs similarity index 65% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs index 836ed98..55a34b5 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs similarity index 65% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs index 405e13a..e0c1e06 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 63% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs index a963dfb..6c3394c 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver.")) { ServiceProperty = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty' not registered with Splat resolver.") }); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CPI_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs similarity index 69% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs index 89173d6..0e6cb53 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete1(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.ITest2' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")), "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs similarity index 69% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs index 61ec3af..86dded9 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete1(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.ITest2' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")), "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 67% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs index aa13a89..f8ab7b9 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete1(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.ITest2' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver."))); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.CircularDependencyF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..224eb48 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.TestConcrete(), "Test1"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..15775a9 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.TestConcrete(), "Test2"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..24b9674 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.TestConcrete()); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.EConstructor_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..d7527d1 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.Cache(), "Test1"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..3973072 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.Cache(), "Test2"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..40b7aff --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.Cache()); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_MTypePms_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..027900e --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.Repository>(), "Test1"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..94b173b --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.Repository>(), "Test2"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..53e83bc --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,28 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.Repository>()); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_NestedGeneric_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs similarity index 57% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs index 0ec88d8..d0569fd 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.AppUpdateService(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IConfig' with contract " + "Test1" + " not registered with Splat resolver.")), "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs similarity index 57% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs index 49e010e..fb56198 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.AppUpdateService(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IConfig' with contract " + "Test2" + " not registered with Splat resolver.")), "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 56% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs index 89a818f..e1c6725 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.AppUpdateService(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IConfig' not registered with Splat resolver."))); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.GenericConcreteType_SingleTypePm_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs index 94b944b..a915ee7 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetServices("Test1")), "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs index 7ba6b35..238ac89 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetServices("Test2")), "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 54% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs index 7419fea..e911830 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetServices())); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IEnumerableDependency_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..3b58257 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,29 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.TestConcrete1(), "Test1"); + resolver.Register(() => new global::Test.TestConcrete2(), "Test1"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..8c6cde7 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,29 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.TestConcrete1(), "Test2"); + resolver.Register(() => new global::Test.TestConcrete2(), "Test2"); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..2f3c4c4 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,29 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + resolver.Register(() => new global::Test.TestConcrete1()); + resolver.Register(() => new global::Test.TestConcrete2()); } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.IRegMx_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs index 1fe6c72..9468877 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService>("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' with contract " + "Test1" + " not registered with Splat resolver.")), "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs similarity index 55% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs index 9227bf2..61b2e14 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService>("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' with contract " + "Test2" + " not registered with Splat resolver.")), "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 53% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs index 8bfad56..bc176fa 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService>() ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' not registered with Splat resolver."))); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmConstantNotRegLF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs similarity index 75% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs index 17dc366..0edc80f 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService>("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' with contract " + "Test1" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "Test1" + " not registered with Splat resolver."), ServiceProperty2 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' with contract " + "Test1" + " not registered with Splat resolver."), ServiceProperty3 = resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' with contract " + "Test1" + " not registered with Splat resolver.") }, "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs similarity index 75% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs index ec07eef..3daa6b6 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService>("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' with contract " + "Test2" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "Test2" + " not registered with Splat resolver."), ServiceProperty2 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' with contract " + "Test2" + " not registered with Splat resolver."), ServiceProperty3 = resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' with contract " + "Test2" + " not registered with Splat resolver.") }, "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 73% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs index cc85d94..37beb8e 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService>() ?? throw new global::System.InvalidOperationException("Dependency 'global::System.Lazy' not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' not registered with Splat resolver."), ServiceProperty2 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty2' not registered with Splat resolver."), ServiceProperty3 = resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty3' not registered with Splat resolver.") }); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.LPmNotRegLF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorNoAttrNonDIP_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs similarity index 54% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs index 56b374c..9d5a102 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver.")), "Test1"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs similarity index 54% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs index d5a75e7..2d4a008 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver.")), "Test2"); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 52% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs index 3454eb8..2e802ea 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."))); } diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithAttr_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1067890 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// + internal static partial class SplatRegistrations + { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { } + } +} \ No newline at end of file diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MConstructorWithMAttrsF_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs index 2e3580e..4405166 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete1(resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test1" + " not registered with Splat resolver."), resolver.GetService("Test1") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test1" + " not registered with Splat resolver.")), "Test1"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs similarity index 76% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs index e9a7885..ee23b8d 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete1(resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "Test2" + " not registered with Splat resolver."), resolver.GetService("Test2") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' with contract " + "Test2" + " not registered with Splat resolver.")), "Test2"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs similarity index 74% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs index eff5689..e03286c 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete1(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' not registered with Splat resolver."), resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService2' not registered with Splat resolver."))); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.MultiClassesRegistrations_contractParameter=#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs similarity index 93% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs index 6161463..cdea2ad 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Microsoft.CodeAnalysis.EmbeddedAttribute.g.verified.cs @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [System.Diagnostics.Conditional("NEVER_DEFINED")] internal sealed class EmbeddedAttribute : System.Attribute diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs similarity index 66% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs index 87cdf12..c86d08a 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.Reg.g.verified.cs @@ -9,9 +9,18 @@ namespace Splat { - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "1.2.0.0")] + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This partial class contains the generated implementation of dependency registrations. + /// internal static partial class SplatRegistrations { + /// + /// Internal implementation of dependency injection setup. + /// This method is generated at compile-time and contains all registrations + /// defined through the source generator marker methods. + /// + /// The instance to register dependencies with. static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) { resolver.Register(() => new global::Test.TestConcrete(resolver.GetService("TestContract") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IService1' with contract " + "TestContract" + " not registered with Splat resolver.")) { ServiceProperty1 = resolver.GetService("TestContract") ?? throw new global::System.InvalidOperationException("Dependency 'global::Test.IServiceProperty1' with contract " + "TestContract" + " not registered with Splat resolver.") }, "TestContract"); diff --git a/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs new file mode 100644 index 0000000..6423217 --- /dev/null +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/R.PIWithContract_TestContract#Splat.DI.g.verified.cs @@ -0,0 +1,194 @@ +//HintName: Splat.DI.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Splat +{ + /// + /// Provides extension methods for the Splat dependency injection source generator. + /// This class contains marker methods that are analyzed at compile-time to generate + /// dependency injection registrations. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] + internal static partial class SplatRegistrations + { + /// + /// Registers a transient dependency mapping from to . + /// A new instance of will be created each time is resolved. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void Register() + { + } + + /// + /// Registers a transient dependency mapping from to with a contract. + /// A new instance of will be created each time is resolved with the specified contract. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The interface or base type to register. + /// The concrete type that implements . + /// A unique string identifier to distinguish between multiple registrations of the same type. + /// The specifying how the singleton should be initialized in multi-threaded scenarios. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a transient dependency for type . + /// A new instance of will be created each time it is resolved. + /// + /// The type to register. + public static void Register() + { + } + + + /// + /// Registers a transient dependency for type with a contract. + /// A new instance of will be created each time it is resolved with the specified contract. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy singleton dependency for type . + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy singleton dependency for type with a contract. + /// A single instance of will be created on first resolution and reused for all subsequent resolutions. + /// + /// The type to register. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. + /// This method is a proxy for . + /// + /// The type of the instance to register. Must be a reference type. + /// The instance to register as a constant. + /// A unique string identifier to distinguish between multiple registrations of the same type. + public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Initializes the dependency injection container by registering all dependencies with the default . + /// This method should be called once during application startup after all registration calls have been made. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Initializes the dependency injection container by registering all dependencies with the specified resolver. + /// This method should be called once during application startup after all registration calls have been made. + /// + /// The instance to register dependencies with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Marks a property to be injected by the dependency injection engine. + /// Properties marked with this attribute will have their values automatically + /// resolved and set by the DI container during object construction. + /// + /// + /// The property must have an accessible setter (public, internal, or internal protected). + /// The property type must be registered in the DI container, or resolution will fail at runtime. + /// + [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionPropertyAttribute : System.Attribute + { + } + + /// + /// Marks a constructor as the preferred constructor for dependency injection. + /// When a class has multiple constructors, this attribute specifies which constructor + /// the DI engine should use for object construction. + /// + /// + /// Only one constructor per class should be marked with this attribute. + /// If multiple constructors exist without this attribute, the analyzer will generate + /// diagnostic warning SPLATDI001. + /// The constructor must be accessible (public, internal, or internal protected). + /// + [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] + internal sealed class DependencyInjectionConstructorAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RoslynHelpersTests.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/RoslynHelpersTests.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/RoslynHelpersTests.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/RoslynHelpersTests.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj similarity index 85% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj index c79618a..fce7e23 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj +++ b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/TestBase.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/TestBase.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/TestBase.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/TestBase.cs diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/TestHelper.cs b/src/tests/Splat.DependencyInjection.SourceGenerator.Tests/TestHelper.cs similarity index 100% rename from src/Splat.DependencyInjection.SourceGenerator.Tests/TestHelper.cs rename to src/tests/Splat.DependencyInjection.SourceGenerator.Tests/TestHelper.cs From 875f5d5c891febc6af135fc0f93100618f8d1f5e Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:20:28 +1100 Subject: [PATCH 2/2] chore: Disable EmitCompilerGeneratedFiles in TestApp to avoid CI path length issues Removed EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath settings from TestApp.csproj. These were causing CI failures on Windows due to path length limitations with ReactiveUI.SourceGenerators generated files. The generated code can still be inspected through obj/ folders during local development if needed, but won't be committed to the repository. --- ...nerators.BindableDerivedListAttribute.g.cs | 19 -- ....ReactiveUISourceGeneratorsExtensions.g.cs | 23 --- ...UI.SourceGenerators.IViewForAttribute.g.cs | 61 ------ ...erators.ObservableAsPropertyAttribute.g.cs | 52 ----- ...enerators.ReactiveCollectionAttribute.g.cs | 19 -- ...ceGenerators.ReactiveCommandAttribute.g.cs | 44 ---- ...iveUI.SourceGenerators.AccessModifier.g.cs | 57 ------ ...UI.SourceGenerators.ReactiveAttribute.g.cs | 51 ----- ...ceGenerators.IReactiveObjectAttribute.g.cs | 19 -- ...s.WinForms.RoutedControlHostAttribute.g.cs | 23 --- ...inForms.ViewModelControlHostAttribute.g.cs | 23 --- ...rosoft.CodeAnalysis.EmbeddedAttribute.g.cs | 17 -- .../Splat.DI.Reg.g.cs | 33 --- .../Splat.DI.g.cs | 193 ------------------ .../Splat.DI.SourceGenerator.TestApp.csproj | 2 - 15 files changed, 636 deletions(-) delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs delete mode 100644 src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs deleted file mode 100644 index a1ff8ff..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.BindableDerivedListGenerator/ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// ReactiveAttribute. -/// -/// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)] -internal sealed class BindableDerivedListAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs deleted file mode 100644 index cd8302f..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.ReactiveUISourceGeneratorsExtensions.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -#pragma warning disable -#nullable enable - -using global::ReactiveUI; -using global::Splat; - -namespace ReactiveUI.SourceGenerators -{ - /// - /// Source-generated registration extensions for ReactiveUI views. - /// - internal static class ReactiveUISourceGeneratorsExtensions - { - [global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "2.6.0.0")] - public static void RegisterViewsForViewModelsSourceGenerated(this global::Splat.IMutableDependencyResolver resolver) - { - if (resolver is null) throw new global::System.ArgumentNullException(nameof(resolver)); - } - } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs deleted file mode 100644 index 5bc3ccc..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.IViewForGenerator/ReactiveUI.SourceGenerators.IViewForAttribute.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model. -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} - -/// -/// IViewForAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model, ensure to use the full type name including namespace. -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute -{ - /// - /// Gets the Splat registration type for Splat IViewFor registration. - /// Registers IViewFor in the Splat service locator. - /// - public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None; - - /// - /// Gets the Splat registration type for Splat View Model registration. - /// Registers the ViewModel (T) in the Splat service locator. - /// - public SplatRegistrationType ViewModelRegistrationType { get; init; } = SplatRegistrationType.None; -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs deleted file mode 100644 index 5116d6d..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator/ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// ObservableAsPropertyAttribute. -/// -/// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property | global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ObservableAsPropertyAttribute : global::System.Attribute -{ - /// - /// Gets the name of the property. - /// - /// - /// The name of the property. - /// - public string? PropertyName { get; init; } - - /// - /// Gets the Readonly state of the OAPH property. - /// - /// - /// The is read only of the OAPH property. - /// - public bool ReadOnly { get; init; } = true; - - /// - /// Gets the AccessModifier of the OAPH property. - /// - /// - /// The AccessModifier of the OAPH property, protected if true. - /// - public bool UseProtected { get; init; } = false; - - /// - /// Gets the Initial value of the OAPH property. - /// - /// - /// The initial value of the OAPH property. - /// - public string? InitialValue { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs deleted file mode 100644 index 93c50ee..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCollectionGenerator/ReactiveUI.SourceGenerators.ReactiveCollectionAttribute.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// ReactiveAttribute. -/// -/// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCollectionAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs deleted file mode 100644 index eb37e34..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveCommandGenerator/ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// ReactiveCommand Attribute. -/// -/// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveCommandAttribute : global::System.Attribute -{ - /// - /// Gets the can execute method or property. - /// - /// - /// The name of the CanExecute Observable of bool. - /// - public string? CanExecute { get; init; } - - /// - /// Gets the output scheduler. - /// - /// - /// The output scheduler. - /// - public string? OutputScheduler { get; init; } - - /// - /// Gets the AccessModifier of the ReactiveCommand property. - /// - /// - /// The AccessModifier of the property. - /// - public PropertyAccessModifier AccessModifier { get; init; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs deleted file mode 100644 index 4628975..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.AccessModifier.g.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// AccessModifier. -/// -internal enum AccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, - Init, -} - -/// -/// Property Access Modifier. -/// -internal enum PropertyAccessModifier -{ - Public, - Protected, - Internal, - Private, - InternalProtected, - PrivateProtected, -} - -/// -/// InheritanceModifier. -/// -internal enum InheritanceModifier -{ - None, - Virtual, - Override, - New, -} - -internal enum SplatRegistrationType -{ - None, - LazySingleton, - Constant, - PerRequest, -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs deleted file mode 100644 index b18e2ed..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveGenerator/ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// ReactiveAttribute. -/// -/// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Field | global::System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)] -internal sealed class ReactiveAttribute : global::System.Attribute -{ - /// - /// Initializes a new instance of the class. - /// - public ReactiveAttribute(params string[] alsoNotify) - { - AlsoNotify = alsoNotify; - } - - /// - /// Gets the AccessModifier of the set property. - /// - /// - /// The AccessModifier of the set property. - /// - public AccessModifier SetModifier { get; init; } - - /// - /// Gets the InheritanceModifier of the property. - /// - public InheritanceModifier Inheritance { get; init; } - - /// - /// Use Required attribute to indicate that the property is required. - /// - public bool UseRequired { get; init; } - - /// - /// Gets the AlsoNotify properties to raise change notifications for. - /// - public string[]? AlsoNotify { get; } -} -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs deleted file mode 100644 index 03df987..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.ReactiveObjectGenerator/ReactiveUI.SourceGenerators.IReactiveObjectAttribute.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators; - -/// -/// IReactiveObject Attribute. -/// -/// -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveObjectGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class IReactiveObjectAttribute : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs deleted file mode 100644 index 700f72a..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.RoutedControlHostAttribute.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators.WinForms; - -/// -/// RoutedControlHostAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model. -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.RoutedControlHostGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class RoutedControlHostAttribute(string? baseType) : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs deleted file mode 100644 index 1699d42..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/ReactiveUI.SourceGenerators/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostGenerator/ReactiveUI.SourceGenerators.WinForms.ViewModelControlHostAttribute.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved. -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// -#pragma warning disable -#nullable enable -namespace ReactiveUI.SourceGenerators.WinForms; - -/// -/// ViewModelControlHostAttribute. -/// -/// -/// -/// Initializes a new instance of the class. -/// -/// Type of the view model. -[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ViewModelControlHostGenerator", "2.6.0.0")] -[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -internal sealed class ViewModelControlHostAttribute(string? baseType) : global::System.Attribute; -#nullable restore -#pragma warning restore \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs deleted file mode 100644 index a02d1f0..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Microsoft.CodeAnalysis.EmbeddedAttribute.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Microsoft.CodeAnalysis -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] - [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] - [System.Diagnostics.Conditional("NEVER_DEFINED")] - internal sealed class EmbeddedAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs deleted file mode 100644 index f710541..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.Reg.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Provides extension methods for the Splat dependency injection source generator. - /// This partial class contains the generated implementation of dependency registrations. - /// - internal static partial class SplatRegistrations - { - /// - /// Internal implementation of dependency injection setup. - /// This method is generated at compile-time and contains all registrations - /// defined through the source generator marker methods. - /// - /// The instance to register dependencies with. - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) - { - resolver.Register(() => new global::TestApp.ServiceImplementation()); - resolver.Register(() => new global::TestApp.ConsoleLogger()); - { - global::System.Lazy lazy = new global::System.Lazy(() => new global::TestApp.ServiceWithDependency(resolver.GetService() ?? throw new global::System.InvalidOperationException("Dependency 'global::TestApp.ILogger' not registered with Splat resolver."))); - resolver.Register>(() => lazy); - resolver.Register(() => lazy.Value); - } } - } -} \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs b/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs deleted file mode 100644 index a774c28..0000000 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Generated/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.Generator/Splat.DI.g.cs +++ /dev/null @@ -1,193 +0,0 @@ -// - -#nullable enable annotations -#nullable disable warnings - -// Suppress warnings about [Obsolete] member usage in generated code. -#pragma warning disable CS0612, CS0618 - -namespace Splat -{ - /// - /// Provides extension methods for the Splat dependency injection source generator. - /// This class contains marker methods that are analyzed at compile-time to generate - /// dependency injection registrations. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Splat.DependencyInjection.SourceGenerator", "2.1.0.0")] - internal static partial class SplatRegistrations - { - /// - /// Registers a transient dependency mapping from to . - /// A new instance of will be created each time is resolved. - /// - /// The interface or base type to register. - /// The concrete type that implements . - public static void Register() - { - } - - /// - /// Registers a transient dependency mapping from to with a contract. - /// A new instance of will be created each time is resolved with the specified contract. - /// - /// The interface or base type to register. - /// The concrete type that implements . - /// A unique string identifier to distinguish between multiple registrations of the same type. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy singleton dependency mapping from to . - /// A single instance of will be created on first resolution and reused for all subsequent resolutions. - /// - /// The interface or base type to register. - /// The concrete type that implements . - public static void RegisterLazySingleton() - { - } - - /// - /// Registers a lazy singleton dependency mapping from to with specified thread safety mode. - /// A single instance of will be created on first resolution and reused for all subsequent resolutions. - /// - /// The interface or base type to register. - /// The concrete type that implements . - /// The specifying how the singleton should be initialized in multi-threaded scenarios. - public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a lazy singleton dependency mapping from to with a contract. - /// A single instance of will be created on first resolution and reused for all subsequent resolutions. - /// - /// The interface or base type to register. - /// The concrete type that implements . - /// A unique string identifier to distinguish between multiple registrations of the same type. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a lazy singleton dependency mapping from to with a contract and specified thread safety mode. - /// A single instance of will be created on first resolution and reused for all subsequent resolutions. - /// - /// The interface or base type to register. - /// The concrete type that implements . - /// A unique string identifier to distinguish between multiple registrations of the same type. - /// The specifying how the singleton should be initialized in multi-threaded scenarios. - public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) - { - } - - /// - /// Registers a transient dependency for type . - /// A new instance of will be created each time it is resolved. - /// - /// The type to register. - public static void Register() - { - } - - - /// - /// Registers a transient dependency for type with a contract. - /// A new instance of will be created each time it is resolved with the specified contract. - /// - /// The type to register. - /// A unique string identifier to distinguish between multiple registrations of the same type. - public static void Register(string contract) - { - } - - /// - /// Registers a lazy singleton dependency for type . - /// A single instance of will be created on first resolution and reused for all subsequent resolutions. - /// - /// The type to register. - public static void RegisterLazySingleton() - { - } - - - /// - /// Registers a lazy singleton dependency for type with a contract. - /// A single instance of will be created on first resolution and reused for all subsequent resolutions. - /// - /// The type to register. - /// A unique string identifier to distinguish between multiple registrations of the same type. - public static void RegisterLazySingleton(string contract) - { - } - - /// - /// Registers a constant (singleton) instance of type with the dependency resolver. - /// This method is a proxy for . - /// - /// The type of the instance to register. Must be a reference type. - /// The instance to register as a constant. - public static void RegisterConstant(T instance) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance); - - /// - /// Registers a constant (singleton) instance of type with the dependency resolver using a contract. - /// This method is a proxy for . - /// - /// The type of the instance to register. Must be a reference type. - /// The instance to register as a constant. - /// A unique string identifier to distinguish between multiple registrations of the same type. - public static void RegisterConstant(T instance, string contract) where T : class => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); - - /// - /// Initializes the dependency injection container by registering all dependencies with the default . - /// This method should be called once during application startup after all registration calls have been made. - /// - public static void SetupIOC() - { - SetupIOCInternal(Splat.Locator.GetLocator()); - } - - /// - /// Initializes the dependency injection container by registering all dependencies with the specified resolver. - /// This method should be called once during application startup after all registration calls have been made. - /// - /// The instance to register dependencies with. - public static void SetupIOC(Splat.IDependencyResolver resolver) - { - SetupIOCInternal(resolver); - } - - - static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); - } - - /// - /// Marks a property to be injected by the dependency injection engine. - /// Properties marked with this attribute will have their values automatically - /// resolved and set by the DI container during object construction. - /// - /// - /// The property must have an accessible setter (public, internal, or internal protected). - /// The property type must be registered in the DI container, or resolution will fail at runtime. - /// - [System.AttributeUsage(System.AttributeTargets.Property), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionPropertyAttribute : System.Attribute - { - } - - /// - /// Marks a constructor as the preferred constructor for dependency injection. - /// When a class has multiple constructors, this attribute specifies which constructor - /// the DI engine should use for object construction. - /// - /// - /// Only one constructor per class should be marked with this attribute. - /// If multiple constructors exist without this attribute, the analyzer will generate - /// diagnostic warning SPLATDI001. - /// The constructor must be accessible (public, internal, or internal protected). - /// - [System.AttributeUsage(System.AttributeTargets.Constructor), Microsoft.CodeAnalysis.Embedded] - internal sealed class DependencyInjectionConstructorAttribute : System.Attribute - { - } -} \ No newline at end of file diff --git a/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj b/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj index e9c5c94..c3764b3 100644 --- a/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj +++ b/src/tests/Splat.DI.SourceGenerator.TestApp/Splat.DI.SourceGenerator.TestApp.csproj @@ -5,8 +5,6 @@ net10.0 enable enable - true - Generated