Skip to content

Preserve original comments on params in dts generated by pseudo type node builder under removeComments: false#3263

Open
Andarist wants to merge 3 commits intomicrosoft:mainfrom
Andarist:fix/comments-on-params-in-dts
Open

Preserve original comments on params in dts generated by pseudo type node builder under removeComments: false#3263
Andarist wants to merge 3 commits intomicrosoft:mainfrom
Andarist:fix/comments-on-params-in-dts

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +665 to +667
parameter.DotDotDotToken != nil,
e.Name(),
e.AsParameterDeclaration().QuestionToken != nil || e.AsParameterDeclaration().Initializer != nil,
ch.typeFromParameter(e.AsParameterDeclaration()),
parameter.QuestionToken != nil || parameter.Initializer != nil,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some level, why even have any of these if we are ferrying along the declaration?

(Or, why not just use p.Name.Parent more above?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some level, why even have any of these if we are ferrying along the declaration?

ye, u are right here - since the new addition most of those other fields can just be read directly from the Declaration. I made that change.

Or, why not just use p.Name.Parent more above?

I thought about that but that felt indirect and not matching the style of all of those other fields on pseudochecker structs

@jakebailey
Copy link
Copy Markdown
Member

At some level, I wonder if this is even worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants