Skip to content

[RFC]: add auto-closing brackets and quotations in REPL #1672

Description

@Snehil-Shah

Description

This RFC proposes adding auto-closing brackets in the REPL.

@kgryte @Planeshifter @Pranavchiku will this be a good addition?

Related Issues

Related Issue stdlib-js/google-summer-of-code#1

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

Activity

  1. stdlib-bot commented on Mar 3, 2024

    @stdlib-bot
    Contributor

    👋 Hi there! 👋

    And thank you for opening your first issue! We will get back to you shortly. 🏃 💨

  2. added
    EnhancementIssue or pull request for enhancing existing functionality.
    RFCRequest for comments. Feature requests and proposed changes.
    REPLIssue or pull request specific to the project REPL.
    JavaScriptIssue involves or relates to JavaScript.
    on Mar 3, 2024
  3. kgryte commented on Mar 3, 2024

    @kgryte
    Member

    Thanks for opening this issue, @Snehil-Shah. By auto-closing brackets, what is the behavior you have in mind? Are you thinking behavior similar to an IDE where if you type [ or (, we automatically append ] or ), respectively?

  4. Snehil-Shah commented on Mar 3, 2024

    @Snehil-Shah
    MemberAuthor

    Thanks for opening this issue, @Snehil-Shah. By auto-closing brackets, what is the behavior you have in mind? Are you thinking behavior similar to an IDE where if you type [ or (, we automatically append ] or ), respectively?

    Yes!

  5. Snehil-Shah commented on Mar 3, 2024

    @Snehil-Shah
    MemberAuthor

    Thanks for opening this issue, @Snehil-Shah. By auto-closing brackets, what is the behavior you have in mind? Are you thinking behavior similar to an IDE where if you type [ or (, we automatically append ] or ), respectively?

    If the idea is good to be implemented, I would like to work on it..

  6. kgryte commented on Mar 3, 2024

    @kgryte
    Member

    @Snehil-Shah Yes, I can see that being useful and something that the REPL currently lacks. Similar to an IDE, we'd likely want this behavior to be capable of being controlled by a setting.

    If you'd like to work on this, feel free to do so.

  7. added
    AcceptedRFC feature request which has been accepted.
    on Mar 3, 2024
  8. kgryte commented on Mar 3, 2024

    @kgryte
    Member

    Do note, however, that we'll still need to support splitting over multiple lines. Meaning, if I type

    > function foo( <cursor> )

    and hit ENTER where <cursor> is (i.e., within brackets), we have some ambiguity: do we want to execute or move to the next line?

    Currently, when a user types an incomplete expression and hits ENTER, the cursor moves to the next line without executing the expression.

    One way to support the above behavior is to support modifier keys (e.g., SHIFT+ENTER) to allow insertion of a newline when within a valid expression.

  9. Snehil-Shah commented on Mar 3, 2024

    @Snehil-Shah
    MemberAuthor

    @Snehil-Shah Yes, I can see that being useful and something that the REPL currently lacks. Similar to an IDE, we'd likely want this behavior to be capable of being controlled by a setting.

    If you'd like to work on this, feel free to do so.

    "Controlled by a setting", do you mean an option to disable this behaviour?

  10. kgryte commented on Mar 3, 2024

    @kgryte
    Member

    Yes, that is correct. In editors, you can typically disable this setting. Some folks don't like auto-closing brackets, preferring instead to avoid magic and to manually type brackets.

  11. changed the title [-][RFC]: add auto-closing brackets in REPL[/-] [+][RFC]: add auto-closing brackets and quotations in REPL[/+] on Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AcceptedRFC feature request which has been accepted.EnhancementIssue or pull request for enhancing existing functionality.JavaScriptIssue involves or relates to JavaScript.REPLIssue or pull request specific to the project REPL.RFCRequest for comments. Feature requests and proposed changes.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions