-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Support finding references at module
in module.exports =
or export
in export =
#28221
Conversation
…rt` in `export =`
verify.singleReferenceGroup('import j = require("./j.json")', [r0, r2]); | ||
verify.referenceGroups([r1, r4], [{ definition: 'module "/j"', ranges: [r1, r4, r6] }]); | ||
verify.singleReferenceGroup('const j: {\n "x": number;\n}', [r3, r5]); | ||
verify.referenceGroups(r6, undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also show:: require("[|./j.json|]");
just like we are doing at export=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this trigger on the open brace of the json file? I don't want to just trigger it everywhere since people may be looking for references to a particular property instead.
But vscode at least doesn't use TypeScript to provide services in json files, so this wouldn't work anyway ... we can still get references when starting from a TS file though.
@sheetalkamat Please re-review |
Hey guys, trying to use a find occurrences/usages/references but it only shows me the usage in the same file, not elsewhere. How do make it works? |
Agreed, all I'm seeing is same-file references too. e.g. |
Just got into this issue again from an old project using this kind of syntax: const object = {
methode: (),
other: ()
}
module.exports = object; // Or even this one
const object = {
KEY1: 'dfdfd',
KEY2: 'sdddf'
}
module.exports = object; In intellj, this kind of find usage is able to track which other file is using the export, that would be nice to have a way to track which file use the export :) |
This problem still exists: #44832 |
Fixes microsoft/vscode#21507 (comment)