/// <summary> /// Get the background error highlights. /// </summary> /// <param name="text">The text to highlight</param> /// <returns>Some colorings</returns> public static IEnumerable <Coloring> GetErrorHighlights(string text) { var lexer = new XamlLexer(new AntlrInputStream(text)); var parser = new XamlParser(new CommonTokenStream(lexer)); var parserListener = new ColoringParserErrorListener(); parser.AddErrorListener(parserListener); parser.document(); return(parserListener.ErrorColorings); }