File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -281,12 +281,16 @@ export class ScopeItemCapability {
281281 public parent ?: ScopeItemCapability ,
282282 ) { }
283283
284+ clean ( ) : void {
285+ this . deleteInvalidatedScopes ( ) ;
286+ this . cleanInvalidatedLinks ( ) ;
287+ }
288+
284289 /**
285290 * Recursively build from this node down.
286291 */
287292 build ( ) : void {
288- this . deleteInvalidatedScopes ( ) ;
289- this . cleanInvalidatedLinks ( ) ;
293+ this . clean ( ) ;
290294
291295 // Don't build self if invalidated.
292296 if ( this . isInvalidated ) {
@@ -800,7 +804,7 @@ export class ScopeItemCapability {
800804 }
801805
802806 // Add implicitly accessible names to the project scope.
803- if ( item . isPublicScope && this . project ) {
807+ if ( item . isPublicScope && this . project && this !== this . project ) {
804808 this . project . implicitDeclarations ??= new Map ( ) ;
805809 this . addItem ( this . project . implicitDeclarations , item , item . name ) ;
806810 }
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ export abstract class BaseProjectDocument {
167167 await ( new SyntaxParser ( Services . logger ) ) . parse ( token , this ) ;
168168 const projectScope = this . currentScope . project ;
169169 const buildScope = projectScope ?. isDirty ? projectScope : this . currentScope ;
170+ projectScope ?. clean ( ) ;
170171 buildScope . build ( ) ;
171172 buildScope . resolveUnused ( ) ;
172173
You can’t perform that action at this time.
0 commit comments