{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/67585038","id":67585038,"diff_hunk":"@@ -0,0 +1,97 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading;\n+using System.Threading.Tasks;\n+using Microsoft.CodeAnalysis.LanguageServices;\n+using Microsoft.CodeAnalysis.Options;\n+using Microsoft.CodeAnalysis.Recommendations;\n+using Microsoft.CodeAnalysis.Shared.Extensions;\n+using Microsoft.CodeAnalysis.Shared.Extensions.ContextQuery;\n+using Microsoft.CodeAnalysis.Shared.Utilities;\n+using Microsoft.CodeAnalysis.Text;\n+using Roslyn.Utilities;\n+\n+namespace Microsoft.CodeAnalysis.Completion.Providers\n+{\n+    internal abstract class AbstractRecommendationServiceBasedCompletionProvider : AbstractSymbolCompletionProvider\n+    {\n+        protected override Task<IEnumerable<ISymbol>> GetSymbolsWorker(AbstractSyntaxContext context, int position, OptionSet options, CancellationToken cancellationToken)\n+        {\n+            var recommender = context.GetLanguageService<IRecommendationService>();\n+            return recommender.GetRecommendedSymbolsAtPositionAsync(context.Workspace, context.SemanticModel, position, options, cancellationToken);\n+        }\n+\n+        protected override async Task<IEnumerable<ISymbol>> GetPreselectedSymbolsWorker(AbstractSyntaxContext context, int position, OptionSet options, CancellationToken cancellationToken)\n+        {\n+            var recommender = context.GetLanguageService<IRecommendationService>();\n+            var typeInferrer = context.GetLanguageService<ITypeInferenceService>();\n+\n+            var inferredTypes = typeInferrer.InferTypes(context.SemanticModel, position, cancellationToken)\n+                .Where(t => t.SpecialType != SpecialType.System_Void)\n+                .ToSet();\n+            if (inferredTypes.Count == 0)\n+            {\n+                return SpecializedCollections.EmptyEnumerable<ISymbol>();\n+            }\n+\n+            var symbols = await recommender.GetRecommendedSymbolsAtPositionAsync(\n+                context.Workspace, \n+                context.SemanticModel, \n+                position, \n+                options, \n+                cancellationToken).ConfigureAwait(false);\n+            return symbols.Where(s => inferredTypes.Contains(GetSymbolType(s)) && !IsInstrinsic(s));","path":"src/Features/Core/Portable/Completion/Providers/AbstractRecommendationServiceBasedCompletionProvider.cs","position":45,"original_position":45,"commit_id":"08f8911a0b6304249313ee04c965ad38c148e08e","original_commit_id":"08f8911a0b6304249313ee04c965ad38c148e08e","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":"Remind me why we woudl not want to preselect an intrinsic type?  Also comment why in the code.","created_at":"2016-06-17T22:43:25Z","updated_at":"2016-06-17T22:43:25Z","html_url":"https://github.com/dotnet/roslyn/pull/11729#discussion_r67585038","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11729","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/67585038"},"html":{"href":"https://github.com/dotnet/roslyn/pull/11729#discussion_r67585038"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11729"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/11729","id":72423542,"html_url":"https://github.com/dotnet/roslyn/pull/11729","diff_url":"https://github.com/dotnet/roslyn/pull/11729.diff","patch_url":"https://github.com/dotnet/roslyn/pull/11729.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/11729","number":11729,"state":"open","locked":false,"title":"Implement \"target type preselection\" redux","user":{"login":"rchande","id":3751401,"avatar_url":"https://avatars.githubusercontent.com/u/3751401?v=3","gravatar_id":"","url":"https://api.github.com/users/rchande","html_url":"https://github.com/rchande","followers_url":"https://api.github.com/users/rchande/followers","following_url":"https://api.github.com/users/rchande/following{/other_user}","gists_url":"https://api.github.com/users/rchande/gists{/gist_id}","starred_url":"https://api.github.com/users/rchande/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchande/subscriptions","organizations_url":"https://api.github.com/users/rchande/orgs","repos_url":"https://api.github.com/users/rchande/repos","events_url":"https://api.github.com/users/rchande/events{/privacy}","received_events_url":"https://api.github.com/users/rchande/received_events","type":"User","site_admin":false},"body":"This is https://github.com/dotnet/roslyn/pull/6878 merged against Matt's big completion refactoring--almost all of code is the same as before. Now, instead of a function called on a provider to determine which of its two items were better, the MatchPriority enum (should this be an int) now includes many levels of priority.\r\n\r\n","created_at":"2016-06-02T21:50:34Z","updated_at":"2016-06-17T22:43:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f592acd3178a755891f2414fa3d0733dbb2cf081","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11729/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/11729/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/11729/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/08f8911a0b6304249313ee04c965ad38c148e08e","head":{"label":"rchande:ttp","ref":"ttp","sha":"08f8911a0b6304249313ee04c965ad38c148e08e","user":{"login":"rchande","id":3751401,"avatar_url":"https://avatars.githubusercontent.com/u/3751401?v=3","gravatar_id":"","url":"https://api.github.com/users/rchande","html_url":"https://github.com/rchande","followers_url":"https://api.github.com/users/rchande/followers","following_url":"https://api.github.com/users/rchande/following{/other_user}","gists_url":"https://api.github.com/users/rchande/gists{/gist_id}","starred_url":"https://api.github.com/users/rchande/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchande/subscriptions","organizations_url":"https://api.github.com/users/rchande/orgs","repos_url":"https://api.github.com/users/rchande/repos","events_url":"https://api.github.com/users/rchande/events{/privacy}","received_events_url":"https://api.github.com/users/rchande/received_events","type":"User","site_admin":false},"repo":{"id":30547830,"name":"roslyn","full_name":"rchande/roslyn","owner":{"login":"rchande","id":3751401,"avatar_url":"https://avatars.githubusercontent.com/u/3751401?v=3","gravatar_id":"","url":"https://api.github.com/users/rchande","html_url":"https://github.com/rchande","followers_url":"https://api.github.com/users/rchande/followers","following_url":"https://api.github.com/users/rchande/following{/other_user}","gists_url":"https://api.github.com/users/rchande/gists{/gist_id}","starred_url":"https://api.github.com/users/rchande/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchande/subscriptions","organizations_url":"https://api.github.com/users/rchande/orgs","repos_url":"https://api.github.com/users/rchande/repos","events_url":"https://api.github.com/users/rchande/events{/privacy}","received_events_url":"https://api.github.com/users/rchande/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rchande/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/rchande/roslyn","forks_url":"https://api.github.com/repos/rchande/roslyn/forks","keys_url":"https://api.github.com/repos/rchande/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rchande/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rchande/roslyn/teams","hooks_url":"https://api.github.com/repos/rchande/roslyn/hooks","issue_events_url":"https://api.github.com/repos/rchande/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/rchande/roslyn/events","assignees_url":"https://api.github.com/repos/rchande/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/rchande/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/rchande/roslyn/tags","blobs_url":"https://api.github.com/repos/rchande/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rchande/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rchande/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/rchande/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rchande/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/rchande/roslyn/languages","stargazers_url":"https://api.github.com/repos/rchande/roslyn/stargazers","contributors_url":"https://api.github.com/repos/rchande/roslyn/contributors","subscribers_url":"https://api.github.com/repos/rchande/roslyn/subscribers","subscription_url":"https://api.github.com/repos/rchande/roslyn/subscription","commits_url":"https://api.github.com/repos/rchande/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/rchande/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/rchande/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/rchande/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/rchande/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/rchande/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rchande/roslyn/merges","archive_url":"https://api.github.com/repos/rchande/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rchande/roslyn/downloads","issues_url":"https://api.github.com/repos/rchande/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/rchande/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/rchande/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/rchande/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rchande/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/rchande/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/rchande/roslyn/deployments","created_at":"2015-02-09T17:16:21Z","updated_at":"2015-02-09T17:16:48Z","pushed_at":"2016-06-17T22:27:26Z","git_url":"git://github.com/rchande/roslyn.git","ssh_url":"git@github.com:rchande/roslyn.git","clone_url":"https://github.com/rchande/roslyn.git","svn_url":"https://github.com/rchande/roslyn","homepage":"","size":162501,"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":"5416d9c8111a39e3f7a84f52cfb4d9123e1328e5","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-06-17T21:56:30Z","pushed_at":"2016-06-17T22:27:27Z","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":305052,"stargazers_count":5580,"watchers_count":5580,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1339,"mirror_url":null,"open_issues_count":2954,"forks":1339,"open_issues":2954,"watchers":5580,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11729"},"html":{"href":"https://github.com/dotnet/roslyn/pull/11729"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/11729"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/11729/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11729/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/11729/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/08f8911a0b6304249313ee04c965ad38c148e08e"}}}}
{"actor":{"display_login":"CyrusNajmabadi"}}