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

Shift-Enter commits completion, but doesn't complete the current statement #18065

Closed
dpoeschl opened this issue Mar 22, 2017 · 4 comments · Fixed by #67020
Closed

Shift-Enter commits completion, but doesn't complete the current statement #18065

dpoeschl opened this issue Mar 22, 2017 · 4 comments · Fixed by #67020
Assignees
Milestone

Comments

@dpoeschl
Copy link
Contributor

dpoeschl commented Mar 22, 2017

Version Used: VS2015 and VS2017

Steps to Reproduce:

  1. Paste C# code:
class Program
{
    static void Main(string[] args)
    {
        Main
    }
}
  1. Type (ar
  2. The completion list should be up with "args" selected
  3. Type Shift+Enter

Expected Behavior: Completion is committed, and the current statement is completed (semicolon added, newline added, caret moved to next line)

Actual Behavior: Completion is committed.

@dpoeschl
Copy link
Contributor Author

I'm not porting a CSharpFormatting integration test that asserts the wrong behavior, so there is no integration test coverage. Please make sure this is appropriately tested.

@sharwell
Copy link
Member

Additional information here:

  • Visual Studio 2013 introduced brace matching sessions, but did not have the Edit.SmartBreakLine command. In that release Enter and Shift+Enter are bound to the same command (Edit.BreakLine).
  • In both Visual Studio 2015 and Visual Studio 2017, the Shift+Enter command works as you describe when a completion session is not active. The bug here only occurs when a completion session is active.

@sharwell sharwell added the Bug label Mar 23, 2017
@Pilchie Pilchie added this to the 15.3 milestone Mar 25, 2017
@Pilchie Pilchie assigned rchande and unassigned CyrusNajmabadi Mar 25, 2017
@dpoeschl
Copy link
Contributor Author

In VB, it completes the current statement but doesn't commit completion...

@Pilchie Pilchie modified the milestones: 15.later, 15.3 Apr 10, 2017
@rchande
Copy link
Contributor

rchande commented Apr 19, 2017

In C#, the automatic line ender command handler is ordered after completion, which never passes along the automatic line ender command.
In VB, the automatic line ender command handler is ordered before completion and never passes long the command.
This appears to be the case even in Dev14 RTM...

rchande pushed a commit to rchande/roslyn that referenced this issue Jul 19, 2017
If completion and brace completion are both active, shift-enter should
commit both and complete the statement. This was not working because the
completion command handler never called next handler for shift-enter and
the line ender command handler was not ordered correctly.

Fixes dotnet#18065
@jinujoseph jinujoseph modified the milestones: 15.6, Unknown Nov 3, 2017
sharwell added a commit to sharwell/roslyn that referenced this issue Mar 31, 2021
sharwell added a commit to sharwell/roslyn that referenced this issue Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants