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.

add `node.getAllAncestorsAtRange` method

See original GitHub issue

Do you want to request a feature or report a bug?

Feature.

What’s the current behavior?

Right now you have to manually iterate the blocks and look up each of their ancestors, and then make sure you convert it to a set to remove duplicates.

What’s the expected behavior?

It would be nice to have a getAllAncestorsAtRange method that returned all of the ancestors in the range exactly once, so you can more easily find wrapping parents of certain types.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Dundercovercommented, Nov 4, 2018

Sounds good @ianstormtaylor, I’ll jump on this next.

The getContainedXAtRange methods do definitely feel like they could be useful for a lot of use cases. I do think though that we should create a separate issue for those to not spread this issue too wide.

1reaction
Dundercovercommented, Nov 3, 2018

Sounds good @ianstormtaylor, lets go with Root/Leaf then.

For the All, I think it works either way (I think I’m leaning more towards without the All tbh) but just so we could deprecate the existing methods (getBlocksAtRange, etc). If we prefer without the All, we could remove it later with another deprecation period.

I could also skip any changes to the current API methods and just add the getNodesAtRange for now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node (jsoup Java HTML Parser 1.15.3 API)
To get an absolute URL from an attribute that may be a relative URL, prefix the key with abs , which is a...
Read more >
Adding Nodes to the DOM with JavaScript - YouTube
In this excerpt from the JavaScript for WordPress Master Course, educator, Zac Gordon, walks through how to get up and running with adding...
Read more >
Python & Nodes in Houdini || Exploring Houdini - YouTube
Using Python, you can navigate all the nodes in your project. You can also create new nodes, change parameters, and wire nodes together...
Read more >
Using the Node-Red Function Node- Beginners Guide
The function node is used to run JavaScript code. The function node accepts a msg object as input and can return 0 or...
Read more >
Writing Node.js in Steps - Pipedream
You can add any Node.js code in the editor that appears. For example, try: ... When the step runs, Pipedream executes the run...
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