NTypewriter icon indicating copy to clipboard operation
NTypewriter copied to clipboard

Incremental Generator

Open viceroypenguin opened this issue 1 year ago • 1 comments

I've been using Scriban as my templating engine for a while, and I came across your live editor for Scriban files. I'd love to switch to your NTypewriter.SourceGenerator for some of my stuff, but I noticed that it is still dependent on ISourceGenerator.

Are there any plans to upgrade to IIncrementalGenerator? This would improve performance and the source generator to be done live instead of only at VS Load.

viceroypenguin avatar Dec 22 '23 00:12 viceroypenguin

Rendering is done on every full build not only on VS load.

NTypewriter.SourceGenerator will never be upgraded to IIncrementalGenerator, more likely a new one called NTypewriter.IncrementalSourceGenerator will be added.

Keep in mind that right now in .nt templates users have access to every type from the project. To take advantage of IIncrementalGenerator, .nt templates would have to be per single type, and somehow be able to define a predicate to filter when IIncrementalGenerator should run.

NeVeSpl avatar Dec 22 '23 08:12 NeVeSpl