How to find all the types involved in a node?
See original GitHub issueHow to find all the types involved in a node?
export const TraceConfiguration = {
register(container?: IContainer): void {
Object.assign(Tracer, DebugTracer);
}
};
These types: IContainer
, Tracer
, DebugTracer
for TraceConfiguration
node.
or
export type BindingWithBehavior = IBinding & {
sourceExpression: BindingBehaviorExpression;
};
These types: IBinding
, BindingBehaviorExpression
for BindingWithBehavior
node.
No matter what is the node (Variable, Class, Literal, …) or where is the type (in Parameter, Block, Union, … ).
I want to access all available type.getText()
in the whole node.
Does exist any general way to find out whole types that are used in a node? or I should define a specific functionality for each use case.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Get all nodes of given type - Drupal Answers - Stack Exchange
I know I can get all the nodes (of any type) with \Drupal\node\Entity\Node::loadMultiple() and the list of all types by \Drupal\node\Entity\NodeType:: ...
Read more >Node.nodeType - Web APIs - MDN Web Docs - Mozilla
The read-only nodeType property of a Node interface is an integer that identifies what the node is. It distinguishes different kind of nodes...
Read more >Find all reachable nodes from every node present in a given set
One straight forward solution is to do a BFS traversal for every node present in the set and then find all the reachable...
Read more >Node properties: type, tag and contents
The “nodeType” property ... The nodeType property provides one more, “old-fashioned” way to get the “type” of a DOM node. It has a...
Read more >How to find all nodes of a specific type in XPath - Stack Overflow
try this "//fruit-name". It shall find all fruitnames wherever they are in the document hierarchy.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh sorry, I misread your question originally. You may have to do:
That will get implicit types as well. You may want to filter out
any
types when you’re done (checkType#isAny()
)@HamedFathi I think you could just do:
That won’t get all the implicit types in there though.
Side note: Using
forEachDescendantAsArray
is slightly more efficient than usinggetDescendants()
becausegetDescendants()
will return parsed out token nodes.