Skip to content

Commit 514bf16

Browse files
committed
sourcegraph#91 - adds nested resolution edge case
1 parent 805a253 commit 514bf16

File tree

6 files changed

+85
-0
lines changed

6 files changed

+85
-0
lines changed

packages/pyright-scip/snapshots/input/relative_import_nested/src/__init__.py

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .foo import exported_function
2+
from .foo import this_class
3+
4+
if True:
5+
exported_function()
6+
7+
this_class.exported_function()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def exported_function():
2+
return "function"
3+
4+
class MyClass:
5+
"""This is a class and it is cool"""
6+
7+
def __init__(self):
8+
pass
9+
10+
def exported_function(self):
11+
return "exported"
12+
13+
this_class = MyClass()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# < definition scip-python python snapshot-util 0.1 src/__init__:
2+
#documentation (module) src
3+
4+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# < definition scip-python python snapshot-util 0.1 `src.bar`/__init__:
2+
#documentation (module) src.bar
3+
4+
from .foo import exported_function
5+
# ^^^^ reference snapshot-util 0.1 foo/__init__:
6+
from .foo import this_class
7+
# ^^^^ reference snapshot-util 0.1 foo/__init__:
8+
9+
if True:
10+
exported_function()
11+
# ^^^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `src.foo`/exported_function().
12+
13+
this_class.exported_function()
14+
# ^^^^^^^^^^ reference snapshot-util 0.1 `src.foo`/this_class.
15+
# ^^^^^^^^^^^^^^^^^ reference snapshot-util 0.1 `src.foo`/MyClass#exported_function().
16+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# < definition scip-python python snapshot-util 0.1 `src.foo`/__init__:
2+
#documentation (module) src.foo
3+
4+
def exported_function():
5+
# ^^^^^^^^^^^^^^^^^ definition snapshot-util 0.1 `src.foo`/exported_function().
6+
# documentation ```python
7+
# > def exported_function(): # -> Literal['f...
8+
# > ```
9+
return "function"
10+
11+
class MyClass:
12+
# ^^^^^^^ definition snapshot-util 0.1 `src.foo`/MyClass#
13+
# documentation ```python
14+
# > class MyClass:
15+
# > ```
16+
# documentation This is a class and it is cool
17+
"""This is a class and it is cool"""
18+
19+
def __init__(self):
20+
# ^^^^^^^^ definition snapshot-util 0.1 `src.foo`/MyClass#__init__().
21+
# documentation ```python
22+
# > def __init__(
23+
# > self
24+
# > ) -> None:
25+
# > ```
26+
# ^^^^ definition snapshot-util 0.1 `src.foo`/MyClass#__init__().(self)
27+
pass
28+
29+
def exported_function(self):
30+
# ^^^^^^^^^^^^^^^^^ definition snapshot-util 0.1 `src.foo`/MyClass#exported_function().
31+
# documentation ```python
32+
# > def exported_function(
33+
# > self
34+
# > ): # -> Literal['exported']:
35+
# > ```
36+
# ^^^^ definition snapshot-util 0.1 `src.foo`/MyClass#exported_function().(self)
37+
return "exported"
38+
39+
this_class = MyClass()
40+
#^^^^^^^^^ definition snapshot-util 0.1 `src.foo`/this_class.
41+
#documentation ```python
42+
# > src.foo.MyClass
43+
# > ```
44+
# ^^^^^^^ reference snapshot-util 0.1 `src.foo`/MyClass#
45+

0 commit comments

Comments
 (0)