public void DrawCommandLineQueryResults() { // Don't write anything when database is still loading if (_lastResult.Count == 0 || Database == null) { return; } ConsoleHighlighter.WriteWithHighlight("--- " + QueryStatus + " in " + Options.DatabasePath + " ---" + Environment.NewLine, ParsedQuery.SymbolName); // Write to StringBuilder and then copy to Console in one call (much faster perceived performance) StringBuilder output = new StringBuilder(); using (StringWriter writer = new StringWriter(output)) { ResultFormatter.WriteMatchesForToolUse(writer, _lastResult); } Console.Write(output.ToString()); }
public void DrawResults() { // Don't write anything when database is still loading if (_lastResult.Count == 0 || Database == null) { return; } ConsoleHighlighter.WriteWithHighlight(Environment.NewLine + "--- " + QueryStatus + " ---" + Environment.NewLine, ParsedQuery.SymbolName); // Write to StringBuilder and then copy to Console in one call (much faster perceived performance) StringBuilder output = new StringBuilder(); using (StringWriter writer = new StringWriter(output)) { ResultFormatter.WriteMatchesInFlatFormat(writer, _lastResult); //ResultFormatter.WriteMatchesInTreeFormat(writer, _lastResult, Database); //ResultFormatter.WriteMatchesIndentedUnderContainers(writer, _lastResult); } ResultIndenter indenter = new ResultIndenter(output.ToString()); ConsoleHighlighter.WriteWithHighlight(indenter.WriteAligned(), ParsedQuery.SymbolName); }