-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made temporary changes to include multiple keywords in rustdoc search #11438
Conversation
@@ -96,6 +96,11 @@ | |||
document.location.href = url; | |||
}); | |||
|
|||
function stripQuery(query) { | |||
var strippedQuery = query.split("::"); | |||
return strippedQuery[strippedQuery.length - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you search for File::
, doesn't this end up querying ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems kinda wrong discarding everything but the last identifier in the path, in theory you have a lot more contextual information, right?
I think this is ok for now (today's behavior is nothing!), but I am concerned about searching for empty strings.
Completely agree, this is a temporary fix until I get the results.path working correctly, I wouldn't close the issue until this is |
Continuing on, the data available for a search is like this: File::open => Object {ty: "method", name: "open", path: "std::io::fs", desc: "Attempts to open a file in read-only mode.....", parent: "136298"} Parent node => Object {type: "struct", name: "File"} The parent has to be searched also for a correct keyword. Currently, the implementation will search and combine for both keywords (File && open). Though, I think that it would be more suitable if the results returned ONLY entries that contain the keywords (File && open). So for example, searching for File::open should return:
Rather than results like this:
Let me know your thoughts. I can have this done soon. |
Sounds awesome! So long as all information given in the search is semantically considered, then that's fine by me! |
Awesome, nice job! Would you mind rebasing your commits into one? Otherwise this looks good to go! |
Made temporary changes to include multiple keywords in rustdoc search Implemented search based on multiple keywords Added some commenting and house cleaning Added path searching to rustdoc
Done |
cc @cmr Temporary change to issue #10535. Requires significant re-factoring to search completely based on the index paths. For example searching for "File::" in this fix will return no results. Still need to search completely based on path (rather than name's + types) to completely fix. Will continue to work this
new lint to detect infinite loop closes: rust-lang#11438 changelog: add new lint to detect infinite loop ~*I'll change the lint name*~. Should I name it `infinite_loop` or `infinite_loops` is fine? Ahhhh, English is hard...
cc @cmr
Temporary change to issue #10535. Requires significant re-factoring to search completely based on the index paths. For example searching for "File::" in this fix will return no results. Still need to search completely based on path (rather than name's + types) to completely fix. Will continue to work this