@@ -174,7 +174,7 @@ namespace ts.codefix {
174
174
if ( localSymbol && localSymbol . escapedName === name && checkSymbolHasMeaning ( localSymbol , currentTokenMeaning ) ) {
175
175
// check if this symbol is already used
176
176
const symbolId = getUniqueSymbolId ( localSymbol ) ;
177
- symbolIdActionMap . addActions ( symbolId , getCodeActionForImport ( moduleSymbol , name , /*isDefault */ true ) ) ;
177
+ symbolIdActionMap . addActions ( symbolId , getCodeActionForImport ( moduleSymbol , name , /*isNamespaceImport */ true ) ) ;
178
178
}
179
179
}
180
180
@@ -562,8 +562,8 @@ namespace ts.codefix {
562
562
563
563
function getNodeModulePathParts ( fullPath : string ) {
564
564
// If fullPath can't be valid module file within node_modules, returns undefined.
565
- // Example of expected pattern: /base/path/node_modules/[otherpackage/node_modules/]package/[subdirectory/]file.js
566
- // Returns indices: ^ ^ ^ ^
565
+ // Example of expected pattern: /base/path/node_modules/[@scope / otherpackage/ @otherscope /node_modules/]package/[subdirectory/]file.js
566
+ // Returns indices: ^ ^ ^ ^
567
567
568
568
let topLevelNodeModulesIndex = 0 ;
569
569
let topLevelPackageNameIndex = 0 ;
@@ -573,6 +573,7 @@ namespace ts.codefix {
573
573
const enum States {
574
574
BeforeNodeModules ,
575
575
NodeModules ,
576
+ Scope ,
576
577
PackageContent
577
578
}
578
579
@@ -592,8 +593,14 @@ namespace ts.codefix {
592
593
}
593
594
break ;
594
595
case States . NodeModules :
595
- packageRootIndex = partEnd ;
596
- state = States . PackageContent ;
596
+ case States . Scope :
597
+ if ( state === States . NodeModules && fullPath . charAt ( partStart + 1 ) === "@" ) {
598
+ state = States . Scope ;
599
+ }
600
+ else {
601
+ packageRootIndex = partEnd ;
602
+ state = States . PackageContent ;
603
+ }
597
604
break ;
598
605
case States . PackageContent :
599
606
if ( fullPath . indexOf ( "/node_modules/" , partStart ) === partStart ) {
0 commit comments