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

Wrap IndexSignatureDeclaration #242

Closed
kjpou1 opened this issue Feb 7, 2018 · 2 comments
Closed

Wrap IndexSignatureDeclaration #242

kjpou1 opened this issue Feb 7, 2018 · 2 comments

Comments

@kjpou1
Copy link

kjpou1 commented Feb 7, 2018

Would open up navigation without resorting to ts.IndexSignature <=> ts-simple-ast casting.

example with casting:

function foo (node : sast.Node)
{
   const indexSignatureDeclaration = <ts.IndexSignatureDeclaration> node.compilerNode;
   const isitreally = ts.isIndexSignatureDeclaration(indexSignatureDeclaration);
   const isitreallyreally = ts.isIndexSignatureDeclaration(node.compilerNode);
   console.log((<any>ts).SyntaxKind[indexSignatureDeclaration.kind]);

   for (let i = 0, n = indexSignatureDeclaration.parameters.length; i < n; i++) {
     const param = indexSignatureDeclaration.parameters[i];
     console.log((<any>ts).SyntaxKind[param.kind]);
   }

   console.log((<any>ts).SyntaxKind[indexSignatureDeclaration.type.kind]);
}
@dsherret
Copy link
Owner

dsherret commented Feb 9, 2018

I was surprised I never implemented this previously. Implemented now in 6.11.1.

@dsherret dsherret closed this as completed Feb 9, 2018
@kjpou1
Copy link
Author

kjpou1 commented Feb 9, 2018

Works like a charm. Thanks.

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

No branches or pull requests

2 participants