Skip to content
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

Two XML Doc warnings (+ quick fixes) when CS1591 is enabled #13

Open
figus opened this issue Apr 25, 2018 · 6 comments
Open

Two XML Doc warnings (+ quick fixes) when CS1591 is enabled #13

figus opened this issue Apr 25, 2018 · 6 comments
Labels

Comments

@figus
Copy link

figus commented Apr 25, 2018

Hello!

I just found out about this plugin, but one question...

Currently using Rider 2018.1.

When I select the light bulb or alt + enter, I get 2 options with the same name and that perform the same action (at least how I see it). Is it normal??

screen shot 2018-04-25 at 2 42 41 pm

Thanks for this awesome plugin 😀

@ulrichb
Copy link
Owner

ulrichb commented Apr 25, 2018

Thanks for your report.

Will have a look at this...

@ulrichb ulrichb added the bug label Apr 25, 2018
@ulrichb
Copy link
Owner

ulrichb commented Apr 25, 2018

Hi. Cannot reproduce this in Rider 2018.1.0 / XmlDocInsp 2.4.0.583:

image

Could you post your versions/an affected code snippet?

@figus
Copy link
Author

figus commented Apr 25, 2018

XML Doc Inspections Version: 2.4.0.583
JetBrains Rider 2018.1
Build #RD-181.4379.1191, built on April 15, 2018
JRE: 1.8.0_152-release-1136-b23 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.4

🤔, something seems strange... before finding your plugin I was looking how to create the method's summary... Then on the issues in this GitHub I found that you implemented the /// shortcut to create it... was it implemented by jet brains as well or was it never yours??

Here is what happens

  1. I uninstalled XML Doc
    Now I see only 1 "Add xml-doc comments", so I thought that maybe there was a plug-in that added the same option? also, /// still works

  2. I deactivated all the plugin in the preferences option
    Still seeing the "Add xml-doc comments" and /// also works

  3. created a new project
    Now I don't see any "Add xml-doc comments" but /// still works

  4. Reactivated all my plugins and Reinstalled xml doc
    Get 2 options again in my original project
    Get 1 option in other projects

I actually never tried /// before installing the plugin, so I can't say that it was there before the plugin, but I definitely never saw "Add xml-doc comments" without it, and yet, for 1 project, it is still there O_O while the /// are for other projects.

This is the project where I can see it double. And where I can still see it after uninstalling the extension, although just one option this time.
ConsoleApplication2.zip

Also, one more question, are checks disabled in "Program.cs"? I created a method there and one more in a different class, and I get the contextual option only on the method in the other class. The method in program.cs doesn't get the light-bulb nor on alt+enter, but /// works.

@ulrichb
Copy link
Owner

ulrichb commented Apr 25, 2018

Thanks for the repro code.

Okay, the problem is that you actually get two warnings in your sample. One from XmlDocInsp and one from R# because you enabled XML Doc generation in the project settings:

image

This emits the C# warning CS1591 (for public types/members).

=> R# shows two "Add xml-doc comments": One for XmlDocInsp's warning, one for CS1591.

Another negative effect is that two suppressions are necessary (ReSharper disable once MissingXmlDoc + #pragma warning disable 1591).

One solution would be to disable CS1591 in the project settings ("Suppress warnings" option) because you use XmlDocInspections anyways.

Further, I will think about this "conflict" between XmlDocInspections and CS1591 and will leave this issue open (and will rename it).

@ulrichb ulrichb changed the title Repeated "Add xml-doc comments" on contextual menu Two XML Doc warnings (+ quick fixes) when CS1591 is enabled Apr 25, 2018
@figus
Copy link
Author

figus commented Apr 25, 2018

Ahhh, yes... in my search for a summary generator I enabled that option expecting some magic to happen... Thanks for your quick response 😄

Also..., is the option "Add xml-doc comments" being generated somewhere else? or why when I uninstalled the plugin I could still see the option in that project? (leaving the XML Documentation option active) was it cached in some way?

@ulrichb
Copy link
Owner

ulrichb commented Apr 25, 2018

Also..., is the option "Add xml-doc comments" being generated somewhere else?

Nope, I don't think so. "Add xml-doc comments" is showed as (R# lingo) quick fix if
a) CS1591 is showed (C# XML Doc generation must be enabled), or
b) XmlDocInsp shows a warning (XmlDocInsp must run; btw. I just reuse the same quick-fix implementation).

But: The ///-typing assistance is available at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants