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

Add SourceFile#getReferencedSourceFiles() and similar methods #680

Closed
dsherret opened this issue Aug 10, 2019 · 5 comments
Closed

Add SourceFile#getReferencedSourceFiles() and similar methods #680

dsherret opened this issue Aug 10, 2019 · 5 comments

Comments

@dsherret
Copy link
Owner

From #679.

There currently exists the following methods:

  • getReferencingSourceFiles() - Gets any source files that reference this source file.
  • getReferencingNodesInOtherSourceFiles()
  • getReferencingLiteralsInOtherSourceFiles()

...but the opposite of this doesn't exist (ex. getReferencedSourceFiles()). This is just hidden internally and could be easily exposed.

While doing this, #getReferencedFiles should probably be renamed to getFileReference() to prevent confusion (even though the compiler node has a referencedFiles property... not worth keeping the name because it's probably a rarely used method that would be easy to find on the new method name).

@dsherret dsherret changed the title Add SourceFile#getReferencedSourceFiles() and similar methods Add SourceFile#getReferencedSourceFiles() and similar methods Aug 10, 2019
@HamedFathi
Copy link

@dsherret

Any progress on this?
Any timeline?

@dsherret dsherret added this to the Version 4.0 milestone Sep 1, 2019
@dsherret
Copy link
Owner Author

dsherret commented Sep 1, 2019

@HamedFathi I've been super busy over the past few weeks with some personal stuff. I'm going to get back at this very soon (probably today or tomorrow I will finish this one and try to do a 4.0 release very soon to fix some issues with TS 3.6)

@HamedFathi
Copy link

HamedFathi commented Sep 1, 2019

@dsherret

I just say you are an amazing man. thank you so much.
I did something with ts-morph. Madeline

I check comments on some nodes (Declaration nodes) for calculating document coverage.

dsherret added a commit that referenced this issue Sep 2, 2019
…ReferenceDirectives()`.

BREAKING CHANGE: `SourceFile#getReferencedFiles()` is now `getPathReferenceDirectives()`.

This was done to prevent confusion with upcoming methods in #680. The name was chosen because it is similar to the methods `getTypeReferenceDirectives()` and `getLibReferenceDirectives()`.
dsherret added a commit that referenced this issue Sep 2, 2019
…eferencingOtherSourceFiles()`, and `#getLiteralsReferencingOtherSourceFiles()`.
@dsherret
Copy link
Owner Author

dsherret commented Sep 2, 2019

This is implemented and will be in v4.0. The corresponding methods are:

  • #getReferencingSourceFiles()

  • #getReferencedSourceFiles()

  • #getReferencingNodesInOtherSourceFiles()

  • #getNodesReferencingOtherSourceFiles()

  • #getReferencingLiteralsInOtherSourceFiles()

  • #getLiteralsReferencingOtherSourceFiles()

@HamedFathi that's cool! The coverage feature is neat.

@dsherret dsherret closed this as completed Sep 2, 2019
@dsherret
Copy link
Owner Author

dsherret commented Sep 3, 2019

Ok, this is released now in 4.0.

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

No branches or pull requests

2 participants