Skip to content

Find references of a module by filename - #41805

Merged
Andrew Branch (andrewbranch) merged 20 commits into
microsoft:masterfrom
andrewbranch:feature/39489
Dec 11, 2020
Merged

Andrew Branch (andrewbranch) merged 20 commits into
microsoft:masterfrom
andrewbranch:feature/39489

Conversation

@andrewbranch

@andrewbranch Andrew Branch (andrewbranch) commented Dec 3, 2020 •

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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 Sheetal Nandi (@sheetalkamat), Andrew Casey (@amcasey), Matt Bierner (@mjbvz), Mine Starks (@minestarks) for you. Feel free to loop in other consumers/maintainers if necessary

Comment thread src/server/session.ts Resolved
Comment thread src/compiler/program.ts Resolved
@DanielRosenwasser

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

Comment thread src/services/findAllReferences.ts Resolved
Comment thread src/services/utilities.ts Resolved
@DanielRosenwasser

Copy link
Copy Markdown
Member

Assign me and I’ll get it in.

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

Comment thread src/services/findAllReferences.ts Resolved
Comment thread src/server/session.ts Resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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