Managed Language Service Overview (Managed Package Framework)
The managed package framework (MPF) includes a complete set of classes that simplify creating a language service.
A language service provides support in the editor for a particular programming language. This support enables each language service to implement certain Visual Studio features fully, partially, or not at all, depending on the needs of the programming language. The MPF language service classes provide full support for frequently used features and partial support for some other features.
At the heart of a language service are a parser and a scanner. A parser converts a programming language source file into discrete elements called tokens. The language service can then react to the type and functionality of those tokens to provide syntax highlighting, brace matching, IntelliSense support and other features. For more information, see.
The Visual Studio SDK Managed Language Services relies on Bison and Flex, two open-source tools for parsing and scanning that are available freely on the Internet.
Be careful when you redistribute your Managed Language Services code. Bison and Flex are covered by the GPL. If you modify the source code of these tools, the GPL requires that you publish the modifications. Also, use of Bison and Flex could contaminate your code.
Supported Features in the MPF
The MPF language service classes support the following features. A parser and scanner must be supplied.
Commenting blocks of code
Custom Document Properties
IntelliSense Parameter Info
IntelliSense Quick Info
IntelliSense Member Completion
IntelliSense Complete Word
Partially Supported Features in the MPF
The MPF provides only partial support for the following features. The MPF classes call your methods, which must perform the actual work. A parser and scanner must be supplied.
Reformatting code. You supply the reformatting code.
Validating breakpoints by identifying valid code spans. You supply the code to identify code spans.
Supporting the debugger's Autos window for displaying variables. You supply the code to determine what to show in the window.
Supporting the Navigation bar for quick navigation between types and members. You implement and return a helper class that populates the lists in the Navigation bar combo boxes.
The first step in developing a new language for Visual Studio is obtaining the necessary parser and scanner and putting them in the folder that is specified by the Visual Studio SDK. For more information, see.
Next, you can implement the language service itself and the language-service features that you want to support for your language. These steps are discussed in the following topics: