Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable a "contextual" editor in Visual Studio?

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…

like image 450
Sklivvz Avatar asked Apr 25 '13 10:04

Sklivvz


1 Answers

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

like image 156
Sklivvz Avatar answered Sep 27 '22 16:09

Sklivvz