-
Notifications
You must be signed in to change notification settings - Fork 189
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]: Node.getProject() method #782
Comments
Sure. Do you want to do a PR and add it to Node? It would be very easy to do as you pointed out. I think this method should throw if the node was created with the |
Hey man, many apologies! I just realized that you commented on this issue way-back-when and I somehow missed it :X I totally would have raised that PR! Thanks for adding the method though - will def help, and much appreciated! |
@gregjacobs that's no problem as it was simple to add! I'll release this over the weekend now that TS 3.8 is out. |
Sounds good :) Thanks! |
Hey @dsherret. I've come across a couple of scenarios where it would be convenient to be able to retrieve the
Project
instance from aSourceFile
(such as to grab other source files in the project based on the givenSourceFile
's source).I've been passing in both the
Project
and theSourceFile
instances to functions that I write which need this ability, but figuring that having aSourceFile.getProject()
method would be convenient (especially when one function calls another, and it ends up being a lot of functions that need both arguments).Since this feature could be handy on any
Node
, was thinking to put this new method on that class. The method could just returnthis._context.project
?Thoughts?
Best,
Greg
The text was updated successfully, but these errors were encountered: