In This Article

Squiggle Lines

There is a built-in adornment layer that can render squiggle lines. Squiggle lines are generally displayed under parse errors or spelling mistakes.

A built-in tagger can also be installed to watch for errors in the parse data returned by a parser, and automatically render squiggle lines based on those ranges.

Squiggle Lines Adornment Layer

The built-in squiggle lines adornment layer uses a tag aggregator for the ISquiggleTag type. When a tagger is applied to a document via a tagger provider language service, the ISquiggleTag ranges that it returns are rendered as squiggle lines in text views.

Screenshot

Squiggle lines showing a syntax error

The ISquiggleTag interface has a ClassificationType property that allows an IClassificationType to be set. When left null, the squiggle line will be rendered in red. If the classification type has a highlighting style mapped to it via the ambient highlighting style registry, the foreground of the style will be used to render the squiggle line.

Automated Squiggle Lines for Parse Errors

If you are using a parser your language, it will return resulting parse data to the ICodeDocument.ParseData property. If the parse data object implements the IParseErrorProvider interface then parse errors can be retrieved from it.

There is a built-in tagger called ParseErrorTagger that can be attached to a document via a document-oriented tagger provider service. See the Tagger Provider topic for details on making tagger provider services.

When this parse error tagger is attached to a document, it will monitor the document's parse data for changes. If the parse data is updated, it will automatically get the list of parse errors from it (assuming the parse data implements IParseErrorProvider) and will return ISquiggleTag tags for each one. This automatically drives the squiggle line display when used in an editor.