@@ -146,20 +146,20 @@ fn class_field_through_function_parameter() {
146146 // definition of `__main__` module
147147 "<__main__,%1> ($1) [root] -> [main.py(0) definition __main__] <%1> ($1)" ,
148148 // reference to `a` in import statement
149- "<%1> () [main.py(17) reference a] -> [root] <a,%1> ()" ,
149+ "<%1> ($1 ) [main.py(17) reference a] -> [root] <a,%1> ($1 )" ,
150150 // `from a import *` means we can rewrite any lookup of `__main__.*` → `a.*`
151151 "<__main__.,%1> ($1) [root] -> [root] <a.,%1> ($1)" ,
152152 // reference to `b` in import statement
153- "<%1> () [main.py(15) reference b] -> [root] <b,%1> ()" ,
153+ "<%1> ($1 ) [main.py(15) reference b] -> [root] <b,%1> ($1 )" ,
154154 // `from b import *` means we can rewrite any lookup of `__main__.*` → `b.*`
155155 "<__main__.,%1> ($1) [root] -> [root] <b.,%1> ($1)" ,
156156 // we can look for every reference in either `a` or `b`
157- "<%1> () [main.py(9) reference A] -> [root] <a.A,%1> ()" ,
158- "<%1> () [main.py(9) reference A] -> [root] <b.A,%1> ()" ,
159- "<%1> () [main.py(10) reference bar] -> [root] <a.foo()/([main.py(7)]).bar,%1> ()" ,
160- "<%1> () [main.py(10) reference bar] -> [root] <b.foo()/([main.py(7)]).bar,%1> ()" ,
161- "<%1> () [main.py(13) reference foo] -> [root] <a.foo,%1> ()" ,
162- "<%1> () [main.py(13) reference foo] -> [root] <b.foo,%1> ()" ,
157+ "<%1> ($1 ) [main.py(9) reference A] -> [root] <a.A,%1> ($1 )" ,
158+ "<%1> ($1 ) [main.py(9) reference A] -> [root] <b.A,%1> ($1 )" ,
159+ "<%1> ($1 ) [main.py(10) reference bar] -> [root] <a.foo()/([main.py(7)],$1 ).bar,%1> ($1 )" ,
160+ "<%1> ($1 ) [main.py(10) reference bar] -> [root] <b.foo()/([main.py(7)],$1 ).bar,%1> ($1 )" ,
161+ "<%1> ($1 ) [main.py(13) reference foo] -> [root] <a.foo,%1> ($1 )" ,
162+ "<%1> ($1 ) [main.py(13) reference foo] -> [root] <b.foo,%1> ($1 )" ,
163163 // parameter 0 of function call is `A`, which we can look up in either `a` or `b`
164164 "<0,%1> ($1) [main.py(7) exported scope] -> [root] <a.A,%1> ($1)" ,
165165 "<0,%1> ($1) [main.py(7) exported scope] -> [root] <b.A,%1> ($1)" ,
@@ -173,8 +173,12 @@ fn class_field_through_function_parameter() {
173173 "<a,%1> ($1) [root] -> [a.py(0) definition a] <%1> ($1)" ,
174174 // definition of `foo` function
175175 "<a.foo,%1> ($1) [root] -> [a.py(5) definition foo] <%1> ($1)" ,
176- // reference to `x` in function body can resolve to formal parameter
177- "<%1> () [a.py(8) reference x] -> [a.py(14) definition x] <%1> ()" ,
176+ // reference to `x` in function body can resolve to formal parameter, and may have passed in parameters...
177+ "<%1> ($1) [a.py(8) reference x] -> [a.py(14) definition x] <%1> ()" ,
178+ // ...which we can look up either the 0th actual positional parameter...
179+ "<%1> ($1) [a.py(8) reference x] -> [jump to scope] <0,%1> ($1)" ,
180+ // ...or the actual named parameter `x`
181+ "<%1> ($1) [a.py(8) reference x] -> [jump to scope] <x,%1> ($1)" ,
178182 // result of function is `x`, which is passed in as a formal parameter...
179183 "<a.foo()/($2),%1> ($1) [root] -> [a.py(14) definition x] <%1> ()" ,
180184 // ...which we can look up either the 0th actual positional parameter...
@@ -209,11 +213,11 @@ fn cyclic_imports_python() {
209213 // definition of `__main__` module
210214 "<__main__,%1> ($1) [root] -> [main.py(0) definition __main__] <%1> ($1)" ,
211215 // reference to `a` in import statement
212- "<%1> () [main.py(8) reference a] -> [root] <a,%1> ()" ,
216+ "<%1> ($1 ) [main.py(8) reference a] -> [root] <a,%1> ($1 )" ,
213217 // `from a import *` means we can rewrite any lookup of `__main__.*` → `a.*`
214218 "<__main__.,%1> ($1) [root] -> [root] <a.,%1> ($1)" ,
215219 // reference to `foo` becomes `a.foo` because of import statement
216- "<%1> () [main.py(6) reference foo] -> [root] <a.foo,%1> ()" ,
220+ "<%1> ($1 ) [main.py(6) reference foo] -> [root] <a.foo,%1> ($1 )" ,
217221 ] ,
218222 ) ;
219223 check_partial_paths_in_file (
@@ -223,7 +227,7 @@ fn cyclic_imports_python() {
223227 // definition of `a` module
224228 "<a,%1> ($1) [root] -> [a.py(0) definition a] <%1> ($1)" ,
225229 // reference to `b` in import statement
226- "<%1> () [a.py(6) reference b] -> [root] <b,%1> ()" ,
230+ "<%1> ($1 ) [a.py(6) reference b] -> [root] <b,%1> ($1 )" ,
227231 // `from b import *` means we can rewrite any lookup of `a.*` → `b.*`
228232 "<a.,%1> ($1) [root] -> [root] <b.,%1> ($1)" ,
229233 ] ,
@@ -235,7 +239,7 @@ fn cyclic_imports_python() {
235239 // definition of `b` module
236240 "<b,%1> ($1) [root] -> [b.py(0) definition b] <%1> ($1)" ,
237241 // reference to `a` in import statement
238- "<%1> () [b.py(8) reference a] -> [root] <a,%1> ()" ,
242+ "<%1> ($1 ) [b.py(8) reference a] -> [root] <a,%1> ($1 )" ,
239243 // `from a import *` means we can rewrite any lookup of `b.*` → `a.*`
240244 "<b.,%1> ($1) [root] -> [root] <a.,%1> ($1)" ,
241245 // definition of `foo`
@@ -254,16 +258,16 @@ fn cyclic_imports_rust() {
254258 // paths involving the root node.
255259 & [
256260 // reference to `a` in `main` function
257- "<%1> () [test.rs(103) reference a] -> [test.rs(201) definition a] <%1> ()" ,
261+ "<%1> ($1 ) [test.rs(103) reference a] -> [test.rs(201) definition a] <%1> ($1 )" ,
258262 // reference to `a` in `b` function
259- "<%1> () [test.rs(307) reference a] -> [test.rs(201) definition a] <%1> ()" ,
263+ "<%1> ($1 ) [test.rs(307) reference a] -> [test.rs(201) definition a] <%1> ($1 )" ,
260264 // reference to `b` in `a` function
261- "<%1> () [test.rs(206) reference b] -> [test.rs(301) definition b] <%1> ()" ,
265+ "<%1> ($1 ) [test.rs(206) reference b] -> [test.rs(301) definition b] <%1> ($1 )" ,
262266 // reference to `FOO` in `main` can resolve either to `a::BAR` or `b::FOO`
263- "<%1> () [test.rs(101) reference FOO] -> [test.rs(204) definition BAR] <%1> ()" ,
264- "<%1> () [test.rs(101) reference FOO] -> [test.rs(304) definition FOO] <%1> ()" ,
267+ "<%1> ($1 ) [test.rs(101) reference FOO] -> [test.rs(204) definition BAR] <%1> ($1 )" ,
268+ "<%1> ($1 ) [test.rs(101) reference FOO] -> [test.rs(304) definition FOO] <%1> ($1 )" ,
265269 // reference to `BAR` in `b` resolves _only_ to `a::BAR`
266- "<%1> () [test.rs(305) reference BAR] -> [test.rs(204) definition BAR] <%1> ()" ,
270+ "<%1> ($1 ) [test.rs(305) reference BAR] -> [test.rs(204) definition BAR] <%1> ($1 )" ,
267271 ] ,
268272 ) ;
269273}
@@ -278,11 +282,11 @@ fn sequenced_import_star() {
278282 // definition of `__main__` module
279283 "<__main__,%1> ($1) [root] -> [main.py(0) definition __main__] <%1> ($1)" ,
280284 // reference to `a` in import statement
281- "<%1> () [main.py(8) reference a] -> [root] <a,%1> ()" ,
285+ "<%1> ($1 ) [main.py(8) reference a] -> [root] <a,%1> ($1 )" ,
282286 // `from a import *` means we can rewrite any lookup of `__main__.*` → `a.*`
283287 "<__main__.,%1> ($1) [root] -> [root] <a.,%1> ($1)" ,
284288 // reference to `foo` becomes `a.foo` because of import statement
285- "<%1> () [main.py(6) reference foo] -> [root] <a.foo,%1> ()" ,
289+ "<%1> ($1 ) [main.py(6) reference foo] -> [root] <a.foo,%1> ($1 )" ,
286290 ] ,
287291 ) ;
288292 check_partial_paths_in_file (
@@ -292,7 +296,7 @@ fn sequenced_import_star() {
292296 // definition of `a` module
293297 "<a,%1> ($1) [root] -> [a.py(0) definition a] <%1> ($1)" ,
294298 // reference to `b` in import statement
295- "<%1> () [a.py(6) reference b] -> [root] <b,%1> ()" ,
299+ "<%1> ($1 ) [a.py(6) reference b] -> [root] <b,%1> ($1 )" ,
296300 // `from b import *` means we can rewrite any lookup of `a.*` → `b.*`
297301 "<a.,%1> ($1) [root] -> [root] <b.,%1> ($1)" ,
298302 ] ,
0 commit comments