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

fixCannotFindModule: Special handling for node core modules like "fs" #23807

Merged
2 commits merged into from
May 1, 2018

Conversation

ghost
Copy link

@ghost ghost commented May 1, 2018

Fixes #23224

@ghost ghost requested review from DanielRosenwasser and mhegazy May 1, 2018 19:56
const moduleName = cast(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isStringLiteral).text;
const { packageName } = getPackageName(moduleName);
return host.isKnownTypesPackageName(packageName) ? getTypesPackageName(packageName) : undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we arent using getTypesPackageName remove it ?

Copy link
Member

@sheetalkamat sheetalkamat May 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i see you moved that later, but dont cant you just make it @types/node here and getTypesPackageName(packageName) in else branch instead ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ghost ghost merged commit a1f9a4f into master May 1, 2018
@ghost ghost deleted the codeFixCannotFindModule_nodeCoreModules branch May 1, 2018 21:33
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants