@@ -60,8 +60,7 @@ export function createVueLanguagePlugin<T>(
6060 createVirtualCode ( scriptId , languageId , snapshot ) {
6161 const fileName = asFileName ( scriptId ) ;
6262 if ( plugins . some ( plugin => plugin . isValidFile ?.( fileName , languageId ) ) ) {
63- const codeKey = getFileRegistryKey ( scriptId , fileName ) ;
64- const code = fileRegistry . get ( codeKey ) ;
63+ const code = fileRegistry . get ( String ( scriptId ) ) ;
6564 if ( code ) {
6665 code . update ( snapshot ) ;
6766 return code ;
@@ -75,7 +74,7 @@ export function createVueLanguagePlugin<T>(
7574 plugins ,
7675 ts ,
7776 ) ;
78- fileRegistry . set ( codeKey , code ) ;
77+ fileRegistry . set ( String ( scriptId ) , code ) ;
7978 return code ;
8079 }
8180 }
@@ -85,8 +84,7 @@ export function createVueLanguagePlugin<T>(
8584 return code ;
8685 } ,
8786 disposeVirtualCode ( scriptId ) {
88- const fileName = asFileName ( scriptId ) ;
89- fileRegistry . delete ( getFileRegistryKey ( scriptId , fileName ) ) ;
87+ fileRegistry . delete ( String ( scriptId ) ) ;
9088 } ,
9189 typescript : {
9290 extraFileExtensions : getAllExtensions ( vueCompilerOptions )
@@ -126,13 +124,3 @@ export function getAllExtensions(options: VueCompilerOptions) {
126124 ] as const ) . flatMap ( key => options [ key ] ) ) ,
127125 ] ;
128126}
129-
130- function getFileRegistryKey < T > ( scriptId : T , fileName : string ) {
131- if ( typeof scriptId === 'object' && scriptId ) {
132- const scheme = ( scriptId as { scheme ?: string } ) . scheme ;
133- if ( scheme && scheme !== 'file' ) {
134- return `${ scheme } :${ fileName } ` ;
135- }
136- }
137- return fileName ;
138- }
0 commit comments