@@ -16,8 +16,8 @@ extension SyntaxProtocol {
1616 /// Returns all names that `for` refers to at this syntax node.
1717 /// Optional configuration can be passed as `config` to customize the lookup behavior.
1818 ///
19- /// - Returns: An array of `LookupResult` for `name ` at this syntax node,
20- /// ordered by visibility. If `name ` is set to `nil`, returns all available names ordered by visibility.
19+ /// - Returns: An array of `LookupResult` for `identifier ` at this syntax node,
20+ /// ordered by visibility. If `identifier ` is set to `nil`, returns all available names ordered by visibility.
2121 /// The order is from the innermost to the outermost scope,
2222 /// and within each result, names are ordered by their introduction
2323 /// in the source code.
@@ -44,10 +44,10 @@ extension SyntaxProtocol {
4444 /// in this exact order. The constant declaration within the function body is omitted
4545 /// due to the ordering rules that prioritize visibility within the function body.
4646 @_spi ( Experimental) public func lookup(
47- for name : String ? ,
47+ for identifier : Identifier ? ,
4848 with config: LookupConfig = LookupConfig ( )
4949 ) -> [ LookupResult ] {
50- scope? . lookup ( for: name , at: self , with: config, state: LookupState ( ) ) ?? [ ]
50+ scope? . lookup ( for: identifier , at: self , with: config, state: LookupState ( ) ) ?? [ ]
5151 }
5252}
5353
@@ -59,7 +59,7 @@ extension SyntaxProtocol {
5959 /// Finds all declarations `name` refers to. `syntax` specifies the node lookup was triggered with.
6060 /// If `name` set to `nil`, returns all available names at the given node.
6161 func lookup(
62- for name : String ? ,
62+ for identifier : Identifier ? ,
6363 at syntax: SyntaxProtocol ,
6464 with config: LookupConfig ,
6565 state: LookupState
@@ -75,19 +75,19 @@ extension SyntaxProtocol {
7575 /// refers to and is accessible at given syntax node then passes lookup to the parent.
7676 /// If `name` set to `nil`, returns all available names at the given node.
7777 @_spi ( Experimental) public func lookup(
78- for name : String ? ,
78+ for identifier : Identifier ? ,
7979 at syntax: SyntaxProtocol ,
8080 with config: LookupConfig ,
8181 state: LookupState
8282 ) -> [ LookupResult ] {
83- defaultLookupImplementation ( for: name , at: syntax, with: config, state: state)
83+ defaultLookupImplementation ( for: identifier , at: syntax, with: config, state: state)
8484 }
8585
8686 /// Returns `LookupResult` of all names introduced in this scope that `name`
8787 /// refers to and is accessible at given syntax node then passes lookup to the parent.
8888 /// If `name` set to `nil`, returns all available names at the given node.
8989 func defaultLookupImplementation(
90- for name : String ? ,
90+ for identifier : Identifier ? ,
9191 at syntax: SyntaxProtocol ,
9292 with config: LookupConfig ,
9393 state: LookupState
@@ -99,21 +99,21 @@ extension SyntaxProtocol {
9999 }
100100
101101 if filteredNames. isEmpty {
102- return lookupInParent ( for: name , at: syntax, with: config, state: state)
102+ return lookupInParent ( for: identifier , at: syntax, with: config, state: state)
103103 } else {
104104 return [ . fromScope( self , withNames: filteredNames) ]
105- + lookupInParent( for: name , at: syntax, with: config, state: state)
105+ + lookupInParent( for: identifier , at: syntax, with: config, state: state)
106106 }
107107 }
108108
109109 /// Looks up in parent scope.
110110 func lookupInParent(
111- for name : String ? ,
111+ for identifier : Identifier ? ,
112112 at syntax: SyntaxProtocol ,
113113 with config: LookupConfig ,
114114 state: LookupState
115115 ) -> [ LookupResult ] {
116- parentScope? . lookup ( for: name , at: syntax, with: config, state: state) ?? [ ]
116+ parentScope? . lookup ( for: identifier , at: syntax, with: config, state: state) ?? [ ]
117117 }
118118
119119 func checkName( _ name: String ? , refersTo introducedName: LookupName , at syntax: SyntaxProtocol ) -> Bool {
0 commit comments