mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-27 12:11:15 -03:00
Properly print leading comments and indentation in functions
Store the entire function declaration, not just its job list. This allows us to extract the body of the function complete with any leading comments and indents. Fixes #5285
This commit is contained in:
@@ -20,8 +20,10 @@ struct function_properties_t {
|
||||
/// Parsed source containing the function.
|
||||
parsed_source_ref_t parsed_source;
|
||||
|
||||
/// Node containing the function body, pointing into parsed_source.
|
||||
tnode_t<grammar::job_list> body_node;
|
||||
/// Node containing the function statement, pointing into parsed_source.
|
||||
/// We store block_statement, not job_list, so that comments attached to the header are
|
||||
/// preserved.
|
||||
tnode_t<grammar::block_statement> func_node;
|
||||
|
||||
/// List of all named arguments for this function.
|
||||
wcstring_list_t named_arguments;
|
||||
|
||||
Reference in New Issue
Block a user