Skip to content
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

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

Open
3 tasks done
kgryte opened this issue Mar 27, 2024 · 0 comments
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.

Comments

@kgryte
Copy link
Member

kgryte commented Mar 27, 2024

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:.
@kgryte kgryte added Enhancement Issue or pull request for enhancing existing functionality. RFC Request for comments. Feature requests and proposed changes. Needs Discussion Needs further discussion. difficulty: 5 Likely to be difficult to implement with several unknowns. REPL Issue or pull request specific to the project REPL. priority: Normal Normal priority concern or feature request. JavaScript Issue involves or relates to JavaScript. labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant