{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/5180","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/5180/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5180/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/5180/events","html_url":"https://github.com/dotnet/roslyn/pull/5180","id":106105987,"number":5180,"title":"Handle CodeFix with bad ImmutableArray","user":{"login":"jmarolf","id":9797472,"avatar_url":"https://avatars.githubusercontent.com/u/9797472?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarolf","html_url":"https://github.com/jmarolf","followers_url":"https://api.github.com/users/jmarolf/followers","following_url":"https://api.github.com/users/jmarolf/following{/other_user}","gists_url":"https://api.github.com/users/jmarolf/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarolf/subscriptions","organizations_url":"https://api.github.com/users/jmarolf/orgs","repos_url":"https://api.github.com/users/jmarolf/repos","events_url":"https://api.github.com/users/jmarolf/events{/privacy}","received_events_url":"https://api.github.com/users/jmarolf/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":3,"created_at":"2015-09-11T22:28:04Z","updated_at":"2015-09-14T16:26:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/5180","html_url":"https://github.com/dotnet/roslyn/pull/5180","diff_url":"https://github.com/dotnet/roslyn/pull/5180.diff","patch_url":"https://github.com/dotnet/roslyn/pull/5180.patch"},"body":"Check IsDefaultOrEmpty of any ImmutableArray given for FixableDiagnosticIds, to ensure that it has been properly initialized.\r\nThrow and ArgumentException to let the user know to fix their CodeFixer.\r\nFixes #2002"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/140134007","html_url":"https://github.com/dotnet/roslyn/pull/5180#issuecomment-140134007","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/5180","id":140134007,"user":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T16:26:59Z","updated_at":"2015-09-14T16:26:59Z","body":"A couple thoughts:\r\n\r\n1. This change can break existing, valid fixers. Imagine a fixer that decides what DiagnosticIds it can provide dynamically based on some static environment state, and in one case (say, on one particular domain/network, or on all-but-one OS, or ...) decides it cannot provide any value and so returns an empty array in that case. It may be unlikely, and it may not be the architecture you'd want (you may want them to do that in ```RegisterCodeFixesAsync``` instead), but it could exist currently, and this would break it. And if an entire *set* of fixers gets implemented that way, now you open a project and immediately get nailed with a bunch of (not-actually-problematic) failure notifications.\r\n2. If we decide we can deal with the problems from 1 above, ```FixableDiagnosticIds``` would now be required to be non-empty, but the public API for it is not documented as such. These should stay in sync. **NOTE**: This mismatch also holds for ```DiagnosticAnalyzer.SupportedDiagnostics```, so we should probably fix the docs there too.\r\n\r\nI support the idea of us throwing if the FixableDiagnosticIds (or, honestly, SupportedDiagnostics) is *inconsistent* over time, because that completely violates the contract. Not handling a consistently empty set of things seems like an unnecessary restriction on our part. Certainly the developer of the analyzer or fixer will have tested that something works on *their* machine, and them consistently offering to handle/provide nothing in any *individual* case is something our engine can easily deal with."}}