Skip to content

Find references of a module by filename #41805

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

Merged
merged 20 commits into from
Dec 11, 2020

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Dec 3, 2020

Does the same thing as running find-all-references on a module specifier, but with a filename of a module instead of a module specifier node.

Also improves find-all-references on module specifiers that resolve to scripts—previously it would fall back to finding equal string literals; now it uses refFileMap to find other actual references to the file.

Also fixes some bugs in the find-all-refs baseline format (hence the unrelated baseline updates)

Closes #39489

@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Dec 3, 2020
@DanielRosenwasser
Copy link
Member

Also improves find-all-references on module specifiers that resolve to scripts

🤩 does that mean that go-to-definition will work on a script file?

@andrewbranch
Copy link
Member Author

Not right now, but go-to-definition could borrow some of this code to achieve that. @DanielRosenwasser is there an open issue for that? Assign me and I’ll get it in.

@DanielRosenwasser
Copy link
Member

Assign me and I’ll get it in.

Sweet, it would be very nice to make this work: #41861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tsserver] api to find references to a file
5 participants