Visual Studio - Automatically refresh class view when changing class

后端 未结 13 2225
再見小時候
再見小時候 2020-12-23 17:18

I come from a Java background and have spent many years using Eclipse. One feature that I miss when using Visual Studio (2008) is that the class view does not automatically

相关标签:
13条回答
  • 2020-12-23 18:17

    After reading kingmaxxx's reply, I went to Tools->Options->Environment->Keyboard and bound Ctrl+Shift+C to View.SynchronizeClassView in Text Editor view. This seems to supplant and supplement the original behavior (View.ClassView), as it will display ClassView if it wasn't visible and focus on the current class.

    (Visual Studio 2008)

    0 讨论(0)
  • 2020-12-23 18:19

    Coming from Eclipse you will miss a lot of such features. What I miss most for navigation is an easy go to type, go to inheritor and so forth. Other features, such as nUnit support are not part of the vanilla Visual Studio, too. Here is a list of Add-Ins that bridge the gap:

    • CodeRush
    • Resharper
    • TestDriven.net, just nUnit integration

    But here comes the drawback: They all charge you money (TestDriven.net only for commercial use). However, they all offer free trials.

    0 讨论(0)
  • 2020-12-23 18:21

    For Visual Studio 2017, CodeMaid Spade comes to the rescue quite perfectly.

    Codemaid VS Extension

    At first, I couldn't find the equivalent to 'Class View'. It's called Spade.

    It auto-syncs to the currently open class.

    0 讨论(0)
  • 2020-12-23 18:22

    For Visual Studio 2005

    I found a solution that does not update the view automatically, but at least you get a context entry that helps:

    http://blogs.msdn.com/ansonh/archive/2005/12/09/502020.aspx

    You can also define a shortcut key:

    Tools->Options->Environment->Keyboard and see if you can find "View.SynchronizeClassView".


    Oh, just for laughs - here is the answer of Microsoft: http://msdn.microsoft.com/en-us/library/2dae8h2s.aspx

    ...you can select any symbol in the Code Editor and locate it instantly...

    After 7 Steps...

    "Class View automatically scrolls to the location of the selected symbol in its hierarchy. "

    0 讨论(0)
  • 2020-12-23 18:23

    I haven't had time to get this to work yet, but there is code for a VS2003/2005 add-in to auto-sync here (see the post marked "answer").

    Incidentally, this question seems to be a duplicate of this one.

    0 讨论(0)
  • 2020-12-23 18:24

    I don't know of any ways to do this but I agree that it would be a nice feature.

    You can track items in Solution Explorer though (Options->Project and Solutions->General->Track Active Item in Solution Explorer).

    0 讨论(0)
提交回复
热议问题