File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,65 @@ References:
325325 ) ;
326326}
327327
328+ // todo(kylei): reference on child method should find parent method
329+ #[ test]
330+ fn parent_method ( ) {
331+ let code = r#"
332+ class C:
333+ def f(self) -> str: ...
334+
335+ class Concrete(C):
336+ def f(self) -> str:
337+ # ^
338+ return "test"
339+ "# ;
340+ let report = get_batched_lsp_operations_report ( & [ ( "main" , code) ] , get_test_report) ;
341+ assert_eq ! (
342+ r#"
343+ # main.py
344+ 6 | def f(self) -> str:
345+ ^
346+ References:
347+ 6 | def f(self) -> str:
348+ ^
349+ "#
350+ . trim( ) ,
351+ report. trim( ) ,
352+ ) ;
353+ }
354+
355+ // todo(kylei): reference on child method should find parent + other child methods
356+ #[ test]
357+ fn sibling_method ( ) {
358+ let code = r#"
359+ class C:
360+ def f(self) -> str: ...
361+
362+ class Concrete(C):
363+ def f(self) -> str:
364+ # ^
365+ return "test"
366+
367+ class Concrete2(C):
368+ def f(self) -> str:
369+ return "test"
370+
371+ "# ;
372+ let report = get_batched_lsp_operations_report ( & [ ( "main" , code) ] , get_test_report) ;
373+ assert_eq ! (
374+ r#"
375+ # main.py
376+ 6 | def f(self) -> str:
377+ ^
378+ References:
379+ 6 | def f(self) -> str:
380+ ^
381+ "#
382+ . trim( ) ,
383+ report. trim( ) ,
384+ ) ;
385+ }
386+
328387// todo(kylei): references on renames should find lhs of assignment
329388#[ test]
330389fn reassigned_local ( ) {
You can’t perform that action at this time.
0 commit comments