-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest default in switch statement #800
Conversation
var diagnostics = from dia in context.SemanticModel.GetDiagnostics() | ||
where dia.Id == "CS0151" | ||
select dia; | ||
if (diagnostics.ToList().Count == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would simplify this down to:
if (!diagnostics.Any())
Thanks for the feedback @thorgeirk11 ! |
Hi @cezarant, this code not raise analyzer: var s = false;
switch (s)
{
case false:
{
break;
}
} |
There are several small problems, @cezarant, are you going to move forward with this PR? |
Actually, this code: var s = false;
switch (s)
{
case false:
{
break;
}
} Should raise a diagnostic, as it does not have a |
@giggio I will study more about the Code Cracker. I did not think I'd find so many difficulties in carrying out this analyzer. Forgive me for doing pull Request with a low coverage tests. I will be more cautious next time. |
@cezarant Thanks for your collaboration and go ahead! |
@cezarant Do you have some news about this ? |
Hi @carloscds I was waiting for feedback for Fix #808, but I can work here. Following the above suggestions. I think I have to make a rebasing of the code that was loaded. Right? |
@cezarant We can process this PR separately. |
Hi devs! Anybody here have had problems to build the project, when change of machine? |
@cezarant Here project is compiling. Do you check for any extension installed on last days ? |
Hello @carloscds I did a format in my notebook, and re-install the Visual Studio. It is the only abnormal thing I did. Now, i unmarked options on the VSIX tab, and seems to have settled.
|
@cezarant CodeCracker users VSIX project. |
@carloscds I had two problems with the original branch that gave rise to this PR:
So, I clone the actual version of the code cracker, created a new branch and put the changes. |
@cezarant This branch has some conflicts, can you update it ? |
@carloscds Being my first analyzer, the original branch of this pull request has unnecessary modifications to files that were not part of the issue. I created a new pull request, starting from the beginning and already contemplating the suggestions mentioned above. It is a bad idea? |
@cezarant Look: |
Hello @carloscds i resolved the conflicts in the the branch that I used to create this pull request. I feel unsafe to perform the pull request that branch. I can make a new rebasing, I'm sorry to have created another pull request, but could not find another way to check test coverage. |
@cezarant If you will create a new PR, please close this. |
Fixes #780
CC0120: Suggest default for switch statements (C#)
This is my first pull request, if there is a problem , like a feedback.
Thank you!