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

Feature request: allGeneratedPositionsFor #18

Closed
connor4312 opened this issue Oct 4, 2022 · 2 comments
Closed

Feature request: allGeneratedPositionsFor #18

connor4312 opened this issue Oct 4, 2022 · 2 comments

Comments

@connor4312
Copy link
Contributor

The source-map library has a function, allGeneratedPositionsFor, which gets all candidate positions for the given source locations. I couldn't see to find a similar function in this library.

@jridgewell
Copy link
Owner

I don't have time to implement this right now, but it should be simple to add. The core behavior is already implemented for generatedPositionFor. We'd need:

  1. Change traceSegmentInternal to return an index instead of a segment.
  2. Extract the common parts of generated segment finding into a helper
  3. Slice from the segment index until we hit a non-matching segment.

connor4312 added a commit to connor4312/trace-mapping that referenced this issue Oct 5, 2022
jridgewell pushed a commit that referenced this issue Oct 7, 2022
@jridgewell
Copy link
Owner

Closed by #19

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

No branches or pull requests

2 participants