Deep Dive document download for the Regular Expression Language Service sample included in the VS SDK.
Introduction
This example implements a small language service for demonstration purposes. This is called Regular Expression Language Service since it can tokenize text by RegEx patterns (lower case letters, capital letters, digits) and can use its own syntax coloring scheme for each token. However, the functionality of this sample is quite far away from a full language service it illustrates the basics. The source files belonging to this code have only about three hundred lines of essential code. When reading through this deep dive you are going to get familiar with the following concepts:
How language services should be registered with Visual Studio?
What kind of lifecycle management tasks a simple language service has?
How to create a very simple language service?
How to implement a scanner supporting syntax coloring?
To understand concepts treated here it is assumed that you are familiar with the idea of VSPackages and you know how to build and register very simple (even non-functional) packages. To get more information about packages, please have a look at the Package Reference Sample (C# Reference.Package sample). Very basic knowledge about regular expressions is also expected.