Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ty_ide/src/doc_highlights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ calc = Calculator()
"
def test():
# Cursor on a position with no symbol
<CURSOR>
<CURSOR>
",
);

Expand Down
20 changes: 10 additions & 10 deletions crates/ty_ide/src/docstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,12 +824,12 @@ mod tests {
Check out this great example code::

x_y = "hello"

if len(x_y) > 4:
print(x_y)
else:
print("too short :(")

print("done")

You love to see it.
Expand Down Expand Up @@ -862,12 +862,12 @@ mod tests {
Check out this great example code ::

x_y = "hello"

if len(x_y) > 4:
print(x_y)
else:
print("too short :(")

print("done")

You love to see it.
Expand Down Expand Up @@ -901,12 +901,12 @@ mod tests {
::

x_y = "hello"

if len(x_y) > 4:
print(x_y)
else:
print("too short :(")

print("done")

You love to see it.
Expand Down Expand Up @@ -939,12 +939,12 @@ mod tests {
let docstring = r#"
Check out this great example code::
x_y = "hello"

if len(x_y) > 4:
print(x_y)
else:
print("too short :(")

print("done")
You love to see it.
"#;
Expand Down Expand Up @@ -975,12 +975,12 @@ mod tests {
Check out this great example code::

x_y = "hello"

if len(x_y) > 4:
print(x_y)
else:
print("too short :(")

print("done")"#;

let docstring = Docstring::new(docstring.to_owned());
Expand Down
22 changes: 11 additions & 11 deletions crates/ty_ide/src/goto_declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ mod tests {
r#"
class A:
x = 1

def method(self):
def inner():
return <CURSOR>x # Should NOT find class variable x
Expand Down Expand Up @@ -1255,12 +1255,12 @@ x: i<CURSOR>nt = 42
r#"
def outer():
x = "outer_value"

def inner():
nonlocal x
x = "modified"
return x<CURSOR> # Should find the nonlocal x declaration in outer scope

return inner
"#,
);
Expand Down Expand Up @@ -1295,12 +1295,12 @@ def outer():
r#"
def outer():
xy = "outer_value"

def inner():
nonlocal x<CURSOR>y
xy = "modified"
return x # Should find the nonlocal x declaration in outer scope

return inner
"#,
);
Expand Down Expand Up @@ -1636,7 +1636,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=a<CURSOR>b):
Expand Down Expand Up @@ -1675,7 +1675,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=ab):
Expand Down Expand Up @@ -1713,7 +1713,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Cl<CURSOR>ick(x, button=ab):
Expand Down Expand Up @@ -1751,7 +1751,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, but<CURSOR>ton=ab):
Expand Down Expand Up @@ -1919,7 +1919,7 @@ def function():
class C:
def __init__(self):
self._value = 0

@property
def value(self):
return self._value
Expand Down Expand Up @@ -2029,7 +2029,7 @@ def function():
r#"
class MyClass:
ClassType = int

def generic_method[T](self, value: Class<CURSOR>Type) -> T:
return value
"#,
Expand Down
16 changes: 8 additions & 8 deletions crates/ty_ide/src/goto_type_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ mod tests {
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=a<CURSOR>b):
Expand All @@ -1131,7 +1131,7 @@ mod tests {
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=ab):
Expand All @@ -1151,7 +1151,7 @@ mod tests {
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Cl<CURSOR>ick(x, button=ab):
Expand Down Expand Up @@ -1189,7 +1189,7 @@ mod tests {
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, but<CURSOR>ton=ab):
Expand Down Expand Up @@ -1398,12 +1398,12 @@ f(**kwargs<CURSOR>)
r#"
def outer():
x = "outer_value"

def inner():
nonlocal x
x = "modified"
return x<CURSOR> # Should find the nonlocal x declaration in outer scope

return inner
"#,
);
Expand Down Expand Up @@ -1438,12 +1438,12 @@ def outer():
r#"
def outer():
xy = "outer_value"

def inner():
nonlocal x<CURSOR>y
xy = "modified"
return x # Should find the nonlocal x declaration in outer scope

return inner
"#,
);
Expand Down
16 changes: 8 additions & 8 deletions crates/ty_ide/src/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1708,12 +1708,12 @@ def ab(a: int, *, c: int):
r#"
def outer():
x = "outer_value"

def inner():
nonlocal x
x = "modified"
return x<CURSOR> # Should find the nonlocal x declaration in outer scope

return inner
"#,
);
Expand Down Expand Up @@ -1747,12 +1747,12 @@ def outer():
r#"
def outer():
xy = "outer_value"

def inner():
nonlocal x<CURSOR>y
xy = "modified"
return x # Should find the nonlocal x declaration in outer scope

return inner
"#,
);
Expand Down Expand Up @@ -1960,7 +1960,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=a<CURSOR>b):
Expand All @@ -1980,7 +1980,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=ab):
Expand Down Expand Up @@ -2018,7 +2018,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Cl<CURSOR>ick(x, button=ab):
Expand Down Expand Up @@ -2057,7 +2057,7 @@ def function():
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, but<CURSOR>ton=ab):
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_ide/src/inlay_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ mod tests {
def __init__(self, pos, btn):
self.position: int = pos
self.button: str = btn

def my_func(event: Click):
match event:
case Click(x, button=ab):
Expand Down
Loading