@@ -64,7 +64,6 @@ import {
64
64
Expression ,
65
65
ExpressionWithTypeArguments ,
66
66
factory ,
67
- fileContainsPackageImport ,
68
67
filter ,
69
68
find ,
70
69
findAncestor ,
@@ -175,7 +174,7 @@ import {
175
174
isIdentifierPart ,
176
175
isIdentifierStart ,
177
176
isIdentifierText ,
178
- isImportableFile ,
177
+ isImportable ,
179
178
isImportAttributes ,
180
179
isImportDeclaration ,
181
180
isImportEqualsDeclaration ,
@@ -274,7 +273,6 @@ import {
274
273
JSDocTypedefTag ,
275
274
JSDocTypeExpression ,
276
275
JSDocTypeTag ,
277
- JsTyping ,
278
276
JsxAttribute ,
279
277
JsxAttributes ,
280
278
JsxClosingElement ,
@@ -344,7 +342,6 @@ import {
344
342
SemanticMeaning ,
345
343
setEmitFlags ,
346
344
setSnippetElement ,
347
- shouldUseUriStyleNodeCoreModules ,
348
345
SignatureHelp ,
349
346
SignatureKind ,
350
347
singleElementArray ,
@@ -4221,19 +4218,11 @@ function getCompletionData(
4221
4218
) ;
4222
4219
4223
4220
function isImportableExportInfo ( info : SymbolExportInfo ) {
4224
- const moduleFile = tryCast ( info . moduleSymbol . valueDeclaration , isSourceFile ) ;
4225
- if ( ! moduleFile ) {
4226
- const moduleName = stripQuotes ( info . moduleSymbol . name ) ;
4227
- if ( JsTyping . nodeCoreModules . has ( moduleName ) && startsWith ( moduleName , "node:" ) !== shouldUseUriStyleNodeCoreModules ( sourceFile , program ) ) {
4228
- return false ;
4229
- }
4230
- return ( packageJsonFilter ?. allowsImportingAmbientModule ( info . moduleSymbol , getModuleSpecifierResolutionHost ( info . isFromPackageJson ) ) ?? true )
4231
- || fileContainsPackageImport ( sourceFile , moduleName ) ;
4232
- }
4233
- return isImportableFile (
4221
+ return isImportable (
4234
4222
info . isFromPackageJson ? packageJsonAutoImportProvider ! : program ,
4235
4223
sourceFile ,
4236
- moduleFile ,
4224
+ tryCast ( info . moduleSymbol . valueDeclaration , isSourceFile ) ,
4225
+ info . moduleSymbol ,
4237
4226
preferences ,
4238
4227
packageJsonFilter ,
4239
4228
getModuleSpecifierResolutionHost ( info . isFromPackageJson ) ,
@@ -4371,7 +4360,7 @@ function getCompletionData(
4371
4360
// dprint-ignore
4372
4361
switch ( tokenKind ) {
4373
4362
case SyntaxKind . CommaToken :
4374
- switch ( containingNodeKind ) {
4363
+ switch ( containingNodeKind ) {
4375
4364
case SyntaxKind . CallExpression : // func( a, |
4376
4365
case SyntaxKind . NewExpression : { // new C(a, |
4377
4366
const expression = ( contextToken . parent as CallExpression | NewExpression ) . expression ;
@@ -4454,7 +4443,7 @@ function getCompletionData(
4454
4443
}
4455
4444
4456
4445
case SyntaxKind . TemplateHead :
4457
- return {
4446
+ return {
4458
4447
defaultCommitCharacters : allCommitCharacters ,
4459
4448
isNewIdentifierLocation : containingNodeKind === SyntaxKind . TemplateExpression // `aa ${|
4460
4449
} ;
0 commit comments