{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/175270060","pull_request_review_id":104778272,"id":175270060,"diff_hunk":"@@ -34,14 +32,64 @@ protected override bool CanFind(IMethodSymbol symbol)\n             return result;\n         }\n \n-        protected override Task<ImmutableArray<Document>> DetermineDocumentsToSearchAsync(IMethodSymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)\n+        protected override async Task<ImmutableArray<Document>> DetermineDocumentsToSearchAsync(IMethodSymbol symbol, Project project, IImmutableSet<Document> documents, SymbolFinderOptions options, CancellationToken cancellationToken)\n         {\n-            return FindDocumentsAsync(project, documents, cancellationToken, symbol.Name);\n+            var explicitUsages = await FindDocumentsAsync(project, documents, cancellationToken, symbol.Name).ConfigureAwait(false);\n+\n+            var property = symbol.AssociatedSymbol as IPropertySymbol;\n+            if (property == null || !options.IncludeImplicitAccessorUsages)\n+            {\n+                return explicitUsages;\n+            }\n+\n+            return explicitUsages.Concat(await FindDocumentsAsync(project, documents, cancellationToken, property.Name).ConfigureAwait(false));\n         }\n \n-        protected override Task<ImmutableArray<ReferenceLocation>> FindReferencesInDocumentAsync(IMethodSymbol symbol, Document document, CancellationToken cancellationToken)\n+        protected override async Task<ImmutableArray<ReferenceLocation>> FindReferencesInDocumentAsync(IMethodSymbol symbol, Document document, SymbolFinderOptions options, CancellationToken cancellationToken)\n         {\n-            return FindReferencesInDocumentUsingSymbolNameAsync(symbol, document, cancellationToken);\n+            var explicitUsages = await FindReferencesInDocumentUsingSymbolNameAsync(symbol, document, cancellationToken).ConfigureAwait(false);\n+\n+            var property = symbol.AssociatedSymbol as IPropertySymbol;","path":"src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/PropertyAccessorSymbolReferenceFinder.cs","position":37,"original_position":37,"commit_id":"85bb56fcb7b72b8dbc48b036897603474a852ede","original_commit_id":"85bb56fcb7b72b8dbc48b036897603474a852ede","user":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars3.githubusercontent.com/u/4564579?v=4","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":"events?","created_at":"2018-03-17T21:02:12Z","updated_at":"2018-03-17T21:02:12Z","html_url":"https://github.com/dotnet/roslyn/pull/25561#discussion_r175270060","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25561","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/175270060"},"html":{"href":"https://github.com/dotnet/roslyn/pull/25561#discussion_r175270060"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25561"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/25561","id":175717475,"html_url":"https://github.com/dotnet/roslyn/pull/25561","diff_url":"https://github.com/dotnet/roslyn/pull/25561.diff","patch_url":"https://github.com/dotnet/roslyn/pull/25561.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/25561","number":25561,"state":"open","locked":false,"title":"[wip for review] Accessor specific search","user":{"login":"jnm2","id":8040367,"avatar_url":"https://avatars2.githubusercontent.com/u/8040367?v=4","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"body":"Addresses https://github.com/dotnet/roslyn/issues/24877. When you ask to find references of an accessor, only results  for that accessor will be returned. I need feedback on the direction and implementation. \r\n\r\n`IsWrittenTo` is a hack since it can't distinguish between:\r\n  - `nameof(Property)`: no accessor—mistakenly included in getter search\r\n  - `_ = Property`: getter\r\n  - `Property++`: getter *and* setter—mistakenly excluded from getter search\r\n\r\nAnd `IsWrittenTo` will be useless for event accessors. We will want the proposed `SemanticModel.GetAccessors` at https://github.com/dotnet/roslyn/issues/25057#issuecomment-368659777.\r\n\r\nFor images see https://github.com/dotnet/roslyn/issues/22545#issuecomment-366847223. In that thread I'm talking about an simpler implementation which people didn't favor, https://github.com/dotnet/roslyn/compare/master...jnm2:accessor_specific_search(UI_only), but the behavior is identical at this moment.\r\n\r\nTODO:\r\n\r\n- [ ] confirm direction (PR is currently up to get reviews for this purpose)\r\n- [ ] ask about requiring `includeImplicitAccessorUsages` in the `PropertyAccessorSymbolReferenceFinder` constructor rather than sending SymbolFinderOptions through the `DetermineDocumentsToSearchAsync` and `FindReferencesInDocumentAsync`  signatures for all finders\r\n- [ ] write tests\r\n- [ ] same for event accessors\r\n\r\n/cc @CyrusNajmabadi, @jcouv, @MaStr11 ","created_at":"2018-03-17T19:36:57Z","updated_at":"2018-03-17T21:02:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ffded76101faa2b0d63efaaa0cf57274ea43096","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-ide","id":1781706,"slug":"roslyn-ide","description":"Roslyn IDE Team","privacy":"closed","url":"https://api.github.com/teams/1781706","members_url":"https://api.github.com/teams/1781706/members{/member}","repositories_url":"https://api.github.com/teams/1781706/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25561/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25561/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/25561/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/85bb56fcb7b72b8dbc48b036897603474a852ede","head":{"label":"jnm2:accessor_specific_search","ref":"accessor_specific_search","sha":"85bb56fcb7b72b8dbc48b036897603474a852ede","user":{"login":"jnm2","id":8040367,"avatar_url":"https://avatars2.githubusercontent.com/u/8040367?v=4","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"repo":{"id":92682284,"name":"roslyn","full_name":"jnm2/roslyn","owner":{"login":"jnm2","id":8040367,"avatar_url":"https://avatars2.githubusercontent.com/u/8040367?v=4","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jnm2/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/jnm2/roslyn","forks_url":"https://api.github.com/repos/jnm2/roslyn/forks","keys_url":"https://api.github.com/repos/jnm2/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jnm2/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jnm2/roslyn/teams","hooks_url":"https://api.github.com/repos/jnm2/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jnm2/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jnm2/roslyn/events","assignees_url":"https://api.github.com/repos/jnm2/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jnm2/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jnm2/roslyn/tags","blobs_url":"https://api.github.com/repos/jnm2/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jnm2/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jnm2/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jnm2/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jnm2/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jnm2/roslyn/languages","stargazers_url":"https://api.github.com/repos/jnm2/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jnm2/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jnm2/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jnm2/roslyn/subscription","commits_url":"https://api.github.com/repos/jnm2/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jnm2/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jnm2/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jnm2/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jnm2/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jnm2/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jnm2/roslyn/merges","archive_url":"https://api.github.com/repos/jnm2/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jnm2/roslyn/downloads","issues_url":"https://api.github.com/repos/jnm2/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jnm2/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jnm2/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jnm2/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jnm2/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jnm2/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/jnm2/roslyn/deployments","created_at":"2017-05-28T19:26:35Z","updated_at":"2017-05-28T19:27:14Z","pushed_at":"2018-03-17T06:42:00Z","git_url":"git://github.com/jnm2/roslyn.git","ssh_url":"git@github.com:jnm2/roslyn.git","clone_url":"https://github.com/jnm2/roslyn.git","svn_url":"https://github.com/jnm2/roslyn","homepage":"","size":290492,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"redundant_generated_ctor_call"}},"base":{"label":"dotnet:master","ref":"master","sha":"6ac2c2708f622a451fc395cf6673cfbc9244050b","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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://avatars0.githubusercontent.com/u/9141961?v=4","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":"2018-03-17T18:19:46Z","pushed_at":"2018-03-17T20:44:02Z","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":311201,"stargazers_count":8995,"watchers_count":8995,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2163,"mirror_url":null,"archived":false,"open_issues_count":4603,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":2163,"open_issues":4603,"watchers":8995,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25561"},"html":{"href":"https://github.com/dotnet/roslyn/pull/25561"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/25561"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/25561/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25561/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25561/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/85bb56fcb7b72b8dbc48b036897603474a852ede"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CyrusNajmabadi"}}