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

Expand Edit.SmartBreakLine handling to more scenarios #48857

Closed
sharwell opened this issue Oct 22, 2020 · 0 comments
Closed

Expand Edit.SmartBreakLine handling to more scenarios #48857

sharwell opened this issue Oct 22, 2020 · 0 comments
Assignees
Milestone

Comments

@sharwell
Copy link
Member

sharwell commented Oct 22, 2020

🔗 Related to #18065

Currently Edit.SmartBreakLine (Shift+Enter) is not particularly useful. It should be updated to have the following behavior:

  1. (Addresses Shift-Enter commits completion, but doesn't complete the current statement #18065) If completion is active, the editor commits the current completion and, if the item is a method name where a method group expression is not allowed, automatically inserts the ( and ).

  2. If the current caret context is a parent statement that can have a block child (e.g. the span i[|f (condition)|]), the command inserts a new set of braces as the child and places the caret within those braces:

    if (condition)
    {
        $$
    }
    
  3. (Addresses AB#1058964) If the current caret context is a member header which can have braces (e.g. v[|oid Method()|]), the command inserts the braces and places the caret within:

    void Method()
    {
        $$
    }
    
  4. If the current caret context is an expression statement already terminated by a ;, the editor moves to the end of the existing ; and behaves as though Enter was pressed.

  5. If the current caret context is in an expression statement not already terminated by ;, the editor behaves as though ;, Enter was pressed.

  6. (Specifically per Object Intellisense Completion for Init-Only Classes #46297) If the current expression is an object creation expression:

    • If the objection creation expression does not already have braces for an object or collection initializer, the braces are added and the caret is placed within them
    • If the object creation expression already has braces for an object or collection initializer, the editor first removes the braces if they are empty and then treats the command the same way it does for other expression statements.
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 22, 2020
@sharwell sharwell added Need Design Review The end user experience design needs to be reviewed and approved. Story Area-IDE and removed Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 22, 2020
@jinujoseph jinujoseph added this to the Backlog milestone Oct 27, 2020
@Cosifne Cosifne closed this as completed Dec 4, 2020
@Cosifne Cosifne reopened this Dec 4, 2020
@Cosifne Cosifne closed this as completed Feb 26, 2021
@jinujoseph jinujoseph removed the Need Design Review The end user experience design needs to be reviewed and approved. label Mar 31, 2021
@sharwell sharwell moved this to Complete in IDE: Design review Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants