[PowerQuery] Decompiling List.Range function
This example shows how to decompile the Power Query `List.Range` function into its underlying expression tree, revealing the nested structure of arguments and function bodies. It uses the `Value.ResourceExpression` API to access the function’s AST, then recursively traces and serializes the structure via `Json.FromValue`, with helper logic that converts values, types, lists, and records into a JSON-compatible format. A second expression, `DeepDecompile.pq`, directly navigates the resource expression’s `[Expression][Arguments]{0}[Function][Expression][Expression]` path to extract the innermost function body. The visualization renders the resulting JSON as a plain-text trace, highlighting the difference between high-level metadata lookup and low-level AST traversal.
AI-generated description