Skip to content

Conversation

@ycanardeau
Copy link
Owner

Continued from #7.

FranckSix and others added 15 commits September 15, 2025 16:35
Separated the concepts and responsibilities of the Code Generators to avoid the confusion caused by partial classes.

I applied RawString to format the unit manager code. This makes the code more readable and eliminates the use of AppendLineLF.

I reorganized the namespaces to focus efforts on the code generators and avoid the distractions of utility classes. All the business logic is now under Generators.

Utilities and satellite classes are under Tools.

Extension methods under Extensions.

Diagnostics have been grouped under the Rules class. I added a new one to track fatal errors and list it in the output.

I also added various extensions to streamline the code.

Reworking the code, I noticed that by not using the CodeGeneration option. The different classes don't go through the CurrentUICulture (which is problematic if you're using the tool in a Roslyn project).

Now that the class responsibilities are clearly defined, I could add a new Generator to the IStringLocalization model. This interface is used in WinUI and Blazor projects, among others.
Using heritage pattern over the generators to clarify witch every class do. To clarify and simplify concept, separation of concepts.

Unification of all Diagnostics in a class Analyzer to respect the Analyzer contract from MS RoslynAnalyser.

Rebrand the SourceGenerator class to switch over a new option GenerationType :
  - ResourceManager (Default)
  - CodeGeneration (In addidition to GenerateCode, to maintenability of existing code)
  - StringLocaliser (new generator includes registration classes to simplifing adding resources to the CollectionService) I added a demo project to demonstrate the new feature.

I optimized the uses of IncrementalProviders to avoid to apply the same filter over and over.

Now we have thee bloc of generation
- ResourcesManager
- CodeGeneration
   - ComboGeneration
- StringLocaliser
  - NamespaceRegistrator
  - GlobalRegistrator
Replace the Tab in .editorconfig
readjust files to <tab> instead of spaces
readjust unit tests
Add comment to enum GenerationType
Correction of typo in documentation
Report the README to XML comment on code to Intellisense purpose
In C#, the * and ^ operators have the same precedence, and evaluation is performed from left to right. So it's not strictly necessary, but I'll add it for clarity.In C#, the * and ^ operators have the same precedence, and evaluation is performed from left to right. So it's not strictly necessary, but I'll add it for clarity.
Also reverted the original comportment on Test2.resx
The global registration class generated even if no StringLocalizer was present
Pass the message of exception instead of exception in case of fatal error
Environement.NewLine not recommended for Analyser and Generator. I changed for a constant
Adjust the Unshipped.md
Add a QUICKSTART.md to have a global view of possibilities the option and simplify configuration for new and current users.
Splitting concepts responsibility
@ycanardeau ycanardeau merged commit 73c2461 into main Oct 19, 2025
3 checks passed
@ycanardeau ycanardeau deleted the pr7-review-fixes branch October 19, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants