Skip to content

Commit 07aa269

Browse files
committed
Add missing cache parameters to lookup calls.
1 parent 047d95b commit 07aa269

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Sources/SwiftLexicalLookup/Scopes/NominalTypeDeclSyntax.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ extension NominalTypeDeclSyntax {
4444
} else if name.range.contains(lookUpPosition) || genericWhereClause?.range.contains(lookUpPosition) ?? false {
4545
return lookupInParent(identifier, at: lookUpPosition, with: config, cache: cache)
4646
} else {
47-
return [.lookForMembers(in: Syntax(self))] + lookupInParent(identifier, at: lookUpPosition, with: config)
47+
return [.lookForMembers(in: Syntax(self))]
48+
+ lookupInParent(identifier, at: lookUpPosition, with: config, cache: cache)
4849
}
4950
}
5051
}

Sources/SwiftLexicalLookup/Scopes/ScopeImplementations.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,21 +437,26 @@ import SwiftSyntax
437437

438438
return LookupResult.getResultArray(for: self, withNames: implicitSelf)
439439
+ [.lookForGenericParameters(of: self)]
440-
+ defaultLookupImplementation(identifier, at: lookUpPosition, with: config, propagateToParent: false)
441-
+ [.lookForMembers(in: Syntax(self))]
442-
+ lookupInParent(identifier, at: lookUpPosition, with: config)
440+
+ defaultLookupImplementation(
441+
identifier,
442+
at: lookUpPosition,
443+
with: config,
444+
cache: cache,
445+
propagateToParent: false
446+
) + [.lookForMembers(in: Syntax(self))]
447+
+ lookupInParent(identifier, at: lookUpPosition, with: config, cache: cache)
443448
} else if !extendedType.range.contains(lookUpPosition), let genericWhereClause {
444449
if genericWhereClause.range.contains(lookUpPosition) {
445450
return [.lookForGenericParameters(of: self)] + [.lookForMembers(in: Syntax(self))]
446-
+ defaultLookupImplementation(identifier, at: lookUpPosition, with: config)
451+
+ defaultLookupImplementation(identifier, at: lookUpPosition, with: config, cache: cache)
447452
}
448453

449454
return [.lookForGenericParameters(of: self)]
450-
+ defaultLookupImplementation(identifier, at: lookUpPosition, with: config)
455+
+ defaultLookupImplementation(identifier, at: lookUpPosition, with: config, cache: cache)
451456
}
452457

453458
return [.lookForGenericParameters(of: self)]
454-
+ lookupInParent(identifier, at: lookUpPosition, with: config)
459+
+ lookupInParent(identifier, at: lookUpPosition, with: config, cache: cache)
455460
}
456461
}
457462

0 commit comments

Comments
 (0)