You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Import hints not working when using export default after class definition #19115
Andy (Andrewkraft) (@Andy-MS), I'm told you've been working in this area and might have some thoughts on what these default export helpers should do (i.e. how to divide the fix between the compiler and the services).
I see four other callers to getLocalSymbolForExportDefault and they basically all just want the local name of the default export. Possibly a helper returning that value is in order.
The change in findAllReferences.ts broke some tests. I'm still investigating. The failures looked like regressions, which makes me think that we might want to go the other way and pull out the default-export handling that's already there (because it's not clear why that one form would be special).
For findAllReferences, I tested all three implementations (current, special case all default exports, special case no default exports) against all three types of default exports and the current implementation had the best behavior. Presumably, this means that the other two types of default exports (i.e. not handled by getLocalSymbolForExportDefault) are handled downstream.
Activity
mjbvz commentedon Oct 11, 2017
Confirmed this happens with TypeScript 2.5.3 and 2.6.0-20171011
amcasey commentedon Jan 3, 2018
isExportDefaultSymbolis returning false because the declaration has nodefaultmodifier.amcasey commentedon Jan 4, 2018
Related case:
export { Test as default };amcasey commentedon Jan 4, 2018
Andy (Andrewkraft) (@Andy-MS), I'm told you've been working in this area and might have some thoughts on what these default export helpers should do (i.e. how to divide the fix between the compiler and the services).
amcasey commentedon Jan 4, 2018
Here's a hackish solution to the cases we've identified so far. https://github.com/amcasey/TypeScript/tree/Scratch19115
amcasey commentedon Jan 4, 2018
I see four other callers to
getLocalSymbolForExportDefaultand they basically all just want the local name of the default export. Possibly a helper returning that value is in order.amcasey commentedon Jan 4, 2018
Andy (Andrewkraft) (@Andy-MS) so don't update the other callers?
amcasey commentedon Jan 4, 2018
The change in
findAllReferences.tsbroke some tests. I'm still investigating. The failures looked like regressions, which makes me think that we might want to go the other way and pull out the default-export handling that's already there (because it's not clear why that one form would be special).amcasey commentedon Jan 4, 2018
As far as I can tell, the occurrence in
services/utilities.tsdoesn't matter - it's only used by rename and you can't renamedefault.amcasey commentedon Jan 4, 2018
For findAllReferences, I tested all three implementations (current, special case all default exports, special case no default exports) against all three types of default exports and the current implementation had the best behavior. Presumably, this means that the other two types of default exports (i.e. not handled by
getLocalSymbolForExportDefault) are handled downstream.Handle different default export forms the same way in import code fixes
methyl commentedon Jan 9, 2018
Thanks a lot Andrew Casey (@amcasey), excellent work!