Comments (3)
That behaviour was introduced here #75.
In general, it is a good idea to split Save
into two functions: Save
and AddSource
, but as you already noticed #106 adding *.cs files as a source has some problems right now.
from ntypewriter.
I have created a fork in hope to get the requires changes done. But it seems a split is only possible with heavy refactoring or introducing new APIs / deprecating old ones.
My approach would be to deprecate certain APIs and introduce more flexible ones. I think the steps would be
- Define
NTypewriter.Runtime.IGeneratedFile
with propertiesPath
andContent
- Make
IGeneratedFileReaderWriter.Write(string, string)
obsolete - Add
IGeneratedFileReaderWriter.Write(IGeneratedFile)
- Allows
GeneratedFileReaderWriter
to cast for certain types implementingIGeneratedFile
mentioned blow
- Allows
- Add
AddSourceFunction
based onSaveFunction
- Pass
NTypewriter.SourceGenerator.GeneratedCSharpFile
implementingIGeneratedFile
toAddRenderedItem
- Pass
- Implement
IGeneratedFile
inRenderedItem
- Add some logic in ``GeneratedFileReaderWriter
for handling
RenderedItem` and `GeneratedCSharpFile` differently
What do you think?
from ntypewriter.
I would prefer to add a flag AddToCompilation
on NTypewriter.RenderedItem
instead of using IGeneratedFile
as a marking interface, anyway NTypewriter
does not have a reference on NTypewriter.Runtime
, so using interface there defined is not an option. Passing that flag through the whole execution path should be enough without introducing any new types.
from ntypewriter.
Related Issues (20)
- Changes from GIT not picked up by NTypewriter HOT 3
- This is perfect for AI
- Failed to compile user code (System.Collections) HOT 10
- Source Generator ArgumentNullException HOT 8
- `Microsoft.CodeAnalysis` not found HOT 10
- SourceGenerator can't find dependent projects HOT 2
- Publish latest releases as NuGet package HOT 4
- Template output preview is always displayed on top of everything HOT 1
- Template output preview with dark mode support
- Using C# 9.0 init accessors in a custom function gives an error inside Visual Studio extension HOT 1
- Extend AllReferencedTypes to search on Interfaces HOT 1
- Request - Property internal set vs public flag or filter HOT 3
- AttributeArgument.Value.Tostring() causes exception: TypedConstant is an array. Use Values property
- Unable to build project with SourceGenerator: 'ITypedConstant' could not be found HOT 2
- Unable to debug SourceGenerator, no output and no log files created HOT 6
- Why does Type.ToTypeScriptType ignore nullable if [Required] attribute is present? HOT 4
- Template processing fails when reading arguments from an Attribute that has arguments with default values (Roslyn project) HOT 3
- Missing default value for DateTime
- Incremental Generator HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntypewriter.