Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

Add support for TSTupleType and TSAbstractClassDeclaration in ast-node-types.js #16

Closed
vivekgalatage opened this issue Sep 29, 2018 · 4 comments · Fixed by #65
Closed
Labels

Comments

@vivekgalatage
Copy link

vivekgalatage commented Sep 29, 2018

What version of TypeScript are you using?
Typescript 3.0.1

What code were you trying to parse?

class Class {
  method(parameters: [number, string?, boolean?]) {
  }
}

Please take a look at the AST explorer snippet for the same
https://astexplorer.net/#/gist/e5dd1011355354fea561d02cb10e0b05/9ccb97f94ca1871a0f8917bed5b4d95402a07e13

What did you expect to happen?
The TSTupleType keyword should be in the ast-node-types.js file.

What actually happened?
Support for TSTupleType as ast-node-type is missing.

@vivekgalatage vivekgalatage changed the title Add support for TSTupleType in ast-node-types.js Add support for TSTupleType and TSAbstractClassDeclaration in ast-node-types.js Oct 4, 2018
@vivekgalatage
Copy link
Author

This also applies to TSAbstractClassDeclaration

abstract class Hello {
  static world(): string {
    return ""
  }
}

Please take a look at the AST here
https://astexplorer.net/#/gist/3b79e871a564de599f26479d58bb5cd8/33d9327299b131a23e78e5e738bef37e2bec5584

So can TSAbstractClassDeclaration be added to the ast-node-types.js as well?

@JamesHenry
Copy link
Owner

Thanks for reporting @vivekgalatage, I'm curious in what situation this surfaced as an issue for you?

@vivekgalatage
Copy link
Author

@JamesHenry I am using the typescript as a replacement for defining the WebIDL[1] files. The type checking and language support is awesome with the typescript.

So the various spec.ts files are written in typescript which are parsed using typescript-eslint-parser which in turn relies upon ast-node-types.js.

During parsing, the tokens are passed through various switch case statements and this is where I found out these couple of missing constants in the above file.

[1] https://heycam.github.io/webidl/

@JamesHenry
Copy link
Owner

🎉 This issue has been resolved in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants