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
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.
Related
I know that I can set up Visual Studio to debug through the .NET framework source code.
But is there a way that I can browse the code while NOT debugging - i.e., being able to press F12 or "Go to definition"?
I thought that if that feature isn't built into Visual Studio then there may be a plug-in that might add it?
There is a very new feature in Visual Studio 2017 version 15.6
You can see decompiled source code without any plugin! Btw, Ref12 doesn't work for VS2017.
Tools > Options , expand Text Editor > C# > Advanced, and enable "Enable navigation to decompiled sources (experimental)".
Ref: https://learn.microsoft.com/en-us/visualstudio/ide/go-to-and-peek-definition?view=vs-2017#view-decompiled-source-definitions-instead-of-metadata-c
With ReSharper it's possible to browse .NET sources by enabling ReSharper -> Options -> Tools -> External Sources -> Navigation to Sources.
After enabling this option new menu item "Navigate To -> Decompiled Sources" appears by right click on type/method/whatever.
Navigation also works with F12 for me.
I just discovered this extension that pretty much addresses my problem. The only thing is that it opens the source in the browser rather than in Visual Studio, but it's no big deal because even in the browser you can click the source code to navigate to types etc.
It was presented on Scott Hanselman's blog a couple of days ago:
Community member and fabulous coder Schabse Laks has created a Visual Studio extension for VS2010, 2012, and 2013! This extension sends calls to Go To Definition (or pressing F12 on a symbol) directly to the code online (when it's .NET Framework code, not yours).
You can download this companion "Ref12" Visual Studio Extension now! Just Goto Definition on any .NET type we have source for and it'll launch your default browser so you can explore the .NET Framework source yourself! Thanks Schabse!
Update:
As per the comments, for VS 2022 and .NET Core, use this fork of the extension: https://marketplace.visualstudio.com/items?itemName=EfreyKong.Ref12-VS2022
I downloaded the .NET Framework source code from here http://referencesource.microsoft.com/netframework.aspx.
Since I am working with .NET 4.0, I chose ".Net/4" from the list. (What is ".NET/8.0" in that list? No idea.)
I wrote some scripts to rearrange the bloody mess they give us:
Into a reasonable hierarchy of directories;
To remove duplicated code (why is every file doubled, or was my install bad?);
Rename all top-level namespaces to not conflict with native ones baked into Intellisense.
Example: System.Windows.Controls -> xSystem.Windows.Controls
Then follow these steps:
Create a new Visual Studio project of type "Class Library"
Remove all references -- yes, even the system ones.
Drag/drop all of your massaged .NET code into the root of your project.
Wait about 30 minutes for VS processing. VS will appear to freeze; be patient.
Intellisense/ReSharper still complains about heaps of problems, but now I can right click and select "Go to Declaration/Implementation".
Visual Studio is about 600MB with this project loaded.
I am using Visual Studio 2013 Ultimate.
1. Choose menu: TOOLS \ Extensions and Updates...
2. Choose Visual Studio Gallery \ Search Results. Search term: Ref12.
3. Download then install.
4. Restart Visual Studio.
5. Try: Click mouse on Class or method, press F12 and see result at http://referencesource.microsoft.com/
I've never tried this but supposedly the code is publicly available:
[Edit]
http://referencesource.microsoft.com/
There is the .NET Mass Downloader, but I think the straightforward answer to your question is, no.
However I now see Microsoft has made the code more easily downloadable.
Nevertheless note that even for your own code, when not debugging, unless you have the project open, VS does not help you locate source code (even though when you find it yourself break points will work when you start debugging again, if the .pdb files correspond).
After searching for a very very long time, I still haven't found an answer. Basically anytime anything is done with tabs in Visual Studio in C#, things go very badly (see attached gifs, note that the two initial tabs are for a namespace and class). These issues only happen in C# as far as I can tell, as I've used Visual Studio as my main IDE for C++ development and haven't had these sorts of issues. I've attached what I think are relevant settings screenshots.
In the attached gifs, there is only one line that the bug is shown on, but things get very nasty if I attempt to copy multiple lines...
Any help would be massively appreciated!
Not saying this is your issue ...
But starting with VS2019 an .editorconfig file can be generated and its settings saved to the project. I would check and see if one exists.
Code style rule options
In Visual Studio 2013, I could un-check the option "Show live semantic errors" under Tools → Options → Text Editor → C# → Advanced.
This functionality is painfully distracting, and I would love to turn it off. Unfortunately, this options was removed back in Visual Studio 2015, and is still not back in Visual Studio 2017.
Is there any way to somehow disable this option for 2017? I have searched everywhere I can think of... Does anyone have any ideas?
The behavior I find distracting/frustrating/etc. is the constant visual notification that there is something wrong with my code. Specifically WHILE I am writing something...
As a very simply example:
/// <summary>
///
/// </summary>
public class MyClass
{
public string DoSomething()
{
}
}
'DoSomething' will be identified (via red squiggly line) as not returning a value. If I am in the process of writing my method I don't want to be reminded it is wrong. This example, although rather simple, is an illustration of the problem. The real-time error-highlighting can get really distracting as things get more complicated. I know many have suggested making the 'squiggle' color the same as the background color. The problem there is that once I compile, I WOULD like to see those squiggles...
I have disabled all Analyzers at the solution level AND the project level.
You are not the only one to ask for this option ... You may take a look here for confirmation
But according to one of the comment visible on that link, you may still disable the full solution analysis:
IMHO, the new checkbox in VS2015 Update 3 which allows you to toggle
off/on the "Enable full solution analysis" option is a step in the
right direction
(https://msdn.microsoft.com/en-US/library/mt709421(VS.140).aspx) - but
it still doesn't enable you to eliminate ALL solution analysis.
Currently that is impossible. You can request to bring this feature back and present your argument in How to disable live code compilation/analysis in Visual Studio 2017? Roslyn issue on GitHub.
There is no relevant option in Visual Studio. You can't change squiggle (wavy line) style because Visual Studio uses same style named Syntax Error both for design-time errors and compile-time errors. Roslyn that comes with Visual Studio ignores relevant registry keys. See Performance considerations for large solutions page in Roslyn GitHub Wiki. Although Language Service and Editor have relevant extension points, they wouldn't let you alter Visual Studio default behavior. See Extending the Editor and Language Services page on MSDN.
I tried googling, but I couldn't find a fix.
Before, when writing:
console.writeline();, C# would automatically uppercase it to Console.WriteLine();.
Now, by mistake, I somehow deactivated that function. If I write console.writeline(), it doesn't turn it into Console.WriteLine();. Any ideas?
What your looking for is called: Intellisense
The sole goal of this feature is to allow coding to be more productive, smarter, and easier.
You can renable Intellisense by hitting CTRL + J. That will manually reactivate it. Otherwise you'll need to go to:
Tools
Options
Text Editor
Auto List Member
But one of those should address your issue. Otherwise I might suggest running a repair on Visual Studio or Restoring it back to defaults. Cause by default it is enabled and configured correctly.
A known issue can also come from third-party Add Ons that actually handle such data can cause issues with Intellisense so uninstalling such Add Ons, then defaulting Visual Studio should fix it as well.
Example:
Resharp
Visual Assist X
Just Code
Etc.
Basically the ones that handle code completion, quick coding features.
Here is an article from Microsoft Developer Network.
Hopefully that helps.
I'm using Visual Studio 2010 SP 1 w/ .NET 4.0 and I just upgraded to ReSharper 7. Since upgrading, when I type "this.", Resharper autocomplete always displays "No suggestions" as shown in this screenshot:
If I type ctrl+space at this point, it will come up with suggestions. I can also get suggestions if I hit escape (exit autocomplete) and then delete and re-type the dot. Either way, functioning autocomplete looks like this:
I'd really, really like autocomplete to work automatically as soon as I type "this."; can you help?
I've tried suspending and unsuspending ReSharper, restarting Visual Studio, restarting Visual Studio with ReSharper suspended, and combing the ReSharper autocomplete options. I've tried clearing the ReSharper cache, suspending ReSharper, and then restarting Visual Studio. It doesn't appear to be related to these things in a way that I can see.
I've also tried typing "this." very slowly and the behavior did not change; it doesn't appear to be a race condition. Visual Studio itself auto-completes correctly but using ReSharper autocomplete always has this problem.
Thanks in advance for any advice you can give!
Update: After restarting Visual Studio again, the autocomplete selections did appear correctly once if I typed "this." before VS / ReSharper seemed to fully load (it hiccuped while I typed and when it recovered, the autocomplete was correct). Subsequent attempts reverted to the undesirable behavior.
This is really weird. I've filed an issue with JetBrains here:
http://youtrack.jetbrains.com/issue/RSRP-330185
I'm using the same setup and it works. Your issue can be caused by:
a defective ReSharper installation
additional plugins that interfere with the Resharper IntelliSense
your computer is just a bit to slow and doesn't build the list fast enough
Edit:
I would reinstall resharper (completly remove it - don't repair) and try again.
You may disable ResharperIntellisense or limit it from Resharper->Options->Intellisense->General. I think it is beacause my computer is too slow also or a problem with VS2010.