File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
packages/typescript-plugin/lib Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -554,13 +554,27 @@ export function resolveCompletionEntryDetails(
554554 'import ' + oldName + ' from ' ,
555555 'import ' + newName + ' from ' ,
556556 ) ;
557- // #5874
558- if ( data . __vue__autoImportSuggestions ) {
557+ }
558+ }
559+ }
560+ }
561+ // #5874
562+ if ( data ?. __vue__autoImportSuggestions ) {
563+ for ( const codeAction of details ?. codeActions ?? [ ] ) {
564+ for ( const change of codeAction . changes ) {
565+ for ( const textChange of change . textChanges ) {
566+ if ( data . __vue__componentAutoImport ) {
567+ const { oldName, newName } = data . __vue__componentAutoImport ;
559568 textChange . newText = textChange . newText . replace (
560569 'import type ' + oldName + ' from ' ,
561570 'import ' + newName + ' from ' ,
562571 ) ;
563572 }
573+ const { entryName } = data . __vue__autoImportSuggestions ;
574+ textChange . newText = textChange . newText . replace (
575+ 'import type { ' + entryName + ' } from ' ,
576+ 'import { ' + entryName + ' } from ' ,
577+ ) ;
564578 }
565579 }
566580 }
You can’t perform that action at this time.
0 commit comments