Skip to content
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

Use type annotation in declarations emitter #1122

Merged
merged 19 commits into from
Nov 21, 2014

Conversation

sheetalkamat
Copy link
Member

If user specified type annotation exists in the typescript file, use that instead of inferring the name from the symbol

case SyntaxKind.StringLiteral:
return writeTextOfNode(type);
case SyntaxKind.TypeReference:
return emitTypeReference(<TypeReferenceNode>type);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just write the text of teh node here? i.e. writeTextOfNode(type)? For that matter, why not just call writeTextOfNode for all TypeNode's?

Copy link
Member Author

Choose a reason for hiding this comment

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

that's because we want to format how we are writing d.ts ... We do need to go deep in the type node though to check if it is referencing any type that is not visibile so it didn't seem much of a work writing the text to declaration file along with traversing.

sheetalkamat added a commit that referenced this pull request Nov 21, 2014
…nsEmitter

Use type annotation in declarations emitter
@sheetalkamat sheetalkamat merged commit 763a114 into master Nov 21, 2014
@sheetalkamat sheetalkamat deleted the useTypeAnnotationInDeclarationsEmitter branch November 21, 2014 00:58
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants