8

A number of IDEs and editors are offering "contextual" editing tools:

  • A simple example is the Assistant Editor In XCode. A secondary edit windows automatically loads a relevant secondary file depending on which context you are in. For instance, if you open a header (foo.h) in the primary window, it automatically opens the implementation (foo.m) in the assistant window, and so on.

XCode's Assistant Editor

  • Brackets has Quick Edit where pressing Ctrl+E allows you to edit the CSS selector that points to your current HTML element.

    Brackets' Quick Edit

  • Light Table has inline documentation and drafting tables:

    Light Table's inline documentation

    Light Table's drafting tables

  • Microsoft has a Debugger Canvas project that is similar to what I want, but it's debug mode only and limited to Visual Studio Ultimate. The tool I am looking for is a tool for coding, not debugging.

    Microsoft's Debugger Canvas

I would like a normal editor, and a secondary editor that shows me the context of what I am currently editing.

  • If I am on a class that implements an interface, I would like the secondary editor to show the interface

  • If I am on a class member that is an instance of another class, I would like the secondary editor to switch to the class source

  • If I am on a method, I would like the secondary editor to point to the method body

and so on…

Is there a way(*) to have a similar experience in Visual Studio 2012?

(*) some hidden trick, an extension feature, a quick hack, a solution that works for you…

Sklivvz
  • 30,601
  • 24
  • 116
  • 172

1 Answers1

1

You can use a Code Definition window.

You enable it by going to View > Code Definition Window. You can then dock it on the middle right. It works like so:

Code Definition

Sklivvz
  • 30,601
  • 24
  • 116
  • 172
  • 1
    and from within that window you can right-click->Edit Definition (or assign that to a shortcut) to open a text editor for it – stijn Apr 25 '13 at 10:37
  • @stijn: After right-click you must select "Go To Definition " not "Edit Definition" – AminM Apr 26 '13 at 13:33
  • @JesonPark not exactly, it depends on what you want.. `Edit Definition` will take you to the definition of the symbol that is under the cursor of the `editor`, hence the symbol that is used to define what gets displayed in the Code Definition Window. `Go To Definition` does what it always does so it will take you to the definition of the symbol under the cursor of the `Code Definition Window`. Might be the same, depening on where your cursor is. – stijn Apr 26 '13 at 14:46