/// <summary> /// Gets the formatted text for the node. /// </summary> public static FormattedText GetFormattedText(SyntaxNode node, FormattingOptions options, int cursorPosition) { var formatter = new KustoFormatter(cursorPosition, options ?? FormattingOptions.Default); formatter.Format(node); return(new FormattedText(formatter._builder.ToString(), formatter._newCursorPosition)); }
public override FormattedText GetFormattedText(FormattingOptions options = null, int cursorPosition = 0, CancellationToken cancellationToken = default(CancellationToken)) { if (this.TryGetBoundOrUnboundCode(cancellationToken, true, out var code)) { return(KustoFormatter.GetFormattedText(code.Syntax, options, cursorPosition)); } return(new FormattedText(this.Text, cursorPosition)); }