In many ways, the editor can be considered the heart of Visual Studio — it is where you enter and edit the code and other text used to create your applications. The Visual Studio SDK editor model not only gives you the ability to include the Visual Studio editor in your VSPackages, it also allows you to create your own custom editors or call external editors.
In addition to being used as the main code entry window, the editor is used in other places in Visual Studio where text is entered, such as the Output window and the Command window. Editors also can be form-based, as shown by the forms designer for Visual Basic.
The Visual Studio editor is a combination of several components, many of which are listed in the Terms section of this topic.
First, decide what kind of editor you want to create for your VSPackage. You can choose one of the following:
Standard File-Based Editor — A generic text editor that saves data as files. It includes common editor functionality such as text editing, deleting, and inserting. It does not include more advanced features such as Find, Undo, or Incremental Search. Choose this editor if you need to provide simple text editing.
Visual Studio Core Editor — Based on the Standard File-Based Editor, the Core Editor is used by the Visual Studio integrated development environment (IDE). It contains all of the functionality of the Standard editor plus additional features such as the ability to recognize and take advantage of specific Visual Studio project types. Choose this editor if you need to provide richer text editing than the Standard File-Based Editor can provide.
Custom Editor — An editor specifically designed to work with a custom project type that you have created. Choose this editor if you are implementing a custom project type and you want an editor to work exclusively with your project or take advantage of its features, or you want to create a forms designer. For more information, see Walkthrough: Adding a Command to an Editor Generated by the Package Wizard and How to: Open Project-Specific Editors.
External Editor — Any editor in the system outside of Visual Studio, such as Notepad or Wordpad. You can call any editor in the system from your VSPackage.
For more information about choosing the best editor for your VSPackage, see Kinds of Editors.
Once you have decided on the type of editor you want for Your VSPackage, then you can create it.
To create a Standard File-Based Editor, see the editor implementations in the samples.
To create a Visual Studio Core Editor, follow the procedure outlined in How to: Create an Editor for a VSPackage.
To create a Custom Editor, run the VSPackage Wizard and choose to include an editor. For more information, see How to: Create an Editor (C#).
Because external editors exist outside of Visual Studio, there is no standard procedure for creating them. Nevertheless, once you have an external editor, you can call it from your VSPackage. How to: Create an Editor for a VSPackage illustrates how to do this.