Skip to content

Commit

Permalink
rustdoc-search: show type signature on type-driven SERP
Browse files Browse the repository at this point in the history
This displays the function signature, as rustdoc understands it,
on the In Parameters, In Return Types, and In Function Signature
pages, but not in the In Names page, since it's not used there.
It also highlights the matching parts, to clarify why a function
is considered a good match.
  • Loading branch information
notriddle committed Oct 24, 2023
1 parent b67985e commit 8e043ab
Show file tree
Hide file tree
Showing 6 changed files with 557 additions and 161 deletions.
8 changes: 5 additions & 3 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,11 @@ details:not(.toggle) summary {
margin-bottom: .6em;
}

code, pre, a.test-arrow, .code-header {
code, pre, a.test-arrow, .code-header, .search-results .type-signature {
font-family: "Source Code Pro", monospace;
}
.docblock code, .docblock-short code {
.docblock code, .docblock-short code,
.search-results .type-signature strong {
border-radius: 3px;
padding: 0 0.125em;
}
Expand Down Expand Up @@ -681,7 +682,8 @@ ul.block, .block li {
}

.docblock code, .docblock-short code,
pre, .rustdoc.src .example-wrap {
pre, .rustdoc.src .example-wrap,
.search-results .type-signature strong {
background-color: var(--code-block-background-color);
}

Expand Down
Loading

0 comments on commit 8e043ab

Please sign in to comment.