JSDoc support by RyanCavanaugh · Pull Request #6024 · microsoft/TypeScript

@RyanCavanaugh

Adds support for adding type information in JavaScript files using jsdoc tags

DanielRosenwasser

Choose a reason for hiding this comment

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

Will we ever manifest this name to the user?

Choose a reason for hiding this comment

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

Yes

@ahejlsberg

The parseJSDocOptionalType function in parser.ts is never called.

DanielRosenwasser

Choose a reason for hiding this comment

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

I'm not seeing where you skip this check.

@RyanCavanaugh

@RyanCavanaugh

@RyanCavanaugh

ahejlsberg

Choose a reason for hiding this comment

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

Hmm, so an identifier can start with anything but the characters checked for above, but then after that must contain proper identifier characters. That seems a bit odd.

@RyanCavanaugh

@RyanCavanaugh

ahejlsberg

Choose a reason for hiding this comment

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

Should be parseJSDocIdentifier. The scanning is handled by the scanner.

Choose a reason for hiding this comment

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

Also, it should call nextJSDocToken(), similar to what parseIdentifier in the main parser does.

@RyanCavanaugh

billti

Choose a reason for hiding this comment

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

This should never happen though right? As you've eaten the preceding white space, and there's nothing in here where you would consume white space inside a token.