@@ -43,8 +43,8 @@ extension SyntaxProtocol {
43
43
/// declaration, followed by the first function name, and then the second function name,
44
44
/// in this exact order. The constant declaration within the function body is omitted
45
45
/// due to the ordering rules that prioritize visibility within the function body.
46
- @_spi ( Experimental) public func lookup( for name: String ? , with config : [ LookupConfig ] = [ ] ) -> [ LookupResult ] {
47
- scope? . lookup ( for: name, at: self , with: config ) ?? [ ]
46
+ @_spi ( Experimental) public func lookup( for name: String ? , with configArr : [ LookupConfig ] = [ ] ) -> [ LookupResult ] {
47
+ scope? . lookup ( for: name, at: self , with: LookupConfigDictionary ( from : configArr ) ) ?? [ ]
48
48
}
49
49
}
50
50
@@ -55,7 +55,7 @@ extension SyntaxProtocol {
55
55
var introducedNames : [ LookupName ] { get }
56
56
/// Finds all declarations `name` refers to. `at` specifies the node lookup was triggered with.
57
57
/// If `name` set to `nil`, returns all available names at the given node.
58
- func lookup( for name: String ? , at syntax: SyntaxProtocol , with config : [ LookupConfig ] ) -> [ LookupResult ]
58
+ func lookup( for name: String ? , at syntax: SyntaxProtocol , with configDict : LookupConfigDictionary ) -> [ LookupResult ]
59
59
}
60
60
61
61
@_spi ( Experimental) extension ScopeSyntax {
@@ -66,8 +66,8 @@ extension SyntaxProtocol {
66
66
/// Returns `LookupResult` of all names introduced in this scope that `name`
67
67
/// refers to and is accessible at given syntax node then passes lookup to the parent.
68
68
/// If `name` set to `nil`, returns all available names at the given node.
69
- public func lookup( for name: String ? , at syntax: SyntaxProtocol , with config : [ LookupConfig ] ) -> [ LookupResult ] {
70
- defaultLookupImplementation ( for: name, at: syntax, with: config )
69
+ public func lookup( for name: String ? , at syntax: SyntaxProtocol , with configDict : LookupConfigDictionary ) -> [ LookupResult ] {
70
+ defaultLookupImplementation ( for: name, at: syntax, with: configDict )
71
71
}
72
72
73
73
/// Returns `LookupResult` of all names introduced in this scope that `name`
@@ -76,7 +76,7 @@ extension SyntaxProtocol {
76
76
func defaultLookupImplementation(
77
77
for name: String ? ,
78
78
at syntax: SyntaxProtocol ,
79
- with config : [ LookupConfig ]
79
+ with configDict : LookupConfigDictionary
80
80
) -> [ LookupResult ] {
81
81
let filteredNames =
82
82
introducedNames
@@ -85,18 +85,18 @@ extension SyntaxProtocol {
85
85
}
86
86
87
87
if filteredNames. isEmpty {
88
- return lookupInParent ( for: name, at: syntax, with: config )
88
+ return lookupInParent ( for: name, at: syntax, with: configDict )
89
89
} else {
90
- return [ . fromScope( self , withNames: filteredNames) ] + lookupInParent( for: name, at: syntax, with: config )
90
+ return [ . fromScope( self , withNames: filteredNames) ] + lookupInParent( for: name, at: syntax, with: configDict )
91
91
}
92
92
}
93
93
94
94
/// Looks up in parent scope.
95
95
func lookupInParent(
96
96
for name: String ? ,
97
97
at syntax: SyntaxProtocol ,
98
- with config : [ LookupConfig ]
98
+ with configDict : LookupConfigDictionary
99
99
) -> [ LookupResult ] {
100
- parentScope? . lookup ( for: name, at: syntax, with: config ) ?? [ ]
100
+ parentScope? . lookup ( for: name, at: syntax, with: configDict ) ?? [ ]
101
101
}
102
102
}
0 commit comments