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鈥檒l 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

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
@sharwell sharwell added this to In Queue in IDE: Design review via automation Oct 22, 2020
@sharwell sharwell moved this from In Queue to On deck in IDE: Design review Oct 22, 2020
@jinujoseph jinujoseph added this to the Backlog milestone Oct 27, 2020
@jinujoseph jinujoseph added this to Backlog in IDE: InternalPriority via automation Nov 4, 2020
@jinujoseph jinujoseph moved this from Backlog to Priority 2 in IDE: InternalPriority Nov 4, 2020
@sharwell sharwell moved this from On deck to Need Update in IDE: Design review Nov 9, 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
@jinujoseph jinujoseph moved this from Need Update to Complete in IDE: Design review Mar 31, 2021
@jinujoseph jinujoseph moved this from Priority 2 to Completed in IDE: InternalPriority Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
IDE: Design review
  
Complete
Development

No branches or pull requests

4 participants