Ts-morph: Add SourceFile#getReferencedSourceFiles() and similar methods

Created on 10 Aug 2019  路  5Comments  路  Source: dsherret/ts-morph

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).

enhancement navigation

Most helpful comment

@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)

All 5 comments

@dsherret

Any progress on this?
Any timeline?

@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)

@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.

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.

Ok, this is released now in 4.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CarstenLeue picture CarstenLeue  路  4Comments

claudv picture claudv  路  3Comments

dyatko picture dyatko  路  3Comments

HamedFathi picture HamedFathi  路  3Comments

gregjacobs picture gregjacobs  路  4Comments