question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supported Node Kinds?

See original GitHub issue

Hi,

I’ve noticed that while tsquery(ast, 'ClassDeclaration'); brings a a value, tsquery(ast, 'ClassKeyword'); dosn’t. What’s the reason for this? How can I find out which node kinds I can use in queries?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
manfredsteyercommented, Jun 6, 2018

Ah, cool, now everything makes sense for me. Thx, @urish !

0reactions
urishcommented, Jun 2, 2018

@manfredsteyer in your function you use getChildren() to traverse the tree. TSQuery uses forEachChild. You can modify your showTree() helper function as follows to get the same tree as TSQuery sees:

function showTree(node, indent: string = '    '): void {
    console.log(indent + ts.SyntaxKind[node.kind]);
    if (node.getChildCount() === 0) {
        console.log(indent + '    Text: ' + node.getText());
    }

    node.forEachChild(child => {
        showTree(child, indent + '    ');
    });
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Supported node types - Amazon ElastiCache for Redis
Supported node types ; T1 node types: cache.t1.micro ; M1 node types: cache.m1.small , cache.m1.medium , cache.m1.large , cache.m1.xlarge ; M3 node types:...
Read more >
@types/node - npm
This package contains type definitions for Node.js (https://nodejs.org/). Details. Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/ ...
Read more >
Supported Node.js versions - Google Cloud
This section provides an overview of how to keep your version of the Cloud Client Libraries for Node.
Read more >
Supported node types | Download Table - ResearchGate
Download Table | Supported node types from publication: Generative Composition with Nodal | This paper describes a new generative software system for music ......
Read more >
amazon-elasticache-docs/CacheNodes.SupportedTypes.md ...
Supported node types · General purpose: Current generation: M6g node types (available only for Memcached engine version 1.5. · Compute optimized: Previous ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found