-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: append sourceFileName on BaseType, used by TopRefNodeParser and ExposeNodeParser #1019
Conversation
… ExposeNodeParser.
* sourcecode fileName for DefinitionType. used at TopRefNodeParser | ||
* and ExposeNodeParser. so that, you can override DefinitionFormatter | ||
* to custome your self DefinitionType name by fileName. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use proper capitalization.
* and ExposeNodeParser. so that, you can override DefinitionFormatter | ||
* to custome your self DefinitionType name by fileName. | ||
*/ | ||
sourceFileName?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be in the DefinitionType
instead of the base type?
|
||
if (baseType === undefined) { | ||
return undefined; | ||
} | ||
|
||
if (this.topRef && !(baseType instanceof DefinitionType)) { | ||
return new DefinitionType(this.fullName, baseType); | ||
const defBaseType = new DefinitionType(this.fullName, baseType); | ||
defBaseType.sourceFileName = sourceFileName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel clean. Can we make sourceFileName
an argument to the DefinitionType
constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your correction. I think it is a very good suggestion. I will try to submit a version again tomorrow to correct these problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any updates @charlzyx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry i'm too late, too busy to submit; And sorry again, i don't know how to submit this or, so i have reopen another one #1056
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you push to the branch this pull request was made from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about #1056 this is my first time to use github pr,I'm not familiar with it.
just want submit a cleaning commit,i will try fix next free time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Please notify me when you want a review then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, please make sure my comment here are addressed. Ideally, copy them over.
for this idea #1018
And here is my custome example
utils/reformatRefDefName.ts
custome DefinitionTypeFormatter
custom ReferenceTypeFormatter