rustdoc-search: use lowercase, non-normalized name for type search
The type name ID map has underscores in its names, so the query element should have them, too.
This commit is contained in:
parent
e484b3efa5
commit
8865b8c639
3 changed files with 78 additions and 4 deletions
62
tests/rustdoc-js/underscoredtype.js
Normal file
62
tests/rustdoc-js/underscoredtype.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
const EXPECTED = [
|
||||
{
|
||||
'query': 'pid_t',
|
||||
'correction': null,
|
||||
'proposeCorrectionFrom': null,
|
||||
'proposeCorrectionTo': null,
|
||||
'others': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'pid_t' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'set_pid' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'get_pid' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'pidt',
|
||||
'correction': 'pid_t',
|
||||
'proposeCorrectionFrom': null,
|
||||
'proposeCorrectionTo': null,
|
||||
'others': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'pid_t' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'set_pid' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'get_pid' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'unix::pid_t',
|
||||
'correction': null,
|
||||
'proposeCorrectionFrom': null,
|
||||
'proposeCorrectionTo': null,
|
||||
'others': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'pid_t' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'set_pid' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'get_pid' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'unix::pidt',
|
||||
'correction': 'pid_t',
|
||||
'proposeCorrectionFrom': null,
|
||||
'proposeCorrectionTo': null,
|
||||
'others': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'pid_t' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'set_pid' },
|
||||
],
|
||||
'returned': [
|
||||
{ 'path': 'underscoredtype::unix', 'name': 'get_pid' },
|
||||
],
|
||||
},
|
||||
];
|
8
tests/rustdoc-js/underscoredtype.rs
Normal file
8
tests/rustdoc-js/underscoredtype.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
pub mod unix {
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type pid_t = i32;
|
||||
pub fn get_pid() -> pid_t {
|
||||
0
|
||||
}
|
||||
pub fn set_pid(_: pid_t) {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue