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

getReferencedSourceFiles does not return paths from custom path mapping #1188

Open
rtorr opened this issue Aug 11, 2021 · 3 comments
Open

getReferencedSourceFiles does not return paths from custom path mapping #1188

rtorr opened this issue Aug 11, 2021 · 3 comments

Comments

@rtorr
Copy link

rtorr commented Aug 11, 2021

Is your feature request related to a problem? Please describe.

const c = project.getSourceFiles().map((a) => a.getReferencedSourceFiles());

Will only return relative file references. For example https://github.com/microsoft/vscode/blob/main/src/tsconfig.base.json#L16, and files imported using this custom path will not show in results.

The file I am testing is https://github.com/microsoft/vscode/blob/main/src/vs/editor/editor.main.ts, which will have no results.

Describe the solution you'd like

Return all references.

Describe alternatives you've considered

I don't know of a good alternative.

Side note: I am trying to navigate from one source file to another based on import paths. If someone has a good solution here, I am all ears.

@stevoland
Copy link

For anybody hitting this issue: you can patch

return fileOrDirPath;

to be something like

return fileOrDirPath.replace('/node_modules/vs/', '/vs/');

@EladBezalel
Copy link

I'm also interested in this

@ivanbenavidesvt
Copy link

I am interested on this feature too

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

5 participants