Closed Tristan10 closed 2 years ago
I am not able to reproduce that, it happens to all models or only for this one?
It happens to all models that inherit another class. Any time this {{ class.HasBaseClass ? ("extends " + class.BaseClass.Name) : ""}}
resolves true.
Are you able to reproduce this on a newly created project?
Sorry, I wasn't able to get to this right away. Found out that removing the line above the snippet I included in my issue
{{ class.Properties | Custom.GetPropertyImport }}
was causing the issue. That custom function contained this code:
StringBuilder sb = new StringBuilder();
foreach (var type in allTypes)
{
sb.AppendLine($"import {{ {type.Name} }} from './{type.Name}';");
}
return sb.ToString();
Just because of my suspicion updated it to be this instead:
List<string> lines = new List<string>();
foreach (var type in allTypes)
{
lines.Add($"import {{ {type.Name} }} from './{type.Name}';");
}
return string.Join("\n", lines);
It seems to have solved the issue I was seeing. I really don't know why.
Hello again,
After version 0.3.4 I started noticing some different functionality in my rendering than normal. An erroneous space is being added to my output.
Snippet of Template:
Output:
Notice the two spaces between "FutureCast" and "extends". Another weird behavior that I have noticed is that any time
class.HasBaseClass
resolves to true in my template, my generated model is checked out in source control even though there are no changes.