Language Services and the Core Editor

Editors in Visual Studio are frequently associated with a language service. Among other things, a language service provides syntax coloring, statement completion, IntelliSense, and text formatting.

Core Editors and Document Data Objects

When you access the core editor, you do not create document data and document view objects. The IDE creates and controls these two objects, and you obtain handles to them by making the appropriate calls in your editor factory implementation.

For more information, see Determining Which Editor Opens a File in a Project.

Language Services and the Core Editor

By implementing a language service, you can control how data is displayed in the document view. A language service provides information and behavior that is specific to a given language, such as Visual C++. When you create a text buffer and determine the filename extension for the document you are opening, the text buffer determines the language service associated with this file name extension from a registry key, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Editors\{YourLanguageService GUID}\Extensions. The standard VSPackage loading procedure then loads your VSPackage and an instance of your language service is created.

A basic language service is shown in the following illustration.

Core editor and language service objects

Language Service Model graphic

The document data object for the core editor is called a text buffer and is represented by the VsTextBuffer object. The document view object is called a text view and is represented by the VsCodeWindow object. These two objects work together through the language service to provide a unified view of the core editor. Information from the text buffer and the text view displays in a document window called a code window. The code window document is managed by a code window manager.

See Also

Reference

IVsLanguageInfo

IVsColorizer

VsTextView

IVsCodeWindowManager

VsCodeWindow

Concepts

Providing a Language Service Context by Using the Legacy API

IntelliSense Hosting

Contained Languages

Other Resources

Developing a Language Service