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
22 changes: 11 additions & 11 deletions crates/ty_ide/src/all_symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def zqzqzq():
)
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/__init__.py:2:27
|
Expand Down Expand Up @@ -698,7 +698,7 @@ def zqzqzq():
)
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/__init__.py:2:37
|
Expand Down Expand Up @@ -743,7 +743,7 @@ def zqzqzq():
)
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/__init__.py:2:5
|
Expand Down Expand Up @@ -794,7 +794,7 @@ def zqzqzq():
)
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/io/api.py:2:31
|
Expand Down Expand Up @@ -857,7 +857,7 @@ __all__ = ['zqzqzq']
)
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/__init__.py:2:5
|
Expand Down Expand Up @@ -889,7 +889,7 @@ def zqzqzq():
.source("sub1/sub2/sub3.py", "from pandas import zqzqzq as zqzqzq")
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/__init__.py:2:5
|
Expand Down Expand Up @@ -932,7 +932,7 @@ def zqzqzq():
.source("sub1/sub2/sub3.py", "from pandas import zqzqzq as zqzqzq")
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> pandas/__init__.py:2:5
|
Expand Down Expand Up @@ -1042,7 +1042,7 @@ def test_helper_xyzxyzxyz():

// First-party test symbols should still be available
// (both test_ prefixed and non-test_ prefixed)
assert_snapshot!(test.all_symbols("xyzxyzxyz"), @r"
assert_snapshot!(test.all_symbols("xyzxyzxyz"), @"
info[all-symbols]: AllSymbolInfo
--> mypackage/tests/test_utils.py:2:5
|
Expand Down Expand Up @@ -1080,7 +1080,7 @@ def test_helper_xyzxyzxyz():
)
.build();

assert_snapshot!(test.all_symbols("xyzxyzxyz"), @r"
assert_snapshot!(test.all_symbols("xyzxyzxyz"), @"
info[all-symbols]: AllSymbolInfo
--> site-packages/thirdparty/utils.py:1:5
|
Expand Down Expand Up @@ -1114,7 +1114,7 @@ def test_helper_xyzxyzxyz():
.source("mypackage/_foo/__init__.py", "ZQZQZQ = 1")
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> mypackage/_foo/__init__.py:1:1
|
Expand Down Expand Up @@ -1162,7 +1162,7 @@ def test_helper_xyzxyzxyz():
.site_packages("thirdparty/_foo/__init__.py", "ZQZQZQ = 1")
.build();

assert_snapshot!(test.all_symbols("zqzqzq"), @r"
assert_snapshot!(test.all_symbols("zqzqzq"), @"
info[all-symbols]: AllSymbolInfo
--> site-packages/thirdparty/__init__.py:1:1
|
Expand Down
72 changes: 36 additions & 36 deletions crates/ty_ide/src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8492,42 +8492,42 @@ raise <CURSOR>
);
assert_snapshot!(
builder.skip_auto_import().skip_builtins().build().snapshot(),
@r"
and
as
assert
async
await
break
case
class
continue
def
del
elif
else
except
finally
for
from
global
if
import
in
is
lambda
match
nonlocal
not
or
pass
raise
return
try
while
with
yield
",
@"
and
as
assert
async
await
break
case
class
continue
def
del
elif
else
except
finally
for
from
global
if
import
in
is
lambda
match
nonlocal
not
or
pass
raise
return
try
while
with
yield
",
);
}

Expand Down
22 changes: 11 additions & 11 deletions crates/ty_ide/src/find_references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ test("test")
)
.build();

assert_snapshot!(test.references(), @"
assert_snapshot!(test.references(), @r#"
info[references]: Found 6 references
--> lib.py:5:5
|
Expand All @@ -433,10 +433,10 @@ test("test")
2 | from lib import test
| ----
3 |
4 | test(\"test\")
4 | test("test")
| ----
|
");
"#);
}

#[test]
Expand Down Expand Up @@ -1242,7 +1242,7 @@ result = func(value=42)
)
.build();

assert_snapshot!(test.references(), @r#"
assert_snapshot!(test.references(), @"
info[references]: Found 3 references
--> main.py:4:15
|
Expand All @@ -1258,7 +1258,7 @@ result = func(value=42)
3 | return value * 2
| -----
|
"#);
");
}

#[test]
Expand All @@ -1282,7 +1282,7 @@ async def main():
)
.build();

assert_snapshot!(test.references(), @r#"
assert_snapshot!(test.references(), @"
info[references]: Found 3 references
--> main.py:5:23
|
Expand All @@ -1297,7 +1297,7 @@ async def main():
3 | return value * 2
| -----
|
"#);
");
}

#[test]
Expand All @@ -1321,7 +1321,7 @@ instance = ExampleClass(old_name="test")
)
.build();

assert_snapshot!(test.references(), @r#"
assert_snapshot!(test.references(), @"
info[references]: Found 1 references
--> example_rename_2.py:4:14
|
Expand All @@ -1330,7 +1330,7 @@ instance = ExampleClass(old_name="test")
4 | self.old_name = old_name
| --------
|
"#);
");
}

#[test]
Expand Down Expand Up @@ -1359,7 +1359,7 @@ result = func(value=10)
// TODO(parameter-keyword-references): Nested callable owners are intentionally excluded by
// the external-visibility heuristic (perf/signal tradeoff).
// Ideal output would also include `caller.py` at `func(value=10)` on `value`.
assert_snapshot!(test.references(), @r#"
assert_snapshot!(test.references(), @"
info[references]: Found 2 references
--> outer.py:3:15
|
Expand All @@ -1370,7 +1370,7 @@ result = func(value=10)
| -----
5 | return inner
|
"#);
");
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_ide/src/goto_declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ mod tests {
",
);

assert_snapshot!(test.goto_declaration(), @r"
assert_snapshot!(test.goto_declaration(), @"
info[goto-declaration]: Go to declaration
--> main.py:6:12
|
Expand Down
22 changes: 11 additions & 11 deletions crates/ty_ide/src/goto_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class MyOtherClass:
)
.build();

assert_snapshot!(test.goto_definition(), @r"
assert_snapshot!(test.goto_definition(), @"
info[goto-definition]: Go to definition
--> main.py:3:5
|
Expand Down Expand Up @@ -1663,7 +1663,7 @@ x = MyClass<CURSOR>()
)
.build();

assert_snapshot!(test.goto_definition(), @r"
assert_snapshot!(test.goto_definition(), @"
info[goto-definition]: Go to definition
--> main.py:5:5
|
Expand Down Expand Up @@ -1699,7 +1699,7 @@ x = MyClass(<CURSOR>)
)
.build();

assert_snapshot!(test.goto_definition(), @r"
assert_snapshot!(test.goto_definition(), @"
info[goto-definition]: Go to definition
--> main.py:5:5
|
Expand Down Expand Up @@ -1761,7 +1761,7 @@ x = MyClass(foo<CURSOR>)

assert_snapshot!(
test.goto_definition(),
@r"
@"
info[goto-definition]: Go to definition
--> main.py:7:13
|
Expand Down Expand Up @@ -1799,7 +1799,7 @@ x = MyClass<CURSOR>()
)
.build();

assert_snapshot!(test.goto_definition(), @r"
assert_snapshot!(test.goto_definition(), @"
info[goto-definition]: Go to definition
--> main.py:7:5
|
Expand Down Expand Up @@ -2055,7 +2055,7 @@ p = Point<CURSOR>(1, 2)
)
.build();

assert_snapshot!(test.goto_definition(), @r#"
assert_snapshot!(test.goto_definition(), @"
info[goto-definition]: Go to definition
--> main.py:4:5
|
Expand All @@ -2074,7 +2074,7 @@ p = Point<CURSOR>(1, 2)
263 | @property
264 | def __flags__(self) -> int: ...
|
"#);
");
}

/// Goto-definition performs lookups on the metaclass when attributes are not found.
Expand All @@ -2093,7 +2093,7 @@ p = Point<CURSOR>(1, 2)
)
.build();

assert_snapshot!(test.goto_definition(), @r#"
assert_snapshot!(test.goto_definition(), @"
info[goto-definition]: Go to definition
--> main.py:6:5
|
Expand All @@ -2110,7 +2110,7 @@ p = Point<CURSOR>(1, 2)
4 |
5 | class Bar(metaclass=Foo): ...
|
"#);
");
}

/// Goto-definition does not look up instance members on the metaclass.
Expand All @@ -2129,7 +2129,7 @@ p = Point<CURSOR>(1, 2)
)
.build();

assert_snapshot!(test.goto_definition(), @r#"No goto target found"#);
assert_snapshot!(test.goto_definition(), @"No goto target found");
}

/// Check that we don't fall into infinite recursion when e.g.
Expand All @@ -2141,7 +2141,7 @@ p = Point<CURSOR>(1, 2)
.source("main.py", "type.<CURSOR>a")
.build();

assert_snapshot!(test.goto_definition(), @r#"No goto target found"#);
assert_snapshot!(test.goto_definition(), @"No goto target found");
}

/// Check that we don't fall into infinite recursion when e.g.
Expand Down
Loading