Add getPosAtLineNumber by HoldYourWaffle · Pull Request #893 · dsherret/ts-morph · GitHub
Skip to content

Add getPosAtLineNumber - #893

Open
HoldYourWaffle wants to merge 1 commit into
dsherret:latestfrom
HeldMyWaffles:pos-transformations
Open

HoldYourWaffle wants to merge 1 commit into
dsherret:latestfrom
HeldMyWaffles:pos-transformations

Conversation

@HoldYourWaffle

Copy link
Copy Markdown
Contributor

I have never encountered as many off-by-one-ish errors as I have today...
However, as far as I can tell this function is now working properly 😄

I also changed a comment somewhere to be more clear about what is 1-indexed.

Closes #891.

@Gerrit0

Gerrit0 commented Dec 6, 2020

Copy link
Copy Markdown
Contributor

@dsherret

dsherret commented Dec 6, 2020

Copy link
Copy Markdown
Owner

Thanks @Gerrit0 for that suggestion! I didn't know about that.

@HoldYourWaffle what do you think about updating this PR to use that API? It might be nice if it caches stuff for performance and reduces allocations. I think it might be 0-indexed, but ts-morph is 1-indexed.

@HoldYourWaffle

HoldYourWaffle commented Dec 7, 2020 •

Copy link
Copy Markdown
Contributor Author

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Get node at (line, col)

3 participants