[RFC]: support auto-completion and completion previews after function executions in the REPL #2074
Open
3 tasks done
Labels
difficulty: 5
Likely to be difficult to implement with several unknowns.
Enhancement
Issue or pull request for enhancing existing functionality.
JavaScript
Issue involves or relates to JavaScript.
Needs Discussion
Needs further discussion.
priority: Normal
Normal priority concern or feature request.
REPL
Issue or pull request specific to the project REPL.
RFC
Request for comments. Feature requests and proposed changes.
Description
This RFC proposes adding support for auto-completion and completion previews after function executions in the REPL. The idea is that, for side-effect commands, we could eagerly evaluate and support TAB completion and the display of potential completions. E.g., consider
where
<|>
is the cursor. In this example, after eager evaluation, we know thatsort()
returns the input array and thus we should be able to auto-completefilter
.One possibility which may not rely on eager evaluation for implementing this RFC is to take advantage of take advantage of our signature database (see https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/repl/signature), where we statically know output values. If a function/method returns a value having a specific type, we can then auto-complete based on the known properties/methods of that type.
Eager evaluation, however, would allow for result previews of chained commands and would also the need to analyze complex static AST graphs.
Related Issues
Questions
No.
Other
Checklist
RFC:
.The text was updated successfully, but these errors were encountered: