(r TextRangeWithKind, rangeStartLine int, rangeStartCharacter int, parent *ast.Node, contextNode *ast.Node, dynamicIndentation *dynamicIndenter)
| 750 | ) |
| 751 | |
| 752 | func (w *formatSpanWorker) processRange(r TextRangeWithKind, rangeStartLine int, rangeStartCharacter int, parent *ast.Node, contextNode *ast.Node, dynamicIndentation *dynamicIndenter) LineAction { |
| 753 | rangeHasError := w.rangeContainsError(r.Loc) |
| 754 | lineAction := LineActionNone |
| 755 | if !rangeHasError { |
| 756 | if w.previousRange == NewTextRangeWithKind(0, 0, 0) { |
| 757 | // trim whitespaces starting from the beginning of the span up to the current line |
| 758 | originalStartLine := scanner.GetECMALineOfPosition(w.sourceFile, w.originalRange.Pos()) |
| 759 | w.trimTrailingWhitespacesForLines(originalStartLine, rangeStartLine, NewTextRangeWithKind(0, 0, 0)) |
| 760 | } else { |
| 761 | lineAction = w.processPair(r, rangeStartLine, parent, w.previousRange, w.previousRangeStartLine, w.previousParent, contextNode, dynamicIndentation) |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | w.previousRange = r |
| 766 | w.previousRangeTriviaEnd = r.Loc.End() |
| 767 | w.previousParent = parent |
| 768 | w.previousRangeStartLine = rangeStartLine |
| 769 | |
| 770 | return lineAction |
| 771 | } |
| 772 | |
| 773 | func (w *formatSpanWorker) processTrivia(trivia []TextRangeWithKind, parent *ast.Node, contextNode *ast.Node, dynamicIndentation *dynamicIndenter) { |
| 774 | for _, triviaItem := range trivia { |
no test coverage detected