(ctx context.Context, node *ast.Node, file *ast.SourceFile, languageVariant core.LanguageVariant, initialIndentation int, delta int)
| 79 | } |
| 80 | |
| 81 | func FormatNodeGivenIndentation(ctx context.Context, node *ast.Node, file *ast.SourceFile, languageVariant core.LanguageVariant, initialIndentation int, delta int) []core.TextChange { |
| 82 | textRange := core.NewTextRange(node.Pos(), node.End()) |
| 83 | return newFormattingScanner( |
| 84 | file.Text(), |
| 85 | languageVariant, |
| 86 | textRange.Pos(), |
| 87 | textRange.End(), |
| 88 | newFormatSpanWorker( |
| 89 | ctx, |
| 90 | textRange, |
| 91 | node, |
| 92 | initialIndentation, |
| 93 | delta, |
| 94 | FormatRequestKindFormatSelection, |
| 95 | func(core.TextRange) bool { return false }, // assume that node does not have any errors |
| 96 | file, |
| 97 | ), |
| 98 | ) |
| 99 | } |
| 100 | |
| 101 | func formatNodeLines(ctx context.Context, sourceFile *ast.SourceFile, node *ast.Node, requestKind FormatRequestKind) []core.TextChange { |
| 102 | if node == nil { |
no test coverage detected