Can you get ReSharper to display exceptions in Int

2019-04-30 20:03发布

问题:

I'm a fan of the overridden Intellisense behaviour provided by ReSharper. However, I can't seem to get it to display exceptions (anything with the /// <exception cref="SomeExcpetionName"/> xml comment). Does anyone know a way to enable this functionality?

NOTE: This is not an issue related to not including the xml comment file from a dll as it is happening for all classes (even core .Net ones). Plus, any of my own libraries, which I have ensured the XML file is included, are not displaying the exceptions in the comments either.

NOTE 2: I have tried selecting Visual Studio Intellisense instead of the ReSharper Intellisense (via Tools > Options > Text Editor > C# and turning on the Auto list members and Parameter information settings under the Statement completion section). This seemed to bring back the exceptions (after a Visual Studio restart). However, it only works when I bring up Intellisense via tab completion and not when I just bring up the tooltip for a method by hovering over the method call (this used to work... it even works properly for the first few seconds after starting up Visual Studio, but then something disables it again).

Specs:

  • ReSharper 5.1.3
  • Visual Studio 2008 Professional

回答1:

Well after a reinstall that made no difference, I realized that the %appdata%\JetBrains\Resharper\v5.1\vs9.0\UserSettings.xml file was still there (which explains why a reinstall didn't work). I then did a diff on the file with another developer in my group that wasn't having the issue. I found the setting that was causing the issue.

If you wish to have your tooltips (inside of Visual Studio) show the exceptions that a method throws, you must have the following option turned off:

(In Visual Studio via the menu)

  • Choose ReSharper > Options > Code Inspection > Settings > Color identifiers
  • Uncheck the option if it is checked (disabled by default)

(In %appdata%\JetBrains\Resharper\v5.1\vs9.0\UserSettings.xml):

  • Find the <Highlighting Settings> section.
  • Delete <IdentifierHighlightingEnabled>True</IdentifierHighlightingEnabled> (You could also set it to False, but when you uncheck it via Visual Studio it actually deletes it).

Hopefully this saves some other people from the same headache. I believe this is actually a bug since using colour identifiers should have nothing to do with tool tips/Intellisense displaying possible exceptions. I'll report it to JetBrains.

UPDATE: This issue has already been reported here.

UPDATE 2: I was talking about this issue with one of the JetBrains support engineers and he said they'll see what they can do to address the issue in ReSharper 6. (No guarantees, but they are at least considering it).

UPDATE 3:
There is a linked case (same issue) that has been recently updated. The case has been set to a priority of show-stopper and is slated to be fixed for version 7.0.1.