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

getFirstToken returns jsdoc as single comment #13599

Merged
merged 1 commit into from
Jan 21, 2017

Conversation

sandersn
Copy link
Member

Fixes #13519

This is a bit odd, but it's the way that 2.0 and earlier behaved. 2.1 broke it with the jsdoc parser rewrite.

Also update LastJSDocNode since it had fallen out of date.

This is a bit odd, but it's the way that 2.0 and earlier behaved. 2.1
broke it.
@mhegazy mhegazy merged commit 9ac7c32 into master Jan 21, 2017
@mhegazy mhegazy deleted the getFirstToken-returns-jsdoc branch January 21, 2017 01:01
it("gets jsdoc", () => {
const first = ts.createSourceFile("foo.ts", "/** comment */var a = true;", ts.ScriptTarget.ES5, /*setParentNodes*/ true);
assert.isDefined(first);
assert.equal(first.kind, 263);
Copy link
Member

Choose a reason for hiding this comment

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

Why does this not use ts.SyntaxKind?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. I grabbed 263 straight from the debugger. Nice catch. It looks like this issue needs some more attention (to fix getNextToken as well) so I'll correct this in the followup PR.

sandersn added a commit that referenced this pull request Jan 24, 2017
Fixes #13519.
This is a better fix than #13599.
Also fixes broken tests associated with #13599.
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

4 participants