Skip to content

[RFC]: support auto-completion and completion previews after function executions in the REPL #2074

Open

Description

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

In [1]: [ 'foo', 'bar', 'beep' ].sort().fil<|>

where <|> is the cursor. In this example, after eager evaluation, we know that sort() returns the input array and thus we should be able to auto-complete filter.

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

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    EnhancementIssue or pull request for enhancing existing functionality.JavaScriptIssue involves or relates to JavaScript.Needs DiscussionNeeds further discussion.REPLIssue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.difficulty: 5Likely to be difficult to implement with several unknowns.priority: NormalNormal priority concern or feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions