FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fixCannotFindModule: Special handling for node core modules like "fs" · Pull Request #23807 · microsoft/TypeScript · GitHub

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

Merged
2 commits merged into
masterfrom
codeFixCannotFindModule_nodeCoreModules
May 1, 2018
Merged

fixCannotFindModule: Special handling for node core modules like "fs"#23807
2 commits merged into
masterfrom
codeFixCannotFindModule_nodeCoreModules

Conversation

Copy link
Copy Markdown

Fixes #23224

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Given that we arent using getTypesPackageName remove it ?

Sheetal Nandi (sheetalkamat) May 1, 2018
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

ghost merged commit a1f9a4f into master May 1, 2018
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL