{"action":"opened","number":25392,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/25392","id":174134373,"html_url":"https://github.com/dotnet/roslyn/pull/25392","diff_url":"https://github.com/dotnet/roslyn/pull/25392.diff","patch_url":"https://github.com/dotnet/roslyn/pull/25392.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/25392","number":25392,"state":"open","locked":false,"title":"Refactor CodeModel hookup","user":{"login":"jasonmalinowski","id":201340,"avatar_url":"https://avatars3.githubusercontent.com/u/201340?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"body":"This refactors how our CodeModel types are coupled to AbstractProject.\r\n\r\n**Before the change:** It was assumed that each concrete derived type of AbstractProject implemented an interface IProjectCodeModelProvider which is type that only existed in ServicesVisualStudioImpl. Thus, the derived types had to depend on ServicesVisualStudioImpl (forcing CPSProject to be there for no other good reason). Each concrete derived type was expected to handle the creation of an AbstractProjectCodeModel, with C#/VB/CPS each creating a derived type. Each concrete derived type also overrode various methods from the AbstractProject which they then had to forward to their respective AbstractProjectCodeModel with the exact same logic; failure to do so would break something.\r\n\r\n**After the change:** AbstractProjectCodeModel is now a sealed class (ProjectCodeModel), and an interface is introduced for the parts that all project systems need to tell it. This interface is in AbstractProject directly, so all the virtual methods that _must_ be overridden are now gone. Creating a ProjectCodeModel now requires you to provide an ICodeModelInstanceFactory that was the only \"real\" reason we needed polymorphism there: sometimes it's necessary to go ask the project system to create a FileCodeModel, so that is now broken out as a provider type.\r\n\r\nThis doesn't _quite_ go all the way, but the intent here is the CodeModel code no longer needs anything really from AbstractProject other than to be called through a \"public\" interface of IProjectCodeModel. The field on AbstractProject is still icky, but if we create an IProjectCodeModelFactory that just maintains an internal map of ProjectId -> ProjectCodeModel, then the system is entirely decoupled. I am stopping one step short of that with this PR.\r\n\r\nI **HIGHLY SUGGEST** you review this a commit at time. Each commit is a \"building block\" refactoring which should be digestible in itself. Many of the refactorings then \"standard\" refactoring operations that are fairly mechanical.","created_at":"2018-03-09T23:37:07Z","updated_at":"2018-03-09T23:37:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25392/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/25392/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/25392/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/6a48272e234de3792984310833416c51c1b71920","head":{"label":"jasonmalinowski:refactor-codemodel-hookup","ref":"refactor-codemodel-hookup","sha":"6a48272e234de3792984310833416c51c1b71920","user":{"login":"jasonmalinowski","id":201340,"avatar_url":"https://avatars3.githubusercontent.com/u/201340?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"repo":{"id":30048558,"name":"roslyn","full_name":"jasonmalinowski/roslyn","owner":{"login":"jasonmalinowski","id":201340,"avatar_url":"https://avatars3.githubusercontent.com/u/201340?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasonmalinowski/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/jasonmalinowski/roslyn","forks_url":"https://api.github.com/repos/jasonmalinowski/roslyn/forks","keys_url":"https://api.github.com/repos/jasonmalinowski/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasonmalinowski/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasonmalinowski/roslyn/teams","hooks_url":"https://api.github.com/repos/jasonmalinowski/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jasonmalinowski/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jasonmalinowski/roslyn/events","assignees_url":"https://api.github.com/repos/jasonmalinowski/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jasonmalinowski/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jasonmalinowski/roslyn/tags","blobs_url":"https://api.github.com/repos/jasonmalinowski/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasonmalinowski/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasonmalinowski/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasonmalinowski/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasonmalinowski/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jasonmalinowski/roslyn/languages","stargazers_url":"https://api.github.com/repos/jasonmalinowski/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jasonmalinowski/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jasonmalinowski/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jasonmalinowski/roslyn/subscription","commits_url":"https://api.github.com/repos/jasonmalinowski/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasonmalinowski/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasonmalinowski/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasonmalinowski/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasonmalinowski/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jasonmalinowski/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasonmalinowski/roslyn/merges","archive_url":"https://api.github.com/repos/jasonmalinowski/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasonmalinowski/roslyn/downloads","issues_url":"https://api.github.com/repos/jasonmalinowski/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jasonmalinowski/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jasonmalinowski/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jasonmalinowski/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasonmalinowski/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jasonmalinowski/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/jasonmalinowski/roslyn/deployments","created_at":"2015-01-30T00:33:25Z","updated_at":"2016-11-08T00:55:06Z","pushed_at":"2018-03-09T23:22:27Z","git_url":"git://github.com/jasonmalinowski/roslyn.git","ssh_url":"git@github.com:jasonmalinowski/roslyn.git","clone_url":"https://github.com/jasonmalinowski/roslyn.git","svn_url":"https://github.com/jasonmalinowski/roslyn","homepage":"","size":267013,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"master"}},"base":{"label":"dotnet:dev15.7.x","ref":"dev15.7.x","sha":"f9caf7da643af197999ed6e2cb7831945af9e4d1","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-09T18:47:44Z","pushed_at":"2018-03-09T23:24:59Z","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":306341,"stargazers_count":8961,"watchers_count":8961,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2156,"mirror_url":null,"archived":false,"open_issues_count":4550,"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":2156,"open_issues":4550,"watchers":8961,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25392"},"html":{"href":"https://github.com/dotnet/roslyn/pull/25392"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/25392"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/25392/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25392/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/25392/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/6a48272e234de3792984310833416c51c1b71920"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":9,"additions":290,"deletions":486,"changed_files":27}}
{"actor":{"display_login":"jasonmalinowski"}}