public static void DoIndent(
            CodeFormattingContext context, GlobalFormatSettings formatSettings, IProgressIndicator progress, bool inTypingAssist)
        {
            var indentCache = new SecretIndentCache(
                context.CodeFormatter, null, AlignmentTabFillStyle.OPTIMAL_FILL, formatSettings);

            ourIndentVisitor = CreateIndentVisitor(indentCache, inTypingAssist);
            var stage = new SecretIndentingStage(inTypingAssist);
            List <FormattingRange> nodePairs =
                context.SequentialEnumNodes().Where(p => context.CanModifyInsideNodeRange(p.First, p.Last)).ToList();
            //List<FormattingRange> nodePairs = GetNodePairs(context).ToList();
            IEnumerable <FormatResult <string> > indents = nodePairs.
                                                           Select(range => new FormatResult <string>(range, stage.CalcIndent(new FormattingStageContext(range)))).
                                                           Where(res => res.ResultValue != null);

            FormatterImplHelper.ForeachResult(
                indents,
                progress,
                res => res.Range.Last.MakeIndent(res.ResultValue));
        }
 public SecretIndentVisitor(SecretIndentCache indentCache, bool inTypingAssist)
 {
     this.myIndentCache    = indentCache;
     this.myInTypingAssist = inTypingAssist;
     this.myCache          = new Dictionary <ITreeNode, string>();
 }
 private static SecretIndentVisitor CreateIndentVisitor([NotNull] SecretIndentCache indentCache, bool inTypingAssist)
 {
     return(new SecretIndentVisitor(indentCache, inTypingAssist));
 }