-
-
Notifications
You must be signed in to change notification settings - Fork 851
Open
Labels
EnhancementIssue or pull request for enhancing existing functionality.Issue or pull request for enhancing existing functionality.JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.Needs DiscussionNeeds further discussion.Needs further discussion.REPLIssue or pull request specific to the project REPL.Issue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 3Likely to be challenging but manageable.Likely to be challenging but manageable.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
Description
Description
This RFC proposes adding built-in support for searching within the stdlib REPL environment. Something along the lines of
In [1]: search( 'absolute value' )
<search_results>
While the REPL supports TAB completion, including the display of potential matches, one still has to know, more or less, where to find things, which can be difficult due to the use of namespaces (e.g., base
, base.strided
, random
, etc).
In short, it can be hard to find the REPL function you want to use. This RFC proposes reducing that barrier by building in search capabilities to the REPL.
Related Issues
No.
Questions
- Should search be fuzzy? Probably. If someone types
'abolute value'
, we shouldn't return zero results because the user misspelledabsolute
. - What should be returned? We may want modes/flags that allow users to specify what they want to return. E.g., REPL aliases, package names, etc.
Other
- We have some prior art for this in the project. Namely, for the API documentation website we use https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/search/pkg-index for generating the search index. We could potentially leverage that for building a similar idea, and may be beneficial to write our own TF-IDF package.
- As search would be built into the REPL, we'd need to create our own search implementation, as currently we rely on
lunr
as a dev dep and making a non-dev-dep is not desired, as we try to minimize any and all production dependencies.
- As search would be built into the REPL, we'd need to create our own search implementation, as currently we rely on
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:
.
Metadata
Metadata
Assignees
Labels
EnhancementIssue or pull request for enhancing existing functionality.Issue or pull request for enhancing existing functionality.JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.Needs DiscussionNeeds further discussion.Needs further discussion.REPLIssue or pull request specific to the project REPL.Issue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 3Likely to be challenging but manageable.Likely to be challenging but manageable.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.