{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/41566457","id":41566457,"diff_hunk":"@@ -44,9 +45,21 @@ protected void Test(string expected, string code, bool completionActive = false)\n                                         GetExportedValue<ITextUndoHistoryRegistry>(workspace),\n                                         GetExportedValue<IEditorOperationsFactoryService>(workspace));\n \n-                commandHandler.ExecuteCommand(new AutomaticLineEnderCommandArgs(view, buffer), CreateNextHandler(workspace));\n+                commandHandler.ExecuteCommand(new AutomaticLineEnderCommandArgs(view, buffer),\n+                                                    assertNextHandlerInvoked\n+                                                        ? () => { nextHandlerInvoked = true; }\n+                                                        : CreateNextHandler(workspace));\n \n                 Test(view, buffer, expected);\n+\n+                if (assertNextHandlerInvoked)","path":"src/EditorFeatures/Test/AutomaticCompletion/AbstractAutomaticLineEnderTests.cs","position":27,"original_position":27,"commit_id":"2ec7b2b6c3426f684a9b664275956f3db0ea6e9d","original_commit_id":"2ec7b2b6c3426f684a9b664275956f3db0ea6e9d","user":{"login":"balajikris","id":4213867,"avatar_url":"https://avatars.githubusercontent.com/u/4213867?v=3","gravatar_id":"","url":"https://api.github.com/users/balajikris","html_url":"https://github.com/balajikris","followers_url":"https://api.github.com/users/balajikris/followers","following_url":"https://api.github.com/users/balajikris/following{/other_user}","gists_url":"https://api.github.com/users/balajikris/gists{/gist_id}","starred_url":"https://api.github.com/users/balajikris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajikris/subscriptions","organizations_url":"https://api.github.com/users/balajikris/orgs","repos_url":"https://api.github.com/users/balajikris/repos","events_url":"https://api.github.com/users/balajikris/events{/privacy}","received_events_url":"https://api.github.com/users/balajikris/received_events","type":"User","site_admin":false},"body":"Nice. thanks.","created_at":"2015-10-08T20:46:02Z","updated_at":"2015-10-08T20:46:02Z","html_url":"https://github.com/dotnet/roslyn/pull/5790#discussion_r41566457","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/5790","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/41566457"},"html":{"href":"https://github.com/dotnet/roslyn/pull/5790#discussion_r41566457"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/5790"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/5790","id":47197179,"html_url":"https://github.com/dotnet/roslyn/pull/5790","diff_url":"https://github.com/dotnet/roslyn/pull/5790.diff","patch_url":"https://github.com/dotnet/roslyn/pull/5790.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/5790","number":5790,"state":"open","locked":false,"title":"Smartly handle Shift+Enter better... ","user":{"login":"balajikris","id":4213867,"avatar_url":"https://avatars.githubusercontent.com/u/4213867?v=3","gravatar_id":"","url":"https://api.github.com/users/balajikris","html_url":"https://github.com/balajikris","followers_url":"https://api.github.com/users/balajikris/followers","following_url":"https://api.github.com/users/balajikris/following{/other_user}","gists_url":"https://api.github.com/users/balajikris/gists{/gist_id}","starred_url":"https://api.github.com/users/balajikris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajikris/subscriptions","organizations_url":"https://api.github.com/users/balajikris/orgs","repos_url":"https://api.github.com/users/balajikris/repos","events_url":"https://api.github.com/users/balajikris/events{/privacy}","received_events_url":"https://api.github.com/users/balajikris/received_events","type":"User","site_admin":false},"body":"...by treating it as Enter where user can unintentionally have\r\nShift key pressed while hitting Enter.\r\n\r\nIn cases of pressing shift+enter after typing open parenthesis to open a block, assuming brace completion is on, we produced code like this:\r\n\r\ninitial:\r\n```C#\r\ntry { |}\r\n```\r\nfinal:\r\n```C#\r\ntry { }\r\n|\r\n```\r\nbasically, in such a case, we didn't have anything to complete the line (like a semicolon that we need to insert), yet we handled it anyway and inserted a Newline after the block and positioned caret on the next line.\r\n\r\na better output here could be what we produce on enter:\r\n\r\n```C#\r\ntry\r\n{\r\n    |\r\n}\r\n```\r\n\r\nthe implementation is simple: detect cases like this and delegate the command to the editor whose default implementation is exactly what we need.\r\n\r\nFixes internal bug 150480. \r\nAlso this: http://stackoverflow.com/questions/32259287/visual-studio-2015-brackets-not-automatically-formatting-when-pressing-shift","created_at":"2015-10-08T19:43:41Z","updated_at":"2015-10-08T20:46:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a1d29b93ed27ce85c20e818f5044e0d4a3f410d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/5790/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/5790/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5790/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/2ec7b2b6c3426f684a9b664275956f3db0ea6e9d","head":{"label":"balajikris:TypingShiftEnter","ref":"TypingShiftEnter","sha":"2ec7b2b6c3426f684a9b664275956f3db0ea6e9d","user":{"login":"balajikris","id":4213867,"avatar_url":"https://avatars.githubusercontent.com/u/4213867?v=3","gravatar_id":"","url":"https://api.github.com/users/balajikris","html_url":"https://github.com/balajikris","followers_url":"https://api.github.com/users/balajikris/followers","following_url":"https://api.github.com/users/balajikris/following{/other_user}","gists_url":"https://api.github.com/users/balajikris/gists{/gist_id}","starred_url":"https://api.github.com/users/balajikris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajikris/subscriptions","organizations_url":"https://api.github.com/users/balajikris/orgs","repos_url":"https://api.github.com/users/balajikris/repos","events_url":"https://api.github.com/users/balajikris/events{/privacy}","received_events_url":"https://api.github.com/users/balajikris/received_events","type":"User","site_admin":false},"repo":{"id":30552969,"name":"roslyn","full_name":"balajikris/roslyn","owner":{"login":"balajikris","id":4213867,"avatar_url":"https://avatars.githubusercontent.com/u/4213867?v=3","gravatar_id":"","url":"https://api.github.com/users/balajikris","html_url":"https://github.com/balajikris","followers_url":"https://api.github.com/users/balajikris/followers","following_url":"https://api.github.com/users/balajikris/following{/other_user}","gists_url":"https://api.github.com/users/balajikris/gists{/gist_id}","starred_url":"https://api.github.com/users/balajikris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajikris/subscriptions","organizations_url":"https://api.github.com/users/balajikris/orgs","repos_url":"https://api.github.com/users/balajikris/repos","events_url":"https://api.github.com/users/balajikris/events{/privacy}","received_events_url":"https://api.github.com/users/balajikris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balajikris/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/balajikris/roslyn","forks_url":"https://api.github.com/repos/balajikris/roslyn/forks","keys_url":"https://api.github.com/repos/balajikris/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balajikris/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balajikris/roslyn/teams","hooks_url":"https://api.github.com/repos/balajikris/roslyn/hooks","issue_events_url":"https://api.github.com/repos/balajikris/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/balajikris/roslyn/events","assignees_url":"https://api.github.com/repos/balajikris/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/balajikris/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/balajikris/roslyn/tags","blobs_url":"https://api.github.com/repos/balajikris/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balajikris/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balajikris/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/balajikris/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balajikris/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/balajikris/roslyn/languages","stargazers_url":"https://api.github.com/repos/balajikris/roslyn/stargazers","contributors_url":"https://api.github.com/repos/balajikris/roslyn/contributors","subscribers_url":"https://api.github.com/repos/balajikris/roslyn/subscribers","subscription_url":"https://api.github.com/repos/balajikris/roslyn/subscription","commits_url":"https://api.github.com/repos/balajikris/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/balajikris/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/balajikris/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/balajikris/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/balajikris/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/balajikris/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balajikris/roslyn/merges","archive_url":"https://api.github.com/repos/balajikris/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balajikris/roslyn/downloads","issues_url":"https://api.github.com/repos/balajikris/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/balajikris/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/balajikris/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/balajikris/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balajikris/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/balajikris/roslyn/releases{/id}","created_at":"2015-02-09T19:08:10Z","updated_at":"2015-05-08T19:50:21Z","pushed_at":"2015-10-08T20:02:58Z","git_url":"git://github.com/balajikris/roslyn.git","ssh_url":"git@github.com:balajikris/roslyn.git","clone_url":"https://github.com/balajikris/roslyn.git","svn_url":"https://github.com/balajikris/roslyn","homepage":"","size":99611,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"eb10126f30311bb67b5b89b38f61623da2c05bd2","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-10-08T16:10:43Z","pushed_at":"2015-10-08T20:24:22Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":204386,"stargazers_count":3449,"watchers_count":3449,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":810,"mirror_url":null,"open_issues_count":1493,"forks":810,"open_issues":1493,"watchers":3449,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/5790"},"html":{"href":"https://github.com/dotnet/roslyn/pull/5790"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/5790"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/5790/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/5790/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/5790/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/2ec7b2b6c3426f684a9b664275956f3db0ea6e9d"}}}}