Partager via


Legacy Language Service Essentials

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You must provide a language service to integrate a programming language into Visual Studio. This topic explains the features available in legacy language services.

Legacy language services are implemented as part of a VSPackage, but the newer way to implement language service features is to use MEF extensions. To find out more about the new way to implement a language service, see Editor and Language Service Extensions.

Note

We recommend that you begin to use the new editor API as soon as possible. This will improve the performance of your language service and let you take advantage of new editor features.

Legacy language services provide the following features:

Feature Description
Syntax coloring Causes the editor view to display different colors and font styles for the different elements of a language. This differentiation can make it easier to read and edit files.

For general information, see Syntax Coloring in a Legacy Language Service.

For information about this feature in the managed package framework (MPF), see Syntax Colorizing in a Legacy Language Service.
Statement completion Completes a statement or keyword that the user has started typing. Statement completion helps users enter difficult statements more easily, with less typing and fewer chances for error.

For general information, see Statement Completion in a Legacy Language Service.

For information about this feature in the MPF, see Word Completion in a Legacy Language Service.
Brace matching Highlights paired characters such as braces. When the user types a closing character such as "}", brace matching highlights the corresponding opening character, such as "{". When there are several levels of enclosing characters, this feature helps users confirm that the enclosing characters are paired correctly.

For information about this feature in the MPF, see Brace Matching in a Legacy Language Service.
Parameter information tooltips Displays a list of possible signatures for the overloaded method that the user is currently typing.

For general information, see Parameter Info in a Legacy Language Service.

For information about this feature in the MPF, see Parameter Info in a Legacy Language Service.
Error markers Displays a wavy red underline, also known as a squiggly, under text that is syntactically incorrect. Error markers usually are used to make users aware of misspelled keywords, unclosed parentheses, invalid characters, and similar errors.

In the MPF classes, error markers are handled automatically in the AddError method of the AuthoringSink class.

Many of these features require the language service to parse source code. You often can reuse the tokenizing and parsing code for your compiler or interpreter.

The following features are related to support for programming languages but are not part of language services:

Feature Description
Expression evaluators Supports the Visual Studio debugger by validating breakpoints and supplying a list of expressions to be displayed in the Autos debug window.

For more information, see Language Service Support for Debugging.
Symbol-browsing tools Supports Object Browser, Class View, Call Browser, and Find Symbol Results.