-
Notifications
You must be signed in to change notification settings - Fork 509
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
SA1005 Seems to get caught up on XML Docs #1012
Comments
Thats weird. documentation trivia and comment trivia are syntactically completely different. Do you have an example? |
@jjmartin By unfortunate coincidence (given that there are 10,000 violations reported), the file which is open in that screenshot isn't one of the files with warnings. |
@jjmartin Can you add an example of a case where the warning is reported? So far I haven't seen it appear, and I've tried to reproduce it in multiple extensively-documented projects. |
I'm getting the same experience now with the beta version in VS 2015 RTM. |
@FutureGUIs Can you include an example piece of code which demonstrates the issue? Thanks! 😄 |
|
It certainly doesn't seem like a certain type of file, just anything with 3 slashes |
Found the problemYou have documentation comments disabled for your project, because you did not check the box to create an XML documentation file during the build. You need to enable this check box if you want to use documentation-style comments in a project. I enable this using a custom 📝 This property group must appear after the property group(s) that define <PropertyGroup>
<!--
Make sure any documentation comments which are included in code get checked for syntax during the build, but do
not report warnings for missing comments.
CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
-->
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
<NoWarn>$(NoWarn),1573,1591</NoWarn>
</PropertyGroup> Related issues: |
That didn't help. Plus, did that change as that wasn't how the rule was working before? |
Try doing a full rebuild and/or restarting Visual Studio after changing the setting. I've gone back and forth a few times now, and I can reproduce exactly what was indicated above by enabling and disabling this setting.
Not that I can see. It's possible Roslyn changed the way documentation comments appear in the parse tree in a way that affects this analyzer. I'm not entirely sure yet. |
I wasnt able to repro this in VS 2015 rc (have not updated my laptop yet). So this might have changed in roslyn rtm. |
Intellisense isn't highlighting the issue, but that file corresponds to the selected row in my screenshot. gonna try out the documentation comments property you mentioned above - but it seems like an odd requirement - the IDE clearly knows its a comment - its not green, its grey. |
I am seeing the behavior of the Build->Output->Xml Documentation File checkbox being checked removes the non-legit SA1005 warnings. (After changing, saving the project and re-running analysis on the project (with my Error List filtered for just the current project) (I also get a bunch of new warnings like CS1573) But that doesn't seem like desired behavior that we want. It shouldn't matter if i am outputting XML documentation or not. |
If this is the first time you are validating XML comments in your solution, I highly recommend using the XML
It shouldn't, but it does. See the Roslyn bug I filed above for my request that it not differentiate behavior on this setting. |
ok - so enabling the XML docs is more of a work-around than a solution at this point. the other option is that we don't care that much about a space after // so i can just ignore SA1005 (for now anyway). Thanks for the tip on the nowarn, i kinda knew what was going on but looking at the Roslyn bug makes them more insidious since the usings are getting removed i suppose. |
Roslyn has a parse mode that treats documentation comments as regular comments. We should support that. If @sharwell is okay with that im going to fix that. |
@pdelvo Sure, just be sure to clearly state the semantics of your fix. 😄 |
I'm getting a ton of SA1005 all pointing to the /// of a XML documentation
The text was updated successfully, but these errors were encountered: