{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/10747","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/10747/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/10747/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/10747/events","html_url":"https://github.com/dotnet/roslyn/pull/10747","id":149941137,"number":10747,"title":"Large cleanup of FixAllContext and subclasses.","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},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T02:31:52Z","updated_at":"2016-04-21T16:25:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/10747","html_url":"https://github.com/dotnet/roslyn/pull/10747","diff_url":"https://github.com/dotnet/roslyn/pull/10747.diff","patch_url":"https://github.com/dotnet/roslyn/pull/10747.patch"},"body":"Previously, we had FixAllContext, a concrete type that we passed around to functions like FixAllProvider.GetFixAsync.  In this regard the type was sensible and could be used simply.  However, we also subclasses this type multiple times with more concrete classes, but we did not override any actual functionality, but instead used these subclasses just for capturing more state.  \r\n\r\nBut if we didn't override functionality, how was that state ever useful?  Simple, in many different parts of the code we would explicitly just downcast FixAllContext to that type, so we could grab the data out of it and use it.\r\n\r\nI've gone in and revamped all of this.  There is now only a single concrete type: FixAllContext.  Inside it, it *already* had an abstract type that it defered a few pieces of functionality to.  Now for the cases that we needed subclassing for, we instead use that abstract behavior changing type to actually encode the different behavior we want.  \r\n\r\nNow we don't have multiple ways of configuring behavior, and we remove some very smelly code in the FixAll implementation."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/212994967","html_url":"https://github.com/dotnet/roslyn/pull/10747#issuecomment-212994967","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/10747","id":212994967,"user":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars.githubusercontent.com/u/10605811?v=3","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T16:25:24Z","updated_at":"2016-04-21T16:25:24Z","body":"We now have a VSI test for FixAll, let me request Jenkins to run it."}}