File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -67,14 +67,20 @@ export function createLanguage<T>(
6767 const sourceScript = scriptRegistry . get ( id ) ! ;
6868 if ( sourceScript . languageId !== languageId || sourceScript . associatedOnly !== associatedOnly ) {
6969 this . delete ( id ) ;
70+ triggerTargetsDirty ( sourceScript ) ;
7071 return this . set ( id , snapshot , languageId ) ;
7172 }
7273 else if ( associatedOnly ) {
73- sourceScript . snapshot = snapshot ;
74+ if ( sourceScript . snapshot !== snapshot ) {
75+ sourceScript . snapshot = snapshot ;
76+ triggerTargetsDirty ( sourceScript ) ;
77+ }
7478 }
7579 else if ( sourceScript . isAssociationDirty || sourceScript . snapshot !== snapshot ) {
76- // snapshot updated
77- sourceScript . snapshot = snapshot ;
80+ if ( sourceScript . snapshot !== snapshot ) {
81+ sourceScript . snapshot = snapshot ;
82+ triggerTargetsDirty ( sourceScript ) ;
83+ }
7884 const codegenCtx = prepareCreateVirtualCode ( sourceScript ) ;
7985 if ( sourceScript . generated ) {
8086 const { updateVirtualCode, createVirtualCode } = sourceScript . generated . languagePlugin ;
@@ -95,7 +101,6 @@ export function createLanguage<T>(
95101 return ;
96102 }
97103 }
98- triggerTargetsDirty ( sourceScript ) ;
99104 }
100105 else {
101106 // not changed
You can’t perform that action at this time.
0 commit comments