{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/62917822","id":62917822,"diff_hunk":"@@ -0,0 +1,132 @@\n+// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.\n+\n+using System.Threading.Tasks;\n+using Roslyn.Test.Utilities;\n+using Xunit;\n+\n+namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations\n+{\n+    [Test.Utilities.CompilerTrait(Test.Utilities.CompilerFeature.SourceGenerators)]\n+    public class ReplaceKeywordRecommenderTests : KeywordRecommenderTests\n+    {\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestMethodDeclaration1()\n+        {\n+            await VerifyKeywordAsync(@\"class C\n+{\n+    $$\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestMethodDeclaration2()\n+        {\n+            await VerifyKeywordAsync(@\"class C\n+{\n+    public $$\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestMethodDeclaration3()\n+        {\n+            await VerifyKeywordAsync(@\"class C\n+{\n+    $$ public void foo() { }\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestMethodDeclarationInGlobalStatement1()\n+        {\n+            const string text = @\"$$\";\n+            await VerifyKeywordAsync(SourceCodeKind.Script, text);\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestMethodDeclarationInGlobalStatement2()\n+        {\n+            const string text = @\"public $$\";\n+            await VerifyKeywordAsync(SourceCodeKind.Script, text);\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestExpressionContext()\n+        {\n+            await VerifyKeywordAsync(@\"class C\n+{\n+    void foo()\n+    {\n+        foo($$\n+    }\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestNotInParameter()\n+        {\n+            await VerifyAbsenceAsync(@\"class C\n+{\n+    void foo($$)\n+    {\n+    }\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestBeforeLambda()\n+        {\n+            await VerifyKeywordAsync(@\"\n+class Program\n+{\n+    static void Main(string[] args)\n+    {\n+        var z =  $$ () => 2;\n+    }\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestNotIfAlreadyAsync2()\n+        {\n+            await VerifyAbsenceAsync(@\"\n+class Program\n+{\n+    static void Main(string[] args)\n+    {\n+        var z = async $$ () => 2;\n+    }\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestNotInNamespace()\n+        {\n+            await VerifyAbsenceAsync(@\"\n+namespace Foo\n+{\n+    $$\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestNotAfterPartialInNamespace()\n+        {\n+            await VerifyAbsenceAsync(@\"\n+namespace Foo\n+{\n+    partial $$\n+}\");\n+        }\n+\n+        [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]\n+        public async Task TestNotAfterPartialInClass()\n+        {\n+            await VerifyAbsenceAsync(@\"\n+class Foo\n+{\n+    partial $$","path":"src/EditorFeatures/CSharpTest2/Recommendations/ReplaceKeywordRecommenderTests.cs","position":128,"original_position":128,"commit_id":"f7cf61f9de4c4af635faaaebf6e0c8aa3458edd2","original_commit_id":"2a0a8ba6843744868eb2ee5844c196eb6e97f45e","user":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars.githubusercontent.com/u/4564579?v=3","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"Or 'void' for hte case of methods.  I'm curious, are we not allowing replacements of partial methods?","created_at":"2016-05-11T20:12:32Z","updated_at":"2016-05-11T20:12:32Z","html_url":"https://github.com/dotnet/roslyn/pull/11231#discussion_r62917822","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11231","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/62917822"},"html":{"href":"https://github.com/dotnet/roslyn/pull/11231#discussion_r62917822"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11231"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/11231","id":69597036,"html_url":"https://github.com/dotnet/roslyn/pull/11231","diff_url":"https://github.com/dotnet/roslyn/pull/11231.diff","patch_url":"https://github.com/dotnet/roslyn/pull/11231.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/11231","number":11231,"state":"open","locked":false,"title":"Make keyword recommender know about \"replace\"","user":{"login":"VSadov","id":8218165,"avatar_url":"https://avatars.githubusercontent.com/u/8218165?v=3","gravatar_id":"","url":"https://api.github.com/users/VSadov","html_url":"https://github.com/VSadov","followers_url":"https://api.github.com/users/VSadov/followers","following_url":"https://api.github.com/users/VSadov/following{/other_user}","gists_url":"https://api.github.com/users/VSadov/gists{/gist_id}","starred_url":"https://api.github.com/users/VSadov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSadov/subscriptions","organizations_url":"https://api.github.com/users/VSadov/orgs","repos_url":"https://api.github.com/users/VSadov/repos","events_url":"https://api.github.com/users/VSadov/events{/privacy}","received_events_url":"https://api.github.com/users/VSadov/received_events","type":"User","site_admin":false},"body":"\"replace\" is roughly allowed in the same contexts as \"async\", so the \"replace\" recommender is basically a copy of \"async\" recommender.\r\n\r\nExcept for expressions contexts where \"async\" is allowed because of async lambdas, but \"replace\" is not because there is no such thing as replace lambdas.\r\n\r\nFixes: https://github.com/dotnet/roslyn/issues/11191","created_at":"2016-05-11T00:02:36Z","updated_at":"2016-05-11T20:12:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b91567bca156dcca15f9f44059be590b060b7c9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11231/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11231/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/11231/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/f7cf61f9de4c4af635faaaebf6e0c8aa3458edd2","head":{"label":"VSadov:generators","ref":"generators","sha":"f7cf61f9de4c4af635faaaebf6e0c8aa3458edd2","user":{"login":"VSadov","id":8218165,"avatar_url":"https://avatars.githubusercontent.com/u/8218165?v=3","gravatar_id":"","url":"https://api.github.com/users/VSadov","html_url":"https://github.com/VSadov","followers_url":"https://api.github.com/users/VSadov/followers","following_url":"https://api.github.com/users/VSadov/following{/other_user}","gists_url":"https://api.github.com/users/VSadov/gists{/gist_id}","starred_url":"https://api.github.com/users/VSadov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSadov/subscriptions","organizations_url":"https://api.github.com/users/VSadov/orgs","repos_url":"https://api.github.com/users/VSadov/repos","events_url":"https://api.github.com/users/VSadov/events{/privacy}","received_events_url":"https://api.github.com/users/VSadov/received_events","type":"User","site_admin":false},"repo":{"id":30550950,"name":"roslyn","full_name":"VSadov/roslyn","owner":{"login":"VSadov","id":8218165,"avatar_url":"https://avatars.githubusercontent.com/u/8218165?v=3","gravatar_id":"","url":"https://api.github.com/users/VSadov","html_url":"https://github.com/VSadov","followers_url":"https://api.github.com/users/VSadov/followers","following_url":"https://api.github.com/users/VSadov/following{/other_user}","gists_url":"https://api.github.com/users/VSadov/gists{/gist_id}","starred_url":"https://api.github.com/users/VSadov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSadov/subscriptions","organizations_url":"https://api.github.com/users/VSadov/orgs","repos_url":"https://api.github.com/users/VSadov/repos","events_url":"https://api.github.com/users/VSadov/events{/privacy}","received_events_url":"https://api.github.com/users/VSadov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VSadov/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/VSadov/roslyn","forks_url":"https://api.github.com/repos/VSadov/roslyn/forks","keys_url":"https://api.github.com/repos/VSadov/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VSadov/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VSadov/roslyn/teams","hooks_url":"https://api.github.com/repos/VSadov/roslyn/hooks","issue_events_url":"https://api.github.com/repos/VSadov/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/VSadov/roslyn/events","assignees_url":"https://api.github.com/repos/VSadov/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/VSadov/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/VSadov/roslyn/tags","blobs_url":"https://api.github.com/repos/VSadov/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VSadov/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VSadov/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/VSadov/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VSadov/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/VSadov/roslyn/languages","stargazers_url":"https://api.github.com/repos/VSadov/roslyn/stargazers","contributors_url":"https://api.github.com/repos/VSadov/roslyn/contributors","subscribers_url":"https://api.github.com/repos/VSadov/roslyn/subscribers","subscription_url":"https://api.github.com/repos/VSadov/roslyn/subscription","commits_url":"https://api.github.com/repos/VSadov/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/VSadov/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/VSadov/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/VSadov/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/VSadov/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/VSadov/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VSadov/roslyn/merges","archive_url":"https://api.github.com/repos/VSadov/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VSadov/roslyn/downloads","issues_url":"https://api.github.com/repos/VSadov/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/VSadov/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/VSadov/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/VSadov/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VSadov/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/VSadov/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/VSadov/roslyn/deployments","created_at":"2015-02-09T18:24:54Z","updated_at":"2016-02-12T19:18:20Z","pushed_at":"2016-05-11T18:13:59Z","git_url":"git://github.com/VSadov/roslyn.git","ssh_url":"git@github.com:VSadov/roslyn.git","clone_url":"https://github.com/VSadov/roslyn.git","svn_url":"https://github.com/VSadov/roslyn","homepage":"","size":157570,"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:features/generators","ref":"features/generators","sha":"ce2e2f0c23f5c17b65f1906b27492923aef598a0","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}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2016-05-11T15:25:38Z","pushed_at":"2016-05-11T20:10:53Z","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":292696,"stargazers_count":5085,"watchers_count":5085,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1282,"mirror_url":null,"open_issues_count":2845,"forks":1282,"open_issues":2845,"watchers":5085,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11231"},"html":{"href":"https://github.com/dotnet/roslyn/pull/11231"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/11231"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/11231/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11231/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11231/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/f7cf61f9de4c4af635faaaebf6e0c8aa3458edd2"}}}}