From 6f03afe318f3054aed2cb4667433c256de2e581d Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Fri, 5 Dec 2025 12:51:40 +0530 Subject: [PATCH] Remove unused whitespaces in test cases (#21806) These aren't used in the tests themselves. There are more instances of them in other files but those require code changes so I've left them as it is. --- crates/ty_ide/src/doc_highlights.rs | 2 +- crates/ty_ide/src/docstring.rs | 20 ++++++++++---------- crates/ty_ide/src/goto_declaration.rs | 22 +++++++++++----------- crates/ty_ide/src/goto_type_definition.rs | 16 ++++++++-------- crates/ty_ide/src/hover.rs | 16 ++++++++-------- crates/ty_ide/src/inlay_hints.rs | 2 +- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/crates/ty_ide/src/doc_highlights.rs b/crates/ty_ide/src/doc_highlights.rs index 92b7620943..c7ad2a6c17 100644 --- a/crates/ty_ide/src/doc_highlights.rs +++ b/crates/ty_ide/src/doc_highlights.rs @@ -230,7 +230,7 @@ calc = Calculator() " def test(): # Cursor on a position with no symbol - + ", ); diff --git a/crates/ty_ide/src/docstring.rs b/crates/ty_ide/src/docstring.rs index 40c94ec5cb..0755fead73 100644 --- a/crates/ty_ide/src/docstring.rs +++ b/crates/ty_ide/src/docstring.rs @@ -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. @@ -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. @@ -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. @@ -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. "#; @@ -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()); diff --git a/crates/ty_ide/src/goto_declaration.rs b/crates/ty_ide/src/goto_declaration.rs index a2f147b2d3..3e455b7533 100644 --- a/crates/ty_ide/src/goto_declaration.rs +++ b/crates/ty_ide/src/goto_declaration.rs @@ -273,7 +273,7 @@ mod tests { r#" class A: x = 1 - + def method(self): def inner(): return x # Should NOT find class variable x @@ -1255,12 +1255,12 @@ x: int = 42 r#" def outer(): x = "outer_value" - + def inner(): nonlocal x x = "modified" return x # Should find the nonlocal x declaration in outer scope - + return inner "#, ); @@ -1295,12 +1295,12 @@ def outer(): r#" def outer(): xy = "outer_value" - + def inner(): nonlocal xy xy = "modified" return x # Should find the nonlocal x declaration in outer scope - + return inner "#, ); @@ -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=ab): @@ -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): @@ -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 Click(x, button=ab): @@ -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, button=ab): @@ -1919,7 +1919,7 @@ def function(): class C: def __init__(self): self._value = 0 - + @property def value(self): return self._value @@ -2029,7 +2029,7 @@ def function(): r#" class MyClass: ClassType = int - + def generic_method[T](self, value: ClassType) -> T: return value "#, diff --git a/crates/ty_ide/src/goto_type_definition.rs b/crates/ty_ide/src/goto_type_definition.rs index fc5aa9aded..53cc98413d 100644 --- a/crates/ty_ide/src/goto_type_definition.rs +++ b/crates/ty_ide/src/goto_type_definition.rs @@ -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=ab): @@ -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): @@ -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 Click(x, button=ab): @@ -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, button=ab): @@ -1398,12 +1398,12 @@ f(**kwargs) r#" def outer(): x = "outer_value" - + def inner(): nonlocal x x = "modified" return x # Should find the nonlocal x declaration in outer scope - + return inner "#, ); @@ -1438,12 +1438,12 @@ def outer(): r#" def outer(): xy = "outer_value" - + def inner(): nonlocal xy xy = "modified" return x # Should find the nonlocal x declaration in outer scope - + return inner "#, ); diff --git a/crates/ty_ide/src/hover.rs b/crates/ty_ide/src/hover.rs index affa6054e2..63b67bc864 100644 --- a/crates/ty_ide/src/hover.rs +++ b/crates/ty_ide/src/hover.rs @@ -1708,12 +1708,12 @@ def ab(a: int, *, c: int): r#" def outer(): x = "outer_value" - + def inner(): nonlocal x x = "modified" return x # Should find the nonlocal x declaration in outer scope - + return inner "#, ); @@ -1747,12 +1747,12 @@ def outer(): r#" def outer(): xy = "outer_value" - + def inner(): nonlocal xy xy = "modified" return x # Should find the nonlocal x declaration in outer scope - + return inner "#, ); @@ -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=ab): @@ -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): @@ -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 Click(x, button=ab): @@ -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, button=ab): diff --git a/crates/ty_ide/src/inlay_hints.rs b/crates/ty_ide/src/inlay_hints.rs index c6ddf8d846..1d26d3cdd2 100644 --- a/crates/ty_ide/src/inlay_hints.rs +++ b/crates/ty_ide/src/inlay_hints.rs @@ -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):