-
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
treat ambient non-aliased 'require' as commonjs 'require' #11819
Conversation
return resolveExternalModuleTypeByLiteral(<StringLiteral>node.arguments[0]); | ||
} | ||
|
||
return getReturnTypeOfSignature(signature); | ||
} | ||
|
||
function isCommonJsRequire(node: Node) { |
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.
May be we need to use this function in completions.ts to determine whether to give module names as completion list?
return resolveExternalModuleTypeByLiteral(<StringLiteral>node.arguments[0]); | ||
} | ||
|
||
return getReturnTypeOfSignature(signature); | ||
} | ||
|
||
function isCommonJsRequire(node: Node) { |
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.
May be we need to use this function in completions.ts to determine whether to give module names as completion list?
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.
+1
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.
Leave a comment
return resolveExternalModuleTypeByLiteral(<StringLiteral>node.arguments[0]); | ||
} | ||
|
||
return getReturnTypeOfSignature(signature); | ||
} | ||
|
||
function isCommonJsRequire(node: Node) { |
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.
May be we need to use this function in completions.ts to determine whether to give module names as completion list?
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.
certainly but it is not related to the original issue so I'd put it into different PR
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.
We should make sure completion is also behaving the same way.
fixes #11752