(ctx context.Context, sourceFile *ast.SourceFile, node *ast.Node, requestKind FormatRequestKind)
| 99 | } |
| 100 | |
| 101 | func formatNodeLines(ctx context.Context, sourceFile *ast.SourceFile, node *ast.Node, requestKind FormatRequestKind) []core.TextChange { |
| 102 | if node == nil { |
| 103 | return nil |
| 104 | } |
| 105 | tokenStart := scanner.GetTokenPosOfNode(node, sourceFile, false) |
| 106 | lineStart := GetLineStartPositionForPosition(tokenStart, sourceFile) |
| 107 | span := core.NewTextRange(lineStart, node.End()) |
| 108 | return FormatSpan(ctx, span, sourceFile, requestKind) |
| 109 | } |
| 110 | |
| 111 | func FormatDocument(ctx context.Context, sourceFile *ast.SourceFile) []core.TextChange { |
| 112 | return FormatSpan(ctx, core.NewTextRange(0, sourceFile.End()), sourceFile, FormatRequestKindFormatDocument) |
no test coverage detected