Skip to content

Implemented analyzer to fix xml docs parameters#403

Merged
giggio merged 1 commit intocode-cracker:masterfrom
AlbertoMonteiro:xmlDocumentationAnalyzer
Jul 9, 2015
Merged

Implemented analyzer to fix xml docs parameters#403
giggio merged 1 commit intocode-cracker:masterfrom
AlbertoMonteiro:xmlDocumentationAnalyzer

Conversation

@AlbertoMonteiro
Copy link
Copy Markdown
Member

I created analyzer and 2 code fixes, one for missing parameters and another to unexisting parameters.

Tests are ok, but I am facing a problem when testing running VS

But when I press CTRL+. I get a error in VS.
"One or more erros ocurred."

When I checked to see all exceptions in VS I got StackTrace and got this exception:

System.InvalidCastException occurred
Message: Exception thrown: 'System.InvalidCastException' in mscorlib.dll
Additional information: Unable to cast object of type 'System.Reflection.RuntimeMethodInfo' to type 'System.Reflection.ConstructorInfo'.

I tried a lot things, but couldnt fix, I need help.
Fix #357

@giggio giggio self-assigned this Jul 6, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Category should be maintenability. Needs to change the DiagnosticSeverity and file locations.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which DiagnosticSeverity should I set?

@AlbertoMonteiro
Copy link
Copy Markdown
Member Author

@giggio I made many commits to fix your observations. When everything is aproved I will squash them all.
Which DiagnosticSeverity should I set?

@AlbertoMonteiro
Copy link
Copy Markdown
Member Author

@giggio How did you catch this exception in comment: #403 (comment) ?
After these commits to fix your observations, I ran VS and it fixed the CTRL + .

I walk through all my new commits and discovered that CTRL + . bug stoped in AlbertoMonteiro@ebdae16

So I started to mix the changes that I did in this commit, and I discovered that if I use the namespace CodeCracker.CSharp.Refactoring it will break when running VS.
So I moved to parent commit(AlbertoMonteiro@150a201) and ran VS again, the bug happend, stoped, and change the namespace from Refactoring to AnyElse and the problem was gone.

Why the simple namespace name change, breack when running on VS?

@giggio
Copy link
Copy Markdown
Member

giggio commented Jul 6, 2015

@AlbertoMonteiro You set the exception settings to catch all .NET Exceptions. If you don't do that, VS will not stop to let you inspect the exception. I don't know why, it should stop.
BTW, you also need to update the analyzer and code fix to use Resources for globalization support. See https://github.com/code-cracker/code-cracker/blob/cc44ad2419e25d794471b83867fbd08877af25dd/src/CSharp/CodeCracker/Style/ConsoleWriteLineAnalyzer.cs and the corresponding code fix.

@giggio
Copy link
Copy Markdown
Member

giggio commented Jul 6, 2015

@AlbertoMonteiro I can't see why the namespace would break the code. Try using the exception setting I talked about above and see if you can find what happened. Anyway, you are going to move it another namespace, so maybe this is moot.

@AlbertoMonteiro
Copy link
Copy Markdown
Member Author

@giggio commited the globalization support.
About the namespace breaking, I will record a video and upload on youtube , so you can see this weird behavior.

@AlbertoMonteiro AlbertoMonteiro force-pushed the xmlDocumentationAnalyzer branch from 662b18c to 50127c6 Compare July 8, 2015 22:32
@giggio giggio merged commit 50127c6 into code-cracker:master Jul 9, 2015
@giggio
Copy link
Copy Markdown
Member

giggio commented Jul 9, 2015

@AlbertoMonteiro Good job!
I did some small updates, check a475139 for more info. I got some edge cases that needed taking care of and the test file was on the wrong directory.

@AlbertoMonteiro
Copy link
Copy Markdown
Member Author

@giggio Thanks.
I will pay more antention next time!

@AlbertoMonteiro AlbertoMonteiro deleted the xmlDocumentationAnalyzer branch July 10, 2015 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify if xml docs have the correct parameters

3 participants