Skip to content

Commit 5517f6c

Browse files
committed
jinshil
1 parent 35e7b92 commit 5517f6c

File tree

18 files changed

+867
-152
lines changed

18 files changed

+867
-152
lines changed

README.md

Lines changed: 129 additions & 108 deletions
Large diffs are not rendered by default.

later.md

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

3-
## Latest Update : 2025-08-10 => 10 August 2025
3+
## Latest Update : 2025-08-11 => 11 August 2025
44

55

66

@@ -152,151 +152,145 @@ Why I have not tested : later
152152

153153

154154

155-
25) [https://github.com/ramhari-dev/PropGenAoT]( https://github.com/ramhari-dev/PropGenAoT) , https://github.com/ramhari-dev/PropGenAoT
155+
25) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage
156156

157157
Why I have not tested : later
158158

159159

160160

161-
26) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage
161+
26) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net
162162

163163
Why I have not tested : later
164164

165165

166166

167-
27) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net
167+
27) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands
168168

169169
Why I have not tested : later
170170

171171

172172

173-
28) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands
173+
28) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect
174174

175175
Why I have not tested : later
176176

177177

178178

179-
29) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect
179+
29) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow
180180

181181
Why I have not tested : later
182182

183183

184184

185-
30) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow
185+
30) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator
186186

187187
Why I have not tested : later
188188

189189

190190

191-
31) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator
191+
31) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc
192192

193193
Why I have not tested : later
194194

195195

196196

197-
32) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc
197+
32) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler
198198

199199
Why I have not tested : later
200200

201201

202202

203-
33) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler
203+
33) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator
204204

205205
Why I have not tested : later
206206

207207

208208

209-
34) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator
209+
34) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS
210210

211211
Why I have not tested : later
212212

213213

214214

215-
35) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS
215+
35) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain
216216

217217
Why I have not tested : later
218218

219219

220220

221-
36) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain
221+
36) [MvvmGen]( https://github.com/thomasclaudiushuber/mvvmgen) , https://github.com/thomasclaudiushuber/mvvmgen
222222

223223
Why I have not tested : later
224224

225225

226226

227-
37) [MvvmGen]( https://github.com/thomasclaudiushuber/mvvmgen) , https://github.com/thomasclaudiushuber/mvvmgen
227+
37) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables
228228

229229
Why I have not tested : later
230230

231231

232232

233-
38) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables
233+
38) [Overloader]( https://github.com/emptycoder/Overloader) , https://github.com/emptycoder/Overloader
234234

235235
Why I have not tested : later
236236

237237

238238

239-
39) [Overloader]( https://github.com/emptycoder/Overloader) , https://github.com/emptycoder/Overloader
239+
39) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp
240240

241241
Why I have not tested : later
242242

243243

244244

245-
40) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp
245+
40) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen
246246

247247
Why I have not tested : later
248248

249249

250250

251-
41) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen
251+
41) [schema]( https://github.com/MeltyPlayer/Schema) , https://github.com/MeltyPlayer/Schema
252252

253253
Why I have not tested : later
254254

255255

256256

257-
42) [schema]( https://github.com/MeltyPlayer/Schema) , https://github.com/MeltyPlayer/Schema
257+
42) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco
258258

259259
Why I have not tested : later
260260

261261

262262

263-
43) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco
263+
43) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/
264264

265265
Why I have not tested : later
266266

267267

268268

269-
44) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/
269+
44) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator
270270

271271
Why I have not tested : later
272272

273273

274274

275-
45) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator
275+
45) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/
276276

277277
Why I have not tested : later
278278

279279

280280

281-
46) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/
281+
46) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator
282282

283283
Why I have not tested : later
284284

285285

286286

287-
47) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator
287+
47) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink
288288

289289
Why I have not tested : later
290290

291291

292292

293-
48) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink
294-
295-
Why I have not tested : later
296-
297-
298-
299-
49) [Visor]( https://github.com/Tinkoff/Visor) , https://github.com/Tinkoff/Visor
293+
48) [Visor]( https://github.com/Tinkoff/Visor) , https://github.com/Tinkoff/Visor
300294

301295
Why I have not tested : later
302296

v2/Generator/all.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ Nr,Key,Source,Category
221221
220,NFH.FileEmbed, https://github.com/SirCxyrtyx/FileEmbed,FilesToCode
222222
221,RxSourceGenerator, https://github.com/Zalutskii/Reactive-Extensions-event-generator,RX
223223
222,Finch.Generators, https://github.com/ivmazurenko/finch,Database
224+
223,JinShil.MixinSourceGenerator, https://github.com/JinShil/JinShil.MixinSourceGenerator,Mixin

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,5 +1341,11 @@
13411341
"Category": 14,
13421342
"dtStart": "2025-08-10T00:00:00",
13431343
"show": true
1344+
},
1345+
{
1346+
"ID":"JinShil.MixinSourceGenerator",
1347+
"Category": 39,
1348+
"dtStart": "2025-08-11T00:00:00",
1349+
"show": true
13441350
}
13451351
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A C# source generator for composing classes or structs from other classes or structs using mixins.
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# JinShil.MixinSourceGenerator
2+
3+
[![NuGet Version](https://img.shields.io/nuget/v/JinShil.MixinSourceGenerator?style=flat-square&logo=nuget)](https://www.nuget.org/packages/JinShil.MixinSourceGenerator)
4+
5+
This is a very simple, but powerful C# source generator that simplifies class and struct composition through the use of mixins.
6+
7+
It dramatically increases code reuse by copying members, including attributes and XML comments, verbatim from one or more implementation types to another type. The resulting type becomes a composition of the implementation types without employing inheritance, extensions, default interface methods, or any other specialized language feature.
8+
9+
It simply copies and pastes members from one or more types into another.
10+
11+
## Example
12+
13+
The following example demonstrates how to use this source generator to compose a class from two implementation classes.
14+
15+
1. Apply one or more `[Mixin(typeof(TypeToMixIn))]` attributes to a partial class or struct, specifying the types to mix in.
16+
2. The source generator scans for the specified types and copies their members, including attributes and XML comments, verbatim into the attributed type.
17+
18+
19+
### Source Code
20+
21+
```C#
22+
internal class Implementation1
23+
{
24+
/// <summary>
25+
/// Summary for Property1
26+
/// </summary>
27+
[SomeAttribute]
28+
public int Property1 { get; }
29+
30+
/// <summary>
31+
/// Summary for Method1
32+
/// </summary>
33+
[SomeAttribute]
34+
public void Method1()
35+
{
36+
Console.WriteLine("Running Method 1");
37+
}
38+
}
39+
```
40+
41+
```C#
42+
internal class Implementation2
43+
{
44+
/// <summary>
45+
/// Summary for Property2
46+
/// </summary>
47+
[SomeAttribute]
48+
public int Property2 { get; }
49+
50+
/// <summary>
51+
/// Summary for Method2
52+
/// </summary>
53+
[SomeAttribute]
54+
public void Method2()
55+
{
56+
Console.WriteLine("Running Method 2");
57+
}
58+
}
59+
```
60+
61+
```C#
62+
[Mixin(typeof(Implementation1))]
63+
[Mixin(typeof(Implementation2))]
64+
public partial class Composition : SomeBaseClass, ISomeInterface
65+
{
66+
}
67+
```
68+
### Generated Code
69+
The above code will result in the following generated code, a composition of `Implementation1` and `Implementation2`.
70+
71+
```C#
72+
[Mixin(typeof(Implementation1))]
73+
[Mixin(typeof(Implementation2))]
74+
public partial class Composition : SomeBaseClass, ISomeInterface
75+
{
76+
/// <summary>
77+
/// Summary for Property1
78+
/// </summary>
79+
[SomeAttribute]
80+
public int Property1 { get; }
81+
82+
/// <summary>
83+
/// Summary for Method1
84+
/// </summary>
85+
[SomeAttribute]
86+
public void Method1()
87+
{
88+
Console.WriteLine("Running Method 1");
89+
}
90+
91+
/// <summary>
92+
/// Summary for Property2
93+
/// </summary>
94+
[SomeAttribute]
95+
public int Property2 { get; }
96+
97+
/// <summary>
98+
/// Summary for Method2
99+
/// </summary>
100+
[SomeAttribute]
101+
public void Method2()
102+
{
103+
Console.WriteLine("Running Method 2");
104+
}
105+
}
106+
```
107+
108+
## The `[MixinIgnore]` Attribute
109+
110+
The `[MixinIgnore]` attribute can be added to implementation type members, allowing the implementation type to compile, but deferring the member's implementation to the composed type.
111+
112+
### Source Code
113+
114+
```C#
115+
internal class Implementation
116+
{
117+
// The source generator will not copy this method into any composition type.
118+
// This member is effectively just a stub, so that this implementation class will compile.
119+
[MixinIgnore]
120+
void Method1()
121+
{ }
122+
123+
/// <summary>
124+
/// Summary of Method2
125+
/// </summary>
126+
public void Method2()
127+
{
128+
Method1();
129+
}
130+
}
131+
```
132+
133+
```C#
134+
[Mixin(typeof(Implementation))]
135+
public partial class Composition
136+
{
137+
/// <summary>
138+
/// Summary of Method1
139+
/// </summary>
140+
public void Method1()
141+
{
142+
Console.WriteLine("Running Method1");
143+
}
144+
}
145+
```
146+
### Generated Code
147+
The above code will result in the following generated code. `Implementation.Method2()` will call `Composition.Method1()`, not `Implementation.Method1()`.
148+
149+
```C#
150+
public partial class Composition
151+
{
152+
/// <summary>
153+
/// Summary of Method1
154+
/// </summary>
155+
public void Method1()
156+
{
157+
Console.WriteLine("Running Method1");
158+
}
159+
160+
/// <summary>
161+
/// Summary of Method2
162+
/// </summary>
163+
public void Method2()
164+
{
165+
Method1();
166+
}
167+
}
168+
```
169+
170+
## License
171+
172+
This repository is licensed under the GNU General Public License (GPL). The GPL applies only to the source code in this repository. Code generated by the source generator is not subject to this license and can be used according to your own project's licensing terms.

0 commit comments

Comments
 (0)