Files
Ophir LOJKINE 17e6e1e712 Improve SQLPage function argument warnings (#1225)
* improve sqlpage function argument warnings with source context

Made-with: Cursor

* Param extraction: Result-based errors, single caller message, no CompoundIdentifier special case

- expr_to_stmt_param returns Result<StmtParam, ExprToParamError>; error carries only line + kind (UnsupportedExpr, UnemulatedFunction, NamedArgs)
- function_args_to_stmt_params logs one formatted message (ctx.format_param_error) then returns Err
- Single unsupported-expr arm; expr_summary() used for description
- Rename ParamWarnContext to ParamExtractContext

Made-with: Cursor

* Surface param extraction error in parse result; add parse_sql error-message tests; remove are_params_extractable

- When func_call_to_param returns StmtParam::Error, store it and have extract_parameters return Err so parse yields ParsedStatement::Error with specialized message
- Add test_parse_sql_unsupported_expr_in_sqlpage_arg and test_parse_sql_unemulated_function_in_sqlpage_arg
- Remove dead are_params_extractable and its unused import

Made-with: Cursor

* Refactor sqlpage function argument error messages to match user expectations

- Overhauled ExprToParamError formatting to construct exact user-friendly descriptions.
- Removed superfluous anyhow::Context prefixes in func_call_to_param.
- Passed source_path properly through validate_function_calls to ensure file line numbers populate the new error template accurately.
- Renamed error test file to match its dynamic error output signature.
- Removed redundant mut mutability warnings on parsing logic loops.

* improve error messages

* Refactor SqlPageFunctionError representation to clean up 'syntax error' wrappers

- Replaced stringly-typed anyhow errors with a strongly typed SqlPageFunctionError.
- Removed source_path threading completely from the parameter extraction phases, conforming to better separation of concerns.
- Appended file path prefix dynamically at the evaluation stage in clone_anyhow_err strictly when downcasting to SqlPageFunctionError.
- Removed the confusing generic 'Caused by: x.sql contains a syntax error...' wrapper from actual function logic errors.

* Remove redundant 'reorganize' hint from error message

* readd deleted test

* split parameter extraction logic into a separate file

* Add to changelog
2026-03-01 09:52:46 +01:00
..
2025-09-15 14:01:28 +02:00
2026-01-08 16:46:10 +01:00
2025-12-12 00:25:30 +01:00