Skip to content

Refactor Generators code #89

@dex3r

Description

@dex3r

Code under namespace EasySourceGenerators.Generators.IncrementalGenerators is currently a mess. Let's refactor it to be readable, maintanable and testable.

Besides general good coding rules, focus on:

  • Don't store global state, pass necessary data as parameters
  • Create small classes with small methods, that only do one thing
  • make sure the classes are unit-testable
  • if needed, create abstraction layer for Roslyn Generators and other parts. minimize using Roslyn Generators code to a small subset of classes that need them, making most of the code logic unit-testable without running any actuall generators
  • extract all parts of code that emit code as strings (like "{" or "private") into separate namespace with separate classes. create unit tests for them.
  • create documentation ///<summary> comments for internal/public methods when name is not enough

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions