protected override string GetFormatted(bool isSignatureFile, string source, Fantomas.FormatConfig.FormatConfig config) { Range.pos startPos = TextUtils.GetFSharpPos(TextView.Selection.Start); Range.pos endPos = TextUtils.GetFSharpPos(TextView.Selection.End); Range.range range = Range.mkRange("fsfile", startPos, endPos); return Fantomas.CodeFormatter.formatSelectionFromString(isSignatureFile, range, source, config); }
protected override string GetFormatted(bool isSignatureFile, string source, Fantomas.FormatConfig.FormatConfig config) { if (isFormattingCursor) { var caretPos = new VirtualSnapshotPoint(TextView.TextBuffer.CurrentSnapshot, TextView.Caret.Position.BufferPosition); Range.pos pos = TextUtils.GetFSharpPos(caretPos); return Fantomas.CodeFormatter.formatAroundCursor(isSignatureFile, pos, source, config); } Range.pos startPos = TextUtils.GetFSharpPos(TextView.Selection.Start); Range.pos endPos = TextUtils.GetFSharpPos(TextView.Selection.End); Range.range range = Range.mkRange("fsfile", startPos, endPos); return Fantomas.CodeFormatter.formatSelectionFromString(isSignatureFile, range, source, config); }
protected override string GetFormatted(bool isSignatureFile, string source, Fantomas.FormatConfig.FormatConfig config) { return Fantomas.CodeFormatter.formatSourceString(isSignatureFile, source, config); }
protected abstract string GetFormatted(bool isSignatureFile, string source, Fantomas.FormatConfig.FormatConfig config);