t4ts icon indicating copy to clipboard operation
t4ts copied to clipboard

new feature: generate comments from C# source to the TS definitions

Open AkosLukacs opened this issue 9 years ago • 1 comments

Check T4TS.Example/Models/Barfoo.cs and T4TS.Example/T4TS.d.ts for an example

This commit does have some repetitive code, but couldn't pinpoint a "utility" class for the string trimming/modifying code. Of course having a utility class is bad by default...

AkosLukacs avatar Jul 08 '15 13:07 AkosLukacs

Hey @AkosLukacs, nice idea! I've been away for a while, so I haven't been able to keep up to speed with this project, but I'm back now.

I suggest that you pull from the current master and resolve merge-the conflicts.

As for the code, I think you should create a new class called Comment that takes the comment/doccomment string as constructor argument. Encapsulate the comment formatting there. The class can either override .ToString(), or have an explicit method, something like .GetFormattedComment(). Use that Comment class instead of strings for the Comment/DocComment properties of TypeScriptInterface and TypeScriptInterfaceMember. I think that should be pretty clean.

Cheers!

cskeppstedt avatar Nov 06 '15 09:11 cskeppstedt