While debugging, we often have to work with lots of information. We have the autos, locals and watches tool window to look at, code in our editor, … This overdose of information and switching between looking at code and at tool windows often messes with the mental context of the debugging session in our brains.
No more! With ReSharper 2017.3 EAP, we are proud to bring one of Rider’s features into Visual Studio: local variables, current line expressions and function returns are now displayed inside the editor! On top of that, we’re adding searchable DataTips!
Instead of having to switch between looking at variables in a tool window, we can now see the content of local variables, current line expressions and function return values inline in the editor.
ReSharper visualizes values based on the information it has available. When a class is annotated with the DebuggerDisplayAttribute
attribute, ReSharper will use it instead. So for example if we add a DebuggerDisplay
attribute to a Person
class, we can have ReSharper visualize our type based on some of its properties:
Keep in mind that Rider‘s debugger provides very similar features – check out our series about Rider’s debugger to learn more!
Using ReSharper DataTips
ReSharper comes with its own debugger DataTips as well. We can access them by clicking the inline value display, or by replacing the Visual Studio DataTips from the ReSharper settings under Tools | Debugger:
The ReSharper DataTips make it easier to search for a specific value. For example if we load the list of people from a file and want to check a given person is in there, we can expand the collection and then start typing to search through. Note that searching is only possible in expanded nodes.
Configuring ReSharper debugger tools
These new debugger tools come with several configuration options. From the ReSharper settings under Tools | Debugger, we can toggle the different elements that can be shown in the editor:
In case you prefer not to display local variables, current line expressions and function return values inline in the editor, the entire feature can be toggled under General | Product & Features, then Debugger Integration.
Download ReSharper 2017.3 EAP and give it a try! We’d love to hear your feedback on the new ReSharper debugger tools!
That looks awesome, although I’m sure the OzCode folks are less enthusiastic. One of the reasons I love OzCode so much is it’s datatip doesn’t disappear at the drop of a hat the way Visual Studio’s do – are your improved data tips similarly minded? (I realise I could install the EAP, but I don’t like rocking my IDE’s boat so I won’t)
Regards;
Richard Moss
Visual Studio hides the datatip on mouse leave, we hide the ReSharper one on mouse click outside the datatip or when focus is lost.
Awesome! Thanks for the clarification. That will make the future interesting
I used to use and recommend OzCode, but quit when they changed the payment model. It costs pretty much the same as R# while offering a fraction of value.
I also really hate the subscription model (both ReSharper’s and OzCode’s), but I do pay for both and find OzCode does pay for itself, and just makes my life easier.
I love JetBrain’s subscriptions, best thing they ever did businesswise.
OzCode has a 75% discount for Black Friday http://landing.oz-code.com/BF-sale2017
That’s for 1 year.
Looks quite similar to what my team have released as a free plugin on Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=vs-publisher-1469962.RevDeBugPrompter
Looks pretty nice, definitely something I’ll give a go. I like how RevDeBug/OzCode shows values above the calculation, rather than how Resharper is shoving it off to the side – it’s much clearer and works well when you have multiple formula on a single line.
A small typo in that last screen-shot: “funtion” should be “function”.
(“Show funtion return values in editor”)
Thanks! Let’s get that fixed
This feature is awesome!
When I first noticed it (a day before this blog)
I was like huh? What is that? Then I realized what was going on and immediately enjoyed having this while stepping through a unit test.
Thank you very much for this great feature!
PS: I was so happy to have this, I showed it to my girlfriend who is not a programmer
Thanks for your kind words Martin!
I installed the update today without reading the change log, and it was such a great surprise. Additional information started to appear during difficult debugging session, and it saved so much time and frustration. I think that in this particular case I wouldn’t be able to push the fix today if I hadn’t got this aid.
Great feature!
If you would add an on the fly possibility to mark properties you would like to use as DebuggerDisplayAttribute, like what OzCode does, you would make a lot of people happy.
Sometimes you do not have the source code to set the DebuggerDisplayAttribute or sometimes it changes depending on what to debug what I need to see from an object without clicking through the propertylist.
You can right-click the property in the datatip, then “Highlight property” for one or more properties.
Amazing <3
Installing the EAP right now
Hey guys, you have developed a great product which I am using for the past 8 years. I keep track of your progress and ReSharper is getting better and better.
Can I ask you to add RSS feed for the EAP page so I can get notifications for the new versions of the product (https://www.jetbrains.com/resharper/eap/). Thank you!
We do not have an RSS feed currently, but you could use the Toolbox App to get the latest versions? Even different channels for stable and EAP’s: https://www.jetbrains.com/toolbox/app/
Thank you! Do you plan adding RSS feed on the EAP page?
We’re not planning this right now, Nikolay.
Amazing features, can’t wait for the stable version
Hello! Excellent functionality! One question: how can I change the background color of the DataTip. On my theme (Dark with light editor) is not very well seen the values of variables
Not *yet*
It’s strange. When I change the theme, the background and text color changes. Where does this dependence come from?
Well, if this is not possible now, this is planned in the release?
This will probably be in 2018.1
It’s NOT!!!
Would you mind opening an issue on https://youtrack.jetbrains.com/issues/RSRP#newIssue ? This will help the team prioritize.
I have the same question. What is the name of the colour tag that colours the complex types, i.e. “{MemoryCache}”? I need to adjust this in my theme. I can see that strings correctly use the same colour as other strings within my theme, but the complex types use something else.
This will probably be in R# 2018.1
Has this issue been fixed yet? I get cyan colors on white background with my settings. It’s horrible!
We must be able to set colors of ALL new features you implement. Always have this in mind when releasing new features!
This will probably be in ReSharper 2018.1
2018.1 is here. Is it possible to change this color now?
In 2018.1 it’s possible. Use Tools|Options|Font and Colors|ReSharper Debugger DataTip
I found the option. But, the settings are not been ignored in the tooltip. Visual Studio tooltips are the correct colors, but Resharper tooltips not legible
I just installed 18.1 and it MESSED UP the colors!!!
The datatip color option does nothing.
@Jake, @Robert, would you mind opening an issue on https://youtrack.jetbrains.com/issues/RSRP#newIssue ?
If you are using “Visual Studio Color Theme” editor, which you should, from the Start menu / Color Theme editor on the current theme the buttons Edit Theme/ Show All Elements
search and find: ReSharper Debugger DataTip -> Background (& Foreground) that use Default colors which interacts with the Visual Studio’s by overriding overlapping settings options.
So the trick is (that I found so far with a Dark theme) to set the Visual Studio option at
Tools|Options|Font and Colors|ReSharper Debugger DataTip
to something like Item Foreground : Lime / Item Background: somelighter Gray
The effect will be to change the Debugger Data ToolTip to these colors, but the value of the variable still uses some Default color that will change in relation to the background.
If you find the name of that you can change that too, but I have not so far. Good Luck
P.S. Restart Visual Studio, sometimes the Color Theme Editor bugs and doesn’t refresh the colors on change without reset.
As per https://www.jetbrains.com/resharper/eap/ “Build 2017.3 EAP 6 … Introduced debugging support in ReSharper and ReSharper C++” but I see neither the “Options | Tools | Debugger” item nor the actual DataTips when only having “ReSharper C++” installed (did not check the greater ReSharper). Is the announcement wrong? Is the full ReSharper required to use this feature in C++?
Unfortunately full ReSharper is required, but this will be fixed in a future EAP build. Thanks for letting us know!
Do you still need the full version of Resharper to use this functionality? I downloaded the 2017.3.1 trial for just C# but the debugger integration doesn’t appear to work nor are the options available under “Options | Tools | Debugger”.
Which download did you use and which components were installed?
The R# Ultimate install from https://www.jetbrains.com/resharper/download/ will be needed.
Also make sure to check whether “Debugger integration” function is enabled here: “ReSharper | Options | Environment | Products & Features”
This will show/hide the “Options | Tools | Debugger” page.
Just as a small info for those stuck with an old professional perpetual version of Visual Studio:
These new debugging tools from ReSharper won’t work if you, for instance, use Visual Studio 2012.
I use ReSharper Ultimate 2017.3.1 with all add-ins included.
My visual studio, due to being required by the company I work at, is quite old (VS 2012), and does not include the debugging features nor the tools section about it.
Visual Studio 2015 shows at least the tools section just fine.
Very cool. These features are very helpful. I love them in OzCode.
Definitely sad for the OzCode guys though; I don’t see how they can compete now as these were their primary features. They definitely still have more features, but buying that extra extension just became a little bit harder of a sell.
Hi,
sounds (and looks) great, but I have a few questions.
Does this work with Xamarin based projects?
If not currently, is there timeline when it should work.
OzCode doesn’t support Xamarin, this is why I’m so happy about this news.
The Debugger enhancements to ReSharper 2017.3 are crashing Visual Studio 2017 (15.5.2)
I can only debug for about a half-dozen steps before Visual Studio 2017 almost freezes and then throws up (almost literally) all over the screen with an error.
Only fully disabling ReSharper 2017.3 or doing the following seem to help:
ReSharper => Options => Tools => Debugger => Uncheck all “Editor Adornments” => Save
See
https://developercommunity.visualstudio.com/content/problem/169689/the-debugger-cannot-continue-running-the-process-o.html
Thanks, I logged an issue for this https://youtrack.jetbrains.com/issue/RSRP-467767
Feel free to upvote/follow progress there.
These debug enhancements have kill my Visual Studio session in very short order, sometimes immediately. I get wait popups and then error messages stating debug is not synced, or I get a compiler error while stepping in the debugger and have to close out of Visual Studio 2017 entirely.
For several weeks I thought that Microsoft had messed up Visual Studio beyond usability, but I’ve just found that it’s Resharper. I’ve disabled all of this new functinality the hopes of being productive again. Maybe someday I’ll try it again after you’ve fixed it.
Thanks! I added a link to your report in our tracking issue at https://youtrack.jetbrains.com/issue/RSRP-467790
Lawrence, could you also please submit a request via https://resharper-support.jetbrains.com/hc/en-us and describe the mentioned issue in detail (e.g. error description)? Thanks!
Something I miss in the new Datatips is the DataSet visualizer.
When working with datasets this is a very usefull feature.
Pingback: Interview with Sergey Coox, the .NET Department Lead at JetBrains | JetBrains Team
Is it possible to change the font used for the inline value display? The “DataTips” setting only changes the datatip font, not the inline values.
That is not possible right now, I believe it follows the editor font. Could you open a ticket at https://youtrack.jetbrains.com/issues/RSRP#newIssue ?
Hi, is it already possible to change the background/foreground of local variables displayed inside the editor while debugging?
On my dark theme it’s very uncomfortable to read. It’s displayed in white background with very very light green/blue color foreground.
Hey, look; yet another R# feature that slows my editor to a crawl. Keep it up guys!