Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
2 commits merged into
mastermicrosoft/TypeScript:masterfrom
codeFixCannotFindModule_nodeCoreModulesmicrosoft/TypeScript:codeFixCannotFindModule_nodeCoreModulesCopy head branch name to clipboard
May 1, 2018
Merged

fixCannotFindModule: Special handling for node core modules like "fs"#23807
2 commits merged into
mastermicrosoft/TypeScript:masterfrom
codeFixCannotFindModule_nodeCoreModulesmicrosoft/TypeScript:codeFixCannotFindModule_nodeCoreModulesCopy head branch name to clipboard

Conversation

@ghost

@ghost ghost commented May 1, 2018

Copy link
Copy Markdown

Fixes #23224

@ghost
ghost requested review from DanielRosenwasser and mhegazy May 1, 2018 19:56
function getTypesPackageNameToInstall(host: LanguageServiceHost, sourceFile: SourceFile, pos: number, diagCode: number): string | undefined {
const moduleName = cast(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isStringLiteral).text;
const { packageName } = getPackageName(moduleName);
return host.isKnownTypesPackageName(packageName) ? getTypesPackageName(packageName) : undefined;

Copy link
Copy Markdown
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 ?

@sheetalkamat sheetalkamat May 1, 2018

Copy link
Copy Markdown
Member

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.