19

OK, this is a silly question, but when using Visual Studio, if I am writing XML doc comments in Visual Basic, I can use the tab key to switch between fields (e.g. Summary to Param to Returns). In C#, however, hitting the Tab key inserts a Tab, so I have to click on the individual fields to navigate to them (or use the arrow keys). This makes what should have been a simple process tedious and time-consuming.

Anybody know if there is a default keyboard shortcut I can use, or if there is a specific command I can map to an unused keyboard shortcut? I am using Visual Studio 2010, with ReSharper 6.1. Did some searching in the SO archives, but either nobody else has this problem, or I don't know the right keywords to ask (the latter is much more likely). Thanks in advance!

EDIT: I should clarify, a bit. The tabbing behavior in VB is native to Visual Studio 2010; the ReSharper install is fairly recent (after I switched to C#), and I wanted to mention it in case someone might know whether ReSharper had added their own navigation shortcuts (as they have tons) for this. Thanks again!

Mike Loux
  • 706
  • 2
  • 11
  • 23
  • 1
    I use the up and down cursor. Having never used Resharper with VB I guess I don't miss it. – Jodrell Jun 27 '12 at 14:37
  • Edited the post to clarify that you don't need to have ReSharper installed for VB to display this behavior. Sorry for the unintended confusion. – Mike Loux Jun 28 '12 at 00:30
  • Huh. I've never been down-voted before, and I see this question got 2 downvotes. I thought it was a reasonable question, myself... :-) – Mike Loux Jul 08 '12 at 14:05
  • Similar to [this http://stackoverflow.com/questions/27387509/visual-studio-keyboard-shortcut-for-jumping-out-of-an-xml-documentation-tag] unanswered question. – pashute Jan 20 '15 at 10:14
  • Check this http://stackoverflow.com/questions/27383613/tab-through-xml-documentation-fields – Mladen Mihajlovic Nov 07 '16 at 09:09
  • Hmm. The answerer of the question @MladenMihajlovic pointed me at might be on to something. Indenting is very handy in comment headers. FWIW, I never did find an answer for this, and just got used to it. Still happens in VS 2015, although it's possible that R# Ultimate 2016 might have keyboard shortcuts. Haven't really pursued it, but am very amused that this question keeps getting upvotes. :-) – Mike Loux Nov 18 '16 at 16:46

2 Answers2

2

Resharper does have the possibility for structural navigation. Normally you can use the Tab or Shift+Tab Shortcut to the next or previous code element. If your cursor is in a code element (i.e. not in the whitespace region before a code line) the Tab Key shouldn't insert a tab but navigate to the next section. Configuration of the structural navigation can be done in Environment|Editor|Editor Behaviour.

If it's still not working as described I'd try to reset the settings (especially those for Resharper) and check wether Resharper is installed properly.

MetaColon
  • 2,895
  • 3
  • 16
  • 38
  • Ahh, a blast from the past. Welp, I tried that, and the resulting behavior isn't much better, TBH. If I am in a header comment for a function and I tab out (with the R# behavior enabled), it jumps to the end of the function and selects everything in between. To be fair, I am (now) running R# Ultimate 2017.1 EAP4 (installed last week) on VS 2017, so it could be beta behavior. Doubt that this has changed in recent memory, but you never know. I *do* appreciate the answer, nonetheless (even if it doesn't work for me). – Mike Loux Mar 14 '17 at 19:01
  • 1
    Maybe it's just the behaviour intented from R# that doesn't satisfies you, otherwise I'd try doing the same in earlier versions. Still I'm glad my first answer on SO found appreciation :) – MetaColon Mar 14 '17 at 21:51
  • Is this your first answer? Cool! Welcome to the brotherhood that is Stack Overflow. May your reputation expand exponentially. :-) Yes, that is definitely R# behavior, and I will admit I find it more than a bit weird, but then again, R# has been having issues lately in general, so I'm not overly surprised by anything, these days. At the end of the day, this was something I posted, what, 5 years ago? It's still a minor annoyance, but I have learned to live with it. One of those "nope, not gonna change, so deal" kind of things. *shrugs*. – Mike Loux Mar 15 '17 at 01:11
0

I might be misunderstanding the question, but maybe it sounds like you can just reset your user settings? http://msdn.microsoft.com/en-us/library/ms247075%28v=vs.100%29.aspx ? Or just run a devenv / resetuserdata . Do that, and when you start up visual studio, maybe choose the 'general' settings rather than the C# or vb.net specific ones?

Phil
  • 1,852
  • 2
  • 28
  • 55
  • 1
    Well, you can always clear the settings anyways, getting rid of resharper changes? Or you could map your own keyboard shortcut through tools\options\Environment\Keyboard. Type in the shortcut key you want, and then 'assign' it with the command in the listbox above – Phil Jun 28 '12 at 16:18
  • As I said before, ReSharper is not the problem. The behavior was the same before I installed ReSharper, and now I am regretting ever having mentioned that I use it. I could map keys, and would certainly do so...if I knew what the command for "move between comment fields" was (or if there even was such an animal...nothing stood out as fitting the bill when I took a run through the command list yesterday). – Mike Loux Jun 28 '12 at 19:53