mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
4c11822aeb
This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
51 lines
987 B
JavaScript
51 lines
987 B
JavaScript
// exact-check
|
|
|
|
const QUERY = [
|
|
'Result<SomeTrait>',
|
|
'Result<SomeTraiz>',
|
|
'OtherThingxxxxxxxx',
|
|
'OtherThingxxxxxxxy',
|
|
];
|
|
|
|
const CORRECTIONS = [
|
|
null,
|
|
null,
|
|
null,
|
|
'OtherThingxxxxxxxx',
|
|
];
|
|
|
|
const EXPECTED = [
|
|
// Result<SomeTrait>
|
|
{
|
|
'in_args': [
|
|
{ 'path': 'generics_trait', 'name': 'beta' },
|
|
],
|
|
'returned': [
|
|
{ 'path': 'generics_trait', 'name': 'bet' },
|
|
],
|
|
},
|
|
// Result<SomeTraiz>
|
|
{
|
|
'in_args': [],
|
|
'returned': [],
|
|
},
|
|
// OtherThingxxxxxxxx
|
|
{
|
|
'in_args': [
|
|
{ 'path': 'generics_trait', 'name': 'alpha' },
|
|
],
|
|
'returned': [
|
|
{ 'path': 'generics_trait', 'name': 'alef' },
|
|
],
|
|
},
|
|
// OtherThingxxxxxxxy
|
|
{
|
|
'in_args': [
|
|
{ 'path': 'generics_trait', 'name': 'alpha' },
|
|
],
|
|
'returned': [
|
|
{ 'path': 'generics_trait', 'name': 'alef' },
|
|
],
|
|
},
|
|
];
|