Skip to content

Commit 45e994f

Browse files
committed
fix(typescript-plugin): handle type imports in component auto-import
close #5874
1 parent 0722817 commit 45e994f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/typescript-plugin/lib/common.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,13 @@ export function resolveCompletionEntryDetails(
537537
'import ' + oldName + ' from ',
538538
'import ' + newName + ' from ',
539539
);
540+
// #5874
541+
if (data.__vue__autoImportSuggestions) {
542+
textChange.newText = textChange.newText.replace(
543+
'import type ' + oldName + ' from ',
544+
'import ' + newName + ' from ',
545+
);
546+
}
540547
}
541548
}
542549
}

0 commit comments

Comments
 (0)