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

Ancestor directories should be lazily loaded #268

Closed
dsherret opened this issue Mar 7, 2018 · 0 comments
Closed

Ancestor directories should be lazily loaded #268

dsherret opened this issue Mar 7, 2018 · 0 comments

Comments

@dsherret
Copy link
Owner

dsherret commented Mar 7, 2018

For example, the following code:

const sourceFile = project.createSourceFile("V:/test/sub/dir/mySourceFile.ts");
const directory = sourceFile.getDirectory();
const testSubDir = directory.getParent();
const testDir = project.getSourceFile("V:/test/");

...currently returns undefined for both testSubDir and testDir. It would be good if these were lazily loaded upon request so as to not affect the behaviour of .getRootDirectories() until they're requested.

@dsherret dsherret changed the title Adding a directory should populate all ancestor directories Requesting an ancestor directory should not return undefined Mar 25, 2018
@dsherret dsherret changed the title Requesting an ancestor directory should not return undefined Ancestor directories should be lazily loaded Mar 25, 2018
dsherret added a commit that referenced this issue Mar 25, 2018
BREAKING CHANGE: Requesting an ancestor directory will no longer return undefined if it is an ancestor of a "root" directory.
@dsherret dsherret added this to the Version 10 milestone Mar 25, 2018
dsherret added a commit that referenced this issue May 14, 2019
BREAKING CHANGE: Requesting an ancestor directory will no longer return undefined if it is an ancestor of a "root" directory.
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

1 participant